Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

two edge separation without hardware aux input

I am using a PXI-6229 DAQ card with C# .net. 

 

I want to do a two edge separation measurement without a hardware input into the counter aux port.  I want the counter aux input to start when an event happens (in this case it is turning on a signal generator) and then stop when a digital input goes high to the gate.  There is no hardware digital input to start the aux input counter.  Is there a way to start the counter manually at the same time the a software command starts the signal generator?  The code would be something like this:

 

public void MeasureTime()
        {
            DigitalTask = new Task();
            CIChannel counterSetup;
            firstEdge = CITwoEdgeSeparationFirstEdge.Rising;
            secondEdge = CITwoEdgeSeparationSecondEdge.Rising;
            double minTime = 10e-3;
            double maxTime = 60e-3;
            string auxCounterInput =?
            string gateCounterInput = "/" + CardName + "/PFI8";
            
            counterSetup = DigitalTask.CIChannels.CreateTwoEdgeSeparationChannel(
                CardName + "/ctr0", "counter",
                minTime,
                maxTime,
                firstEdge, secondEdge, CITwoEdgeSeparationUnits.Seconds);
            
            counterSetup.TwoEdgeSeparationFirstTerminal =?
            counterSetup.TwoEdgeSeparationSecondTerminal = gateCounterInput;


            //Start task and turn signal generator on


            DigitalTask.Control(TaskAction.Verify);
            runningDigitalTask = DigitalTask;
            
            counterInReader = new CounterReader(DigitalTask.Stream);
           
            double data = counterInReader.ReadSingleSampleDouble();
           
        }

 

0 Kudos
Message 1 of 4
(3,901 Views)
Hi,
 
Could you please clarify your end goal of this application? What do you mean by doing an edge separation measurement without using a hardware input? We can set up triggers to start DAQ tasks. Can the signal generator be started with a pulse? Can the signal generator output a pulse at startup?
Jason H
Automated Test Software R&D
0 Kudos
Message 2 of 4
(3,869 Views)

Hi Jason,

 

My end goal is to measure the time from when the signal generator is turned on until a signal goes high on PFI8.  I have no way of connecting a hardware signal to the aux counter input to start the count.  There is no way for the DAQ to monitor the signal generator turning on.   Is there a way to start the counter using a sw trigger that will coincide with turning on the signal generator?

 

Thanks.

0 Kudos
Message 3 of 4
(3,865 Views)
Have you looked at the .NET examples we have on triggering? If you are using Windows 7, they are located in C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples. You can use these as a reference to get the proper syntax for triggers.
Jason H
Automated Test Software R&D
0 Kudos
Message 4 of 4
(3,843 Views)