Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

why does DAQ cause full CPU usage?

i have set up my vi to acquire a buffer of 360 data points, it acquires one point every time there is a pulse on an external channel. however whilst it is waiting for all the points it uses 100% cpu. can i stop it doing this?
0 Kudos
Message 1 of 3
(2,674 Views)
Hello,

The short answer is yes. You can keep it from using 100% CPU while waiting for points. I took a look at your code. One approach would be to put AI Read.vi in a loop, read a portion of your data at a time, then accumulate all the data at the end. A way to accomplish this would be to set "number of scans to read" input of AI Read.vi to zero, watch the "scan backlog" output, then do an actual read when the backlog has the number of scans you want. This allows the program to sleep between reads. Be sure to put a small wait in the read loop.

Another approach is to use DAQ Occurrences. In this case your program sleeps at the driver level. You can find an example of this by searching on "occurrences" in the NI Example Finder.

Best Regards,
Dou
g Norman
0 Kudos
Message 2 of 3
(2,674 Views)
Thanks for that Doug.

Regards,

Stewart.
0 Kudos
Message 3 of 3
(2,674 Views)