03-06-2009 05:33 PM
I created two tasks: one for a counter (ctrHandler). one for 6 ai channels (datHandler).
Use DAQmxReadCounterScalarU32 and DAQmxReadAnalogF64 can not give the data generated at the same time. There is software time delay.
DAQmxReadCounterScalarU32(ctrHandler,10.0,&ctrValue,NULL);
DAQmxReadAnalogF64(datHandler,-1,10.0,DAQmx_Val_GroupByChannel,data,400*numLaser,&read,NULL);
How to make synchronization on card?
03-09-2009 11:35 AM
Are you trying to synchronize the analog reads witht the counter measurements? If so to do this use an Arm trigger for the counter, and a Start trigger for the analog inputs. If you use the same source for the both the arm and start trigger they will both start at the exact same time. For more information on triggers please refer to the DAQmx C Reference help. There is a topic entitled: 'List of Trigger Properties'which should answer most the questions that you have.
03-09-2009 03:32 PM
CharlesD,
I read the information on triggers. the Start trigger and arm start trigger seem to synchronize starting tasks.
but I want to synchronize DAQmxReadCounterScalarU32 and DAQmxReadAnalogF64 two functions.
So after the tasks started. I can get the input data and counter data at every certain time.
ex. at every time T, I need the analog data at timeT and counter data at timeT. but if I use
DAQmxReadAnalogF64(datHandler,-1,10.0,DAQmx_Val_GroupByChannel,data,400*numLaser,&read,NULL);
DAQmxReadCounterScalarU32(ctrHandler,10.0,&ctrValue,NULL);
to read data. Actually I will only get analog data at timeT and counter data at timeT+t. (t is the delay time between the two functions)
how can I get both data at the same time but not stop tasks.
03-09-2009 04:42 PM
02-10-2014 12:42 PM