02-18-2013 12:40 PM
I have created the attached Wait.vi function in order to add error controls and indicators for timing function. I am using this function as a software pause between toggling a digital output line on a USB-6501 so that it sequences 0v --> wait 0.25s --> 5v --> wait 8s. You can see this in the attached picture. The Toggle LO/HI subVIs shown simply write the Boolean value to the selected digital line. I am using this to simulate pushing the power button of a motherboard.
My code uses this subVI throughout to simulate many button pushes. The problem that I'm seeing is when I run maybe 300+ iterations of this code. The first iteration takes maybe 4 minutes to execute, but each iteration seams to take longer. To me, this suggests some jitter buildup throughout.
Can anyone think of a better way for me to implement a software pause? Thanks.
02-18-2013 01:08 PM
Your VI is doing exactly what the built-in Delay function does so I'm not sure why you wrote your own.
In any case, there is considerable jitter in using software waits and there is not much you can do about that unless you move to a real-time os. You say it 'seems to take longer'. You should be able to measure this. Without seeing all of your code, it's impossible to say whether you moight have other factors (i.e. building unbounded arrays) that could cause extended execution times.
02-18-2013 01:15 PM
I wrote this subvi so I could use error flow to control when the wait takes place. That's it really.
Thank you for confirming my suspicions. Too bad there is no good solution.
I can't measure this time delay because I am developing this software for a remote located test station that is run by a person with poor communication. He tells me "The longer it runs, the longer each test iteration takes."
I don't necessarilly care what the delta t is for each given iteration, but I'd rather a 4 minute test iteration not take 15 minutes after 500 runs.
02-18-2013 01:38 PM
@ambaum01 wrote:
"The longer it runs, the longer each test iteration takes."
This sounds like poor memory mnagement: Growing large arrays, Improper reference handling etc... attach the subvi and the caller that does the timing
02-18-2013 01:46 PM
It's a fairly large program with about 20 subVIs.
Attached is a Get Link Speed MB1 that calls Wait.vi.
This VI has 4 other "twins" called in a for loop that executes 1000 times (pictured).
I have changed Wait.vi to be reentrant, which may help based on my reading. I have used LabVIEW for some time now, but have only recently had to get into the nitty gritty details of how the program behaves.