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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am using a timed while loop and am unable to get the loop to run at a speed of less than 1ms (I am currently using the Wait(ms) function). How can I get a faster response?

I am trying to create a virtual engine within a timed while loop and am unable to get the loop to run at a speed of less than 1ms (I am currently using the Wait(ms) function). This does not however allow realistic engine speeds. How can I overcome this? I have access to a PCI-MIO-16E-4 board.
0 Kudos
Message 1 of 3
(2,523 Views)
andyt writes:

> I am using a timed while loop and am unable to get the loop to run at
> a speed of less than 1ms (I am currently using the Wait(ms) function).
> How can I get a faster response?
>
> I am trying to create a virtual engine within a timed while loop and
> am unable to get the loop to run at a speed of less than 1ms (I am
> currently using the Wait(ms) function). This does not however allow
> realistic engine speeds. How can I overcome this? I have access to
> a PCI-MIO-16E-4 board.

Andy,

Unless you use a real time platform, getting extactly 1 ms loop rate
(or even less) is impossible. It starts getting troublesome at about
0.1 Hz for standard operating systems.

I'd tackle your problem with "if i mod 10 == 0 then sleep 1 ms".
Of
course this is jerky by design.

HTH,

Johannes Nie?
0 Kudos
Message 2 of 3
(2,523 Views)
If you need fast, reliable loop rates, LabVIEW Real Time is definitely the way to go. You can find more information on this product at the following webpage: http://sine.ni.com/apps/we/nioc.vp?cid=3304〈=US
0 Kudos
Message 3 of 3
(2,523 Views)