LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2.5 msec delay

Solved!
Go to solution

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.

0 Kudos
Message 1 of 6
(2,446 Views)
Solution
Accepted by Clint1000

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,433 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 3 of 6
(2,400 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(2,394 Views)

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   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..

0 Kudos
Message 5 of 6
(2,388 Views)

@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   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 !


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 6
(2,334 Views)