161
Mach4 General Discussion / Re: How do I get to the center of 2 edges?
« on: October 10, 2017, 05:50:08 AM »
The button code needed is simple. Here is what I used for X/2; Y*2 is similar:
--AW. Halve X axis position for centring
local inst = mc.mcGetInstance()
local val = mc.mcAxisGetPos(inst, mc.X_AXIS)
local rc = mc.mcAxisSetPos(inst, mc.X_AXIS, (val / 2))
You might want to set EnableWithMachine for these buttons.
Allan
--AW. Halve X axis position for centring
local inst = mc.mcGetInstance()
local val = mc.mcAxisGetPos(inst, mc.X_AXIS)
local rc = mc.mcAxisSetPos(inst, mc.X_AXIS, (val / 2))
You might want to set EnableWithMachine for these buttons.
Allan