09-02-2020 08:54 AM
Dear
I know this has been discussed before but in another way.
I can set the maximum time in the selected unit.
Thats OK.
The question is is this equivalent to the timeout?
It doesn't seam to be.
How can I limit the time of measurement?
Regards
Martin
Solved! Go to Solution.
09-02-2020 09:32 AM
The min and max inputs at DAQmx Create Virtual Channel are not, strictly speaking, bounding values for the measurement. They're basically clues for DAQmx to select an internal timebase intelligently. It will generally choose the fastest one that wouldn't lead to counter rollover if the separation time was at max.
You've probably got either an 80 or 100 MHz timebase on your chassis, so a 32 bit counter could rollover in (2^32) / (100e6) ~= 43 seconds.
All that said, I think you're looking for the 'timeout' input at DAQmx Read. This should be set at *least* as large as the largest actual measurement time you anticipate, but might sometimes be set very much larger. For example, you may need to start your program, then walk across the room to fire up the equipment that will generate the pulses whose time separation you want to measure. Maybe the max separation time is in the millisec realm, but you may still need a 30 second timeout to give you time to go through your launch sequence on the equipment.
-Kevin P
09-09-2020 11:09 PM
Hi Kevin,
thank you for your answer.
Indeed I'm looking for a timeout procedure.
Can I terminate the running task anyway if the timout occours?
Since the daqmx tast seams not to have a timeout the logical exception is to measure the time and kill the nidaqmx taks anyway.
Is it possible to do so?
Regards
Martin
09-10-2020 03:01 AM
Dear Kevin
The solution is simple.
I use the maximum time a a timeout time and wait until the timout time is reached.
Than I execute the DAQmx Control Task.vi and abort the task.
That works perfectly.
Regards
Martin
09-15-2020 06:29 AM
[Sorry for long delay, just getting back from out of town...]
The DAQmx Read function *DOES* have a timeout input. That's what you should use. Then if the read function call returns a timeout-related error code, you'd be better off calling DAQmx Stop to stop the task. Abort is not recommended for normal usage, it's more of a last resort.
-Kevin P
09-15-2020 08:28 AM
Hi Kevin,
I have overseen this.
Thank you for your reply.
Regards
Martin