09-24-2018 06:07 AM
Is there a way to delay each iteration of a FOR LOOP by 2.5 msec? The delay millisecs only allows whole numbers..I think.
Thanks.
Solved! Go to Solution.
09-24-2018 06:38 AM
LabVIEW 2018 introduced a High Resolution Polling Wait VI. It polls the Windows time to "wait" for whatever time you need. Do note that it will use 100% CPU when the time left to wait is under 2ms.
If using an older version of LabVIEW, you could make something similar using the High Resolution Relative Seconds.
09-24-2018 09:29 AM
If you are doing this on a Windows platform you are not guaranteed to get a resolution this accurate. If your timing is this critical yo should be using a real time platform.
09-24-2018 09:58 AM
If you have a DAQ you could set up a sample of 4kHz and grab 10 (dummy) samples at a time. That should get you pretty Close. Windows isn't precise in this regard as it's not designed for that.
/Y
09-24-2018 10:10 AM
Maybe I wasn't think this through. When you mentioned DAQ a light bulb went off. What I'm trying to do ( PXI6229) is read 4 channels "simultaneously"..I know..I know I can't w a 6229 but if I read them fast enough its a magnitude better than what I need. So rather than delay my loop 2.5 msec I could do what Yamaeda suggested and manipulate samples and sample rate so that I get my 4 channels sampled ( inside my FOR Loop) at 2.5 msec satisfying my requirement. Sound legit?
Thanks..
10-06-2018 03:08 PM
@Clint1000 wrote:
Maybe I wasn't think this through. When you mentioned DAQ a light bulb went off. What I'm trying to do ( PXI6229) is read 4 channels "simultaneously"..I know..I know I can't w a 6229 but if I read them fast enough its a magnitude better than what I need. So rather than delay my loop 2.5 msec I could do what Yamaeda suggested and manipulate samples and sample rate so that I get my 4 channels sampled ( inside my FOR Loop) at 2.5 msec satisfying my requirement. Sound legit?
Thanks..
Absolutely !