Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: donjordan on May 08, 2020, 03:24:56 AM
-
Im diving into macros in Mach3 and trying to figure out why, when I run a program just to read the state of isMoving(), it returns the wrong value. Am I missing something here? I've got the documentation open but can't find anything in there that would indicate why its reporting the wrong value.
state = isMoving()
Message "Machine Moving = " & state
This values returns a 1, even though the machine is not moving (expecting a 0).
-
just tested here in the VB Scripter window. working here.
-
Thank you for your response. When I put the code in the VB Scripter window I also get the expected 0. However when I load the code in a separate file (M801.M1S) and run M801 through the MDI input, it returns a 1. It is interpreting those two methods differently, not sure why.. or maybe im not loading it properly through MDI?
-
You would normally have it in a while loop, mach3 only updates ever 50ms to 100ms or in some cases a short sleep(50) after the call helps.
While isMoving()
Sleep(10)
Wend
or
state = isMoving()
Sleep(50)