Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: rrc1962 on May 16, 2015, 12:51:13 PM

Title: Zero All
Post by: rrc1962 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
Title: Re: Zero All
Post by: pbarratt 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
Title: Re: Zero All
Post by: DazTheGas 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
Title: Re: Zero All
Post by: rrc1962 on May 16, 2015, 02:20:19 PM
Thanks guys....Seems like everything has to be "coded" in M4.
Title: Re: Zero All
Post by: dude1 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