Hello Guest it is March 29, 2024, 09:16:32 AM

Author Topic: Zero All  (Read 3711 times)

0 Members and 1 Guest are viewing this topic.

Zero All
« on: May 16, 2015, 12:51:13 PM »
I see button actions to zero the individual axes, but not a "Zero All".  Is there a way to zero all?  Maybe an equivalent to doOemButton() wher you can call the ZeroX, ZeroY and ZeroZ actions?

Thanks
Re: Zero All
« Reply #1 on: May 16, 2015, 02:03:27 PM »
I think you'd have to script a button and use rc = mc.mcAxisSetMachinePos(number mInst, number axis, number val) to zero the machine position and rc = mc.mcAxisSetPos(number mInst, number axis, number val) to zero the offset position where val = 0.
Would be nice to have an offset tab like M3.

Peter

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Zero All
« Reply #2 on: May 16, 2015, 02:06:46 PM »
Make a new button in the editor and use something like the code below to zero DRO`s

Code: [Select]
local inst = mc.mcGetInstance()
mc.mcAxisSetPos(inst, 0, 0);
mc.mcAxisSetPos(inst, 1, 0);
mc.mcAxisSetPos(inst, 2, 0);
mc.mcAxisSetPos(inst, 3, 0);

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Zero All
« Reply #3 on: May 16, 2015, 02:20:19 PM »
Thanks guys....Seems like everything has to be "coded" in M4.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Zero All
« Reply #4 on: May 16, 2015, 08:18:32 PM »
Make a new button in the editor and use something like the code below to zero DRO`s

Code: [Select]
local inst = mc.mcGetInstance()
mc.mcAxisSetPos(inst, 0, 0);
mc.mcAxisSetPos(inst, 1, 0);
mc.mcAxisSetPos(inst, 2, 0);
mc.mcAxisSetPos(inst, 3, 0);

DazTheGas

bang on put it in a button as it is and it works