07-12-2005 03:27 PM
Solved! Go to Solution.
07-12-2005 03:32 PM
07-12-2005 04:07 PM
PM,
Thanks for the response. Attached is my program below. I don't have the option of saving as a .llb file type. (I only have the base package which is missing the majority of the nice functions I've learned about and could use, so it wouldn't surprise me if that is way I don't have it available.) Anyway here it is.
07-12-2005 04:29 PM - edited 07-12-2005 04:29 PM
Your big while loop has no wait if...
"Zero Transducers" is false AND the big case state is not "5". (The normal run states seem to be states 2 and 3).
Add small delay somewhere where it executes at every iteration of the big while loop. (e.g. in the false case of the case structure in the upper right or next to it)
Message Edited by altenbach on 07-12-2005 02:32 PM
07-12-2005 04:30 PM
I'm not seeing where you put the 10mSec wait. If it isn't in the code now try your code with the wait, but make sure it isn't in one of the cases. With a test example of a while loop containing just a 4 case "state machine" that just iterates through the cases, when I have no wait the CPU is at 50% on my machine, with a 1mS wait it drops to less than 1%. When you had it in before where was it in the code? If you had it in one of the conditional cases it might not have been seen often, so it wouldn't have much effect. I haven't looked at the actual DAQ too closely yet.
P.M.
07-13-2005 07:58 AM
The wait (ms) comand was in the big while loop when I tried it before. I've since tried a couple different things without any success either. These included changing sampling rates, data transfer array sizes, the sampling mode from continuous to finite, and maybe even a few others that I've forgoten already. All without any luck. I've also tried the Wait Until Next ms Multiple comand now that I think about it.
I've written short tryout programs in the past that reduce the CPU usage, but they had no DAQ functions in them. That is why I'm currious if the DAQ functions of configuration or possilbly the math functions are also causing this.
07-13-2005 11:11 AM
07-13-2005 11:11 AM
07-14-2005 08:12 AM
07-14-2005
11:38 AM
- last edited on
06-24-2025
05:37 PM
by
Content Cleaner
Hi-
Stuart's suggestion is perhaps the most useful- NI-DAQmx prior to 7.4 used a "Yield" mode of operation by default. This meant that DAQmx would automatically use all CPU time if available but would yield to other applications without resisting whenever the O/S requested. With NI-DAQmx 7.4 and later "Sleep" mode is the default operation and apparent CPU usage is usually decreased very significantly.
An upgrade of your NI-DAQmx driver would be very useful in determining if this is a driver problem or a programming problem. NI-DAQmx 7.5 just released and is a free download from ni.com.
Please let us know if you're still seeing the problem after this driver upgrade.
Thanks-