01-27-2006 10:28 AM
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
01-30-2006 04:01 PM
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
02-02-2006 06:33 PM