Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: pmageau on July 21, 2021, 10:36:47 AM

Title: API For Axis Homed
Post 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.
Title: Re: API For Axis Homed
Post by: SwiftyJ on July 21, 2021, 03:56:56 PM
There is an option in the config to de-reference axes when e-stop is pressed
Title: Re: API For Axis Homed
Post by: Bill_O on July 21, 2021, 05:27:58 PM
I think this is what you are looking for.

LUA Syntax:
homed, rc= mc.mcAxisIsHomed(
      number mInst,
      number axisId)

Title: Re: API For Axis Homed
Post by: pmageau on July 21, 2021, 06:52:38 PM
Thanks for the code snippet!

One last question on this topic... Does the RED STOP button also deference the Axes ?
Title: Re: API For Axis Homed
Post by: SwiftyJ on July 22, 2021, 04:49:41 AM
It doesn't, but you can use the following. I've also attached a picture showing the deref on estop option

Code: [Select]
rc = mc.mcAxisDeref(
                    number mInst,
                    number axisId)

or

Code: [Select]
rc = mc.mcAxisDerefAll(
                       number mInst)