Hello Guest it is April 18, 2024, 05:15:25 AM

Author Topic: API For Axis Homed  (Read 867 times)

0 Members and 1 Guest are viewing this topic.

API For Axis Homed
« 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.
Re: API For Axis Homed
« Reply #1 on: July 21, 2021, 03:56:56 PM »
There is an option in the config to de-reference axes when e-stop is pressed

Offline Bill_O

*
  •  563 563
    • View Profile
Re: API For Axis Homed
« Reply #2 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)

Re: API For Axis Homed
« Reply #3 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 ?
Re: API For Axis Homed
« Reply #4 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)