Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxCfgDigEdgeStartTrig

Hello

I am using a PCI6537 and VC++. I want to start reading data on the channels when a trigger signal arrives on PFI1. This signal is normally low and  becomes 1 for some clock cycles. I want to start reading data when this signal is 0 again (falling edge).

When I look at the data read, I see that data is being aquired but read as 0 even before the trigger signal . When the signal is triggered the data would be read correctly.

Here is a part of my program: 

 

    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateDIChan(taskHandle,"Dev5/port0/line0:7,Dev5/port1/line0:7,Dev5/port2/line0:7","",DAQmx_Val_ChanForAllLines));
    DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(taskHandle,"/Dev5/PFI1",DAQmx_Val_Falling));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"/Dev5/PFI5",8000000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,111512));

    DAQmxErrChk (DAQmxStartTask(taskHandle));

    DAQmxErrChk (DAQmxReadDigitalU32(taskHandle,111512,10,DAQmx_Val_GroupByChannel,data32,111512,&read,NULL));

 

 

 

Is this how CfgDigEdgeStartTrig works or is there something wrong? How can I really start reading data when the PFI1 is trigerred?

 

I have also another question: The signal on PFI1 is a periodic signal, so it would be 1 after some time. After the  second falling edge of PFI1, data is again read just as 0. Is this also part of this command? If so what should I do to be able to continuously read data after the first trigger?

 

reagrds,

Leily

0 Kudos
Message 1 of 2
(2,918 Views)

Sorry,

 

I had made a mistake in the setup, the  DAQmxCfgDigEdgeStartTrig is working properly.

0 Kudos
Message 2 of 2
(2,893 Views)