Hello Guest it is March 19, 2024, 05:27:40 AM

Author Topic: Question about IsMoving...  (Read 1846 times)

0 Members and 1 Guest are viewing this topic.

Question about IsMoving...
« 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

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Question about IsMoving...
« Reply #1 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)
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Question about IsMoving...
« Reply #2 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.