LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

about the time when using scan_op

Hi,

I'm having trouble getting the SCAN_op routine to return in a reasonable
amount of time in a Win2000 system(6.9.1 NI-DAQ).

The routine should return in ~3 ms based on the 200,000 samples/s rate
programed, but it's taking ~20ms. No errors are returned.

Has anyone seen this behavior before?
Any thoughts would be appreciated
0 Kudos
Message 1 of 2
(2,515 Views)
Hello;

That function is a syncrhonous NI-DAQ function which will make the execution pointer of your code to get stuck there until the buffer is ready to be read. The time that will take is a function of the buffer size and the scan rate.

In case you want your application to don't suck up the CPU time, and be able to execute other tasks while waiting for the buffer to be filled up, you need an asynchronous DAQ task.

In this context, a synchronous function call, such as SCAN_Op will wait in the function till all the specified number of scans are acquired and then return. Asynchronous function calls allow you to do other operations in the background. Also, you can implement occurrences and events when you take the asynchronous approach. There is a good Develop
er Zone document called "An Overview of DAQ Events and Occurrences" if you are interested. You will see several documents, including that one if you search http://www.ni.com/support for "asynchronous".

Hope this helps.
Filipe A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,515 Views)