Keith,
And are you saying a while loop in a macro will block any other Windows tasks. I thought the multi-threading in Windows would mean that didn't happen.
Well, actually you could overload the computer from any threads in a Windows program, but the Ismoving function has a short Thread.Sleep is why overloading can't happen.
But if you create a loop which do something continously without a Sleep then that will overload the CPU, at least it will overload one core of the CPU.
However the purpose of the Wait is not there for this reason...
Terry,
What the .Codesync differs in from the .Code is that it will not execute if a Codesync call is already running.
If I recall we needed this function when writting the 3D printer plugin.
And no it does not replace the possible need for a wait.
The Ismoving reports false (not moving) if the motion controller is in idle and the motion buffer is empty, so there is no future codes to be executed.
And things depends on what you updating, e.g. if you updating a DRO which has nothing to do any motion then there is absolutely no need to seport a moving,
because a DRO can be updated e.g. from a macroloop while motion can happen asyncronously and possibly that DRO has nothing to do with the motion.