this code is working except for 2nd tool change it is changing the offset to the 2nd tool but not stopping to let me change tool to the 2nd tool
i need a stop in there for second tool an it to change the tool selected to that tool
(1001)
(T12 D=0.45 CR=0.225 - ZMIN=-0.1803 - BALL END MILL)
(T14 D=0.5 CR=0. - ZMIN=-0.2 - FLAT END MILL)
G90 G94 G91.1 G40 G49 G17
G20
G28 G91 Z0.
G90
(2D CONTOUR1)
M5
M9
T14 M6
G54
M8
G0 X2.9 Y-0.4
G43 Z0.5906 H14
Z0.1969
G1 Z0.0394 F13.1
Z-0.15
G19 G3 Y-0.35 Z-0.2 J0.05 K0.
G1 Y-0.3 F39.4
G17 G3 X2.85 Y-0.25 I-0.05 J0.
G1 X2.5628
X0.15
G2 X-0.25 Y0.15 I0. J0.4
G1 Y1.85
G2 X0.15 Y2.25 I0.4 J0.
G1 X2.28
X2.85
G2 X3.25 Y1.85 I0. J-0.4
G1 Y0.15
G2 X2.85 Y-0.25 I-0.4 J0.
G3 X2.8 Y-0.3 I0. J-0.05
G1 Y-0.35
G19 G2 Y-0.4 Z-0.15 J0. K0.05
G0 Z0.5906
G17
G28 G91 Z0.
G90
(2D POCKET1)
M5
M9
M1
T12 M6
G54
M8
G0 X3.152 Y2.1806
G43 Z0.5906 H12
Z0.1969
G1 Z0.0056 F39.4
G19 G2 Y2.1356 Z-0.0394 J-0.045 K0.
G1 Y2.0646
Y-0.0648
Y-0.0666
im using
factory m6 at moment
function m6()
local inst = mc.mcGetInstance()
local selectedtool = mc.mcToolGetSelected(inst)
local currenttool = mc.mcToolGetCurrent(inst)
if selectedtool == currenttool then
mc.mcCntlSetLastError(inst, "Current tool == Selected tool so there is nothing to do")
else
--Remove this line if you would not like the Z axis to move
mc.mcCntlGcodeExecute(inst, "G90 G53 G0 Z0.0");--Move the Z axis all the way up
mc.mcCntlToolChangeManual(inst, true);
mc.mcCntlSetLastError(inst, "Current tool == " .. tostring(selectedtool) .. " Previous Tool == " .. tostring(currenttool))
mc.mcToolSetCurrent(inst, selectedtool)
end
end
if (mc.mcInEditor() == 1) then
m6()
end