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?