Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing from continuous to finite sampling

Hi All,
 
I'm programming the 6602 with DAQmx 7.4 Ansi C API.  This is pretty small issue, but since it might be a bug I thought I'd post it anyway.  When I run a counter input task with implicit timing (say period or frequency measurement) in continuous sampling mode everything works fine - the task can be restarted after it has been stopped without any problems.  The same goes for finite sampling mode.  However, if I run the task in continuous mode, stop it, switch to finite mode and run it again, then it never seems to finish.  More specifically, even after all the samples have been read, neither DAQmxIsTaskDone() nor DAQmxGetTaskComplete() indicates that the task is completed.  Also, the done event callback function is not executed.  Consequently, my thread for reading the data and saving it to file never completes even though all the data is read from the buffer.  Anyone know what is going on here?  As a workaround, maybe I  could monitor the amount of data read from the buffer and stop the task explicitly once the requested number of samples have been collected, but I'd rather have it complete naturally......
 
Jeff
0 Kudos
Message 1 of 2
(3,140 Views)
Hi Axiom-
 
I have been able to replicate the same behavior you're seeing using NI-DAQmx 7.5, the most recent released version.  It seems that this may be an issue and I will file a corrective action request for the issue.
 
For the timebeing, your suggestion to monitor the number of samples read and programmatically stop the task seems like a solid workaround.  Please post back if you have any additional questions.
 
Thanks for keeping us on our toes!Smiley Wink
Tom W
National Instruments
0 Kudos
Message 2 of 2
(3,122 Views)