Is this better? From the Mach 3 wiki:
A frequent requirement is to have to wait for Mach3 when doing several commands, to keep them executing in order. The:
While IsMoving
Wend
Loop is the typical way of doing this.
ex:
code "G0X100"
While IsMoving()
Wend
However, this causes the system to make millions of calls to the subsystem to determine if Mach3 is finished. The CPU load rises terribly. A solution is to wait for 100ms or so each time you check unless you need a very tight response time. The solution is to use a syntax as follows..
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
.
.
.
Code "G0X100"
While ismoving()
Sleep 100
Wend
I suppose its somewhat moot, since this will go away in V4.