Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

retriggerable digital output strange behavior

Solved!
Go to solution

I have created a digital edge retriggerable digital output (finite) task as the following: (in DAQmx C)

 

DAQmxCreateTask("",&_taskHandle);
DAQmxCreateDOChan(_taskHandle,"/Dev2/port0/line6","",DAQmx_Val_ChanPerLine);
DAQmxCfgSampClkTiming(_taskHandle,"/Dev2/Ctr0InternalOutput",_clockRate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,static_cast<uInt64>(_sampleCount));
DAQmxCfgOutputBuffer(_taskHandle,static_cast<uInt32>(_sampleCount));    
DAQmxCfgDigEdgeStartTrig(_taskHandle,"/Dev2/PFI4" ,DAQmx_Val_Rising);
DAQmxSetStartTrigRetriggerable(_taskHandle,true);
DAQmxWriteDigitalLines(_taskHandle,static_cast<int32>(_sampleCount),FALSE,-1,DAQmx_Val_GroupByChannel,_pDigital,NULL,NULL);
DAQmxStartTask(_taskHandle);

 

///// sample clock:

DAQmxCreateTask("", &_taskHandleCO);
DAQmxCreateCOPulseChanFreq(_taskHandleCO, "/Dev2/ctr0", "", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, _clockRate, 0.5);
DAQmxCfgImplicitTiming (_taskHandleCO, DAQmx_Val_ContSamps, _numSamples);
DAQmxStartTask(_taskHandleCO);

 

When I run the task without setting retriggerable, it output correct signal. However, if I run with retriggerable, it output almost exact 2 times faster than normal. For example, a pulse with width of 10 ms became 5 ms, and repeat itself again to be 2 pulse of 5 ms. It is repeatable no matter how many or how fast the triggers supplied.

My card is PCIe-6363. I don't know what causes this strange behavior, and hopefully someone can help on this.

Thank you.

0 Kudos
Message 1 of 4
(2,921 Views)

Hi,

 

Have you check the example of DAQmx in C about a Retriggerable task? 

Look for it at the attachments. In this example it comes how to do a retriggerable task with DAQmx C. Try implementing the Retriggerable function as they do in this example. 

0 Kudos
Message 2 of 4
(2,872 Views)
Solution
Accepted by topic author skuo1008

It goes away after reset configuration. Might be worthwhile for future notice.

0 Kudos
Message 3 of 4
(2,836 Views)

Hi! 

Please mark your post as the solution so it can be used for future reference. 

0 Kudos
Message 4 of 4
(2,792 Views)