8
« on: March 10, 2022, 08:27:07 PM »
I have an Automatic tool changer on my machine. It only holds 7 tools, and I swap out the tools often for different jobs. So in my tool change script it gets the tool then goes to the depth setter and measures tool length. The depth setter is hooked up to my probe input. It's setup so that when the tip of the tool touches the table Z on the DRO reads 0.
I just do hobby work so I will put a pice of plywood on the machine, jog the axis over to where I want it to start cutting, and jog the z axis down to the top of the piece of plywood. I then hit the Zero X, Y, Z buttons next to the DRO. This makes it so that Z on the DRO reads 0 when the tip touches the top of the wood.
When a tool changes and it sets the depth of the new tool it messes up the work ofsets. To set the measured height I use the command:
mc.mcAxisSetPos(inst,2,measuredHeight)
Should I be using a different command? I can read the offsets using:
CurToolZOffset = mc.mcCntlGetOffset(inst, 2, 1)
But there is no way to set the value.
Does anyone know how I should be calculating the height so that the workoffset is accounted for?