Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

using system.threading.thread.sleep() after BeginMultiSampleRead ...

Hi. I am trying to use a routine like this (I am using VB .NET and NIDAQmx Libs):

 

myTaskAnalogInReader.BeginMutliSampleRead(...;...;...) 

Application.Doevents() 

system.threading.thread.sleep(sleeping_time) 

 

when I call sleep function.. so does the buffer collect data during the sleeping_time?

 

Regards

Vijay 

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

Hello Vijay,

Thank you for posting on the NI Discussion Forums.  Once you have began an acquire (read) on a signal on your data acquisition device, your program will read the signal values from the device’s on board buffer when the buffer reaches a certain point.  So, you can put the thread to sleep, and should be able to wake it up and take data from the buffer, but if you acquire too many samples while the thread is asleep, then you will obviously be losing (overwriting) data in the buffer. 

Of course, the best way to check this is to actually try it out.  Use the EndReadMultiSample( ) method once you wake the thread and see (1) if an exception occurred, and (2) if the number of waveform samples you expect to see are returned.

Chris_G
Sr Test Engineer
Medtronic, Inc.
0 Kudos
Message 2 of 2
(4,330 Views)