Hello Guest it is May 10, 2021, 08:17:30 PM

Author Topic: macro for Home Axis  (Read 257 times)

0 Members and 1 Guest are viewing this topic.

macro for Home Axis
« on: November 04, 2020, 12:01:32 AM »
Hi
I have create macro for Home Axis
but when  I type in MDI and click Start cycle  Click 5 time it's do 1 time or nothing anything.
why ?

Code: [Select]
function m108()

local inst = mc.mcGetInstance()
local rc = 0

rc = mc.mcAxisHome(inst, 5)
end

if (mc.mcInEditor() == 1) then
m108()
end
Re: macro for Home Axis
« Reply #1 on: November 04, 2020, 03:04:54 AM »
Hi,
do you have a motor assigned as number 5?

If you have no home switch assigned to an axis which is being homed it will 'home in place', ie not move. An axis will
move only when it is logically connected to a motor number and a home signal for that motor is enabled.

Craig
My wife left with my best friend...
     and I miss him!
Re: macro for Home Axis
« Reply #2 on: November 04, 2020, 11:19:14 AM »
Hi,
do you have a motor assigned as number 5?

If you have no home switch assigned to an axis which is being homed it will 'home in place', ie not move. An axis will
move only when it is logically connected to a motor number and a home signal for that motor is enabled.

Craig

Hi MR. Craig
This my action

configure --> control --> active motor5 and set motor mapping motor5 on C axis
configure --> Plugins --> ESS V.260 --> Input Signals --> Motor 5 Home  set correct pin

I create new button on screen by copy from button Reffecrence Z  and change config and rename to C axis

Then
I try on screen click button Refference C   . Result  = Good, worked.

Then I try to create script macro ::::

Code: [Select]
function m108()

local inst = mc.mcGetInstance()
local rc = 0

rc = mc.mcAxisHome(inst, 5)
end

if (mc.mcInEditor() == 1) then
m108()
end

I try type in MDI  and click cycle Start Gcode
Result = nothing
When I spam click cycle Start Gcode  some time it's running for home!!! . I don't know script for check state , set state , before run it's ?
have any Idea for this my problem ?
Re: macro for Home Axis
« Reply #3 on: November 04, 2020, 11:44:20 AM »
I don't think you can use the API to home an axis in a macro. If you want to home an axis via gcode try 'G28.1  C1' in the MDI
Re: macro for Home Axis
« Reply #4 on: November 04, 2020, 10:03:24 PM »
I don't think you can use the API to home an axis in a macro. If you want to home an axis via gcode try 'G28.1  C1' in the MDI
Thank you bro.
I have question , How to script for click button on screen ? have ? or not have ?

Offline smurph

*
  • *
  •  1,400 1,400
  • "That there... that's an RV."
    • View Profile
Re: macro for Home Axis
« Reply #5 on: November 14, 2020, 02:06:00 AM »
Why do you need a script?  Just place a button on the screen, click on it, then find the event button on the properties window (it has a little lightening bolt) then select the "Home C" action on the left up action.  The button will only work when the machine is NOT in automatic mode (meaning idle and not in a cycle).  So be sure to set the "Enable With Machine" and the proper "Enabled States".

Steve