Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use on borard start&stop trigger when in OnBoardLooping output of pci-6534

Happy Chinese New Year Everyone!
I have finished a program that use OnBoardLooping output , the program like this:

DAQmxCreateTask("",&taskHandle)
DAQmxCreateDOChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines)
DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI0",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000)
DAQmxGetDOUseOnlyOnBrdMem(TaskHandle taskHandle, const char channel[], bool32 *data);
DAQmxSetWriteRegenMode(TaskHandle taskHandle, DAQmx_Val_AllowRegen );
DAQmxWriteDigitalU32(taskHandle,8,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL)
DAQmxStartTask(taskHandle)
//keep doing until stop or error
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);

Now I use DAQmxStartTask(taskHandle) and DAQmxStopTask(taskHandle) to control the output of the signal.   But now, I need to use the on board "STARTTRIG" and "STOPTRIG" signal to start and stop the digital output, how can I do? Is there any functions to config that?

thank you

ruirong

0 Kudos
Message 1 of 3
(3,225 Views)

Ruirong,

You should be able to use the functions:

DAQmxCfgDigEdgeStartTrig  ß configures the start trigger
DAQmxCfgDigEdgeRefTrig ß configures the stop trigger

 

This is assuming that the triggering signals are digital. Take a look in the NI-DAQmx C reference manual (found installed under the National Instruments folder >> DAQ) for more information about these functions or if you want to use an analog trigger.

 

You would put this statements before the DAQmxStartTask call.

 

Hope that helps you out. Take care.

 

-GDE

0 Kudos
Message 2 of 3
(3,200 Views)
OK
thank you GDE. I 'll try.
 
ruirong
0 Kudos
Message 3 of 3
(3,190 Views)