From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-19-2007 12:08 PM
10-19-2007 02:39 PM
10-22-2007 09:11 PM - edited 10-22-2007 09:11 PM
Hi MeCoOp,
Whenever you have a loop, it is good practice to include a wait function (found in the Timing Palette) within it.
Otherwise the computer will execute the code within the loop as quickly as it can, thus consuming all your computer’s resources.
Message Edited by Mark E on 10-22-2007 09:12 PM
10-23-2007 08:19 AM
10-24-2007 02:54 PM
MeCoOp,
Do you want to achieve a specific timing of the loop or just process samples as quickly as possible? The loop will wait for all of the samples specified by the DAQmx Read VI before passing its output to the rest of the loop. Without a wait function inside the loop, it will go right into the next iteration of the loop without giving the processor any rest. This will make your processor run at 100% no matter how efficient your code is inside. It also makes your process prone to timing inconsistencies when Windows decides to run a different process instead of your VI.
Your code looks lean to me. I suggest adding one extra error handling step: make your VI stop if it encounters and error, rather than waiting until you stop it. I’ve done this in the code (by unbundling the error status and OR-ing it with the stop button) and posted it back so you can see it. I’ve also added a function that will show you the time delay between loops. Feel free to take it out.
10-25-2007 08:26 AM
Mark, thanks very much for your help! I've been hesitant to load LV 8.5 on my computer because of some of the problems some of the board members have run into. Can anyone save the "tweaked.vi" in 8.2.1 so I can view it?
Thanks.
10-25-2007 08:40 AM - edited 10-25-2007 08:40 AM
Message Edited by Mark E on 10-25-2007 08:41 AM