Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: pmageau on July 21, 2021, 10:36:47 AM
-
Is there an API that when called would indicate that a particular axis is homed ?
I did some testing and the "homed LEDs" on the standard Mach screenset do not behave as I would like. I would expect them to go red again if an estop condition occurred since that is not a controlled stop and any home position cannot be known/guaranteed.
I am trying to add some safety scripting to force me to home when I try to do certain operations(e.g. cycle start, probing, ...) and an axis is not homed.
-
There is an option in the config to de-reference axes when e-stop is pressed
-
I think this is what you are looking for.
LUA Syntax:
homed, rc= mc.mcAxisIsHomed(
number mInst,
number axisId)
-
Thanks for the code snippet!
One last question on this topic... Does the RED STOP button also deference the Axes ?
-
It doesn't, but you can use the following. I've also attached a picture showing the deref on estop option
rc = mc.mcAxisDeref(
number mInst,
number axisId)
or
rc = mc.mcAxisDerefAll(
number mInst)