Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling runs CPU at 100%

Solved!
Go to solution
I'm using an NI 4472 DSA and have a minor issue when running the Spectrum analyzer example code. The CPU pegs at 100% when I sample >25k. is there a known fix for this issue?
0 Kudos
Message 1 of 4
(4,060 Views)
Solution
Accepted by topic author talltubatom

Hi talltubatom,

        The behavior that you're seeing is due to the nature of the DAQmx driver. This KB explains that behavior for DAQmx 7.4 and higher.  If you are looking to reduce CPU usage, you could use"wait" mode, otherwise, if you use "yield" you will still see high CPU usage, but if other programs need to execute, they will be given the necessary CPU.  Let me know if you have other questions about that, have a great day!

 

Message 2 of 4
(4,037 Views)

is wait a function of the reader?

 

I don't understand how this only explains high speed aquisition. Because the sleep timer is increased at low speeds?

0 Kudos
Message 3 of 4
(4,024 Views)

The KB I linked in my last post states: "However, it should be noted that if data is arriving or space is being made available fast enough such that the NI-DAQmx process does not have to wait for data, then the process will never be put to sleep and no reduction of CPU usage will occur."  That statement explains the default sleep behavior- let me know if you have more questions.  Take care!

 

0 Kudos
Message 4 of 4
(4,009 Views)