Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: hose on March 15, 2017, 06:21:06 PM

Title: Question about IsMoving...
Post by: hose on March 15, 2017, 06:21:06 PM
I'm new to Mach3 (well a newbie @ CNC all-together) evaluating the latest build (demo) to see how it works with my new Chinese Novusun-NVEM controller. Turns out not great but it seems to be the controller and not Mach3; So I'm modifying the 'ref-all-home' macro to help a bit, as I get better at operating the CNC machine.

The issue I have is with IsMoving() as follows:

(Soft Limits are off)....
.......
code(G00 X30 Y30 Z-7)
While IsMoving()
Wend
'Sleep 2000
DoOEMButton(119)

Soft limits will not turn on, and I get a 'Machine out of limits for Soft Limits Activation' error message; However if I uncomment the Sleep command and wait the 2 secs, it works fine. Does IsMoving() not wait on movements issued via the code() command ??? What did I miss
Title: Re: Question about IsMoving...
Post by: Chaoticone on March 15, 2017, 07:07:28 PM
The sleep should be in the While IsMoving loop....... All while IsMoving loops should have a sleep in them. Also, if you have not set dwell to milliseconds in general config. you will be sleeping for 2000 seconds instead of 2 seconds. A sleep of 200 ms should be good.

code(G00 X30 Y30 Z-7)
While IsMoving()
    Sleep 200
Wend

DoOEMButton(119)
Title: Re: Question about IsMoving...
Post by: hose on March 15, 2017, 07:43:52 PM
Well I have not changed anything in General Configuration but I can say that Sleep 2000 is pausing for 2 secs and not 33 minutes. I tried your suggestion and still same results.