05-05-2014 03:24 PM
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();
}
05-06-2014 03:06 PM
05-06-2014 04:39 PM
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.
05-07-2014 04:23 PM