11-14-2018 09:01 AM - edited 11-14-2018 09:05 AM
I am using
DAQmxCreateTask ("", &CE_Handle); DAQmxCreateCOPulseChanTime (CE_Handle, "/6612/ctr0", "", DAQmx_Val_Seconds, DAQmx_Val_High, 0.01, 0.000015, 0.01); DAQmxCfgImplicitTiming(CE_Handle, DAQmx_Val_ContSamps, 0); DAQmxStartTask(CE_Handle)
to have my 6612 DAQ card output a pulse every 10mS
I now want a function which will block until one of these pulses occurs, can I read this clock line even though it is generating pulses? is there a DAQmx function which will wait for an edge?
11-15-2018
08:12 AM
- last edited on
01-03-2025
02:51 PM
by
Content Cleaner
Hello krugman3,
Do you want to wait for the first pulse to occur, or do you want to sync your code to the 10ms recurring delay of the counter? What is the goal of the code you want to execute after it saw the pulse?
DAQmxWaitForNextSampleClock could be what you are looking for. Depending on what you are trying to achieve, registering a callback function on the counter output event with DAQmxRegisterSignalEvent could also do the trick.
Also, the output line of ctr0 is PFI 36. According to the NI 6612 User Manual, page 4-2 (page 75 in the pdf), all PFI terminals can be routed to i.e. a DI Reference Trigger. Would a reference trigger (DAQmxCfgDigEdgeRefTrig) be an answer to your question?
Maybe routing your generated ctr0 signal to an input counter and reading the counted ticks (DAQmxReadCtrTicks) from your code is an option as well?