811
Mach4 General Discussion / Re: Changing G54 inside script
« on: June 19, 2019, 06:21:08 PM »
If I am understanding your problem right you need to offset the x axis depending on which tool you use.
why not set up a sub routines for each tool with a G52 x-50 or what ever you need the offset to be and another sub with G52 x0 in it to call to cancel that offset. You can also set the Y and Z for each tool this way.
All the subs could be coded into your cad system or stored in Machs subs folder.
So your code would look along these lines
%
M98 P251(CALL TOOL 1)
G00 X150 Y20.
G01 ETC.
M98 P250 (CANCEL OFFSET)
M98 P252 (CALL TOOL 2)
ETC.
M98 P250 (CANCEL TOOLS)
ETC.
M30
Subs would be
O250
T0 M6
G52 X0
M99
O251
T1 M6
G52 X-50.
M99
O252
T2 M6
G52 X-100.
M99
%
why not set up a sub routines for each tool with a G52 x-50 or what ever you need the offset to be and another sub with G52 x0 in it to call to cancel that offset. You can also set the Y and Z for each tool this way.
All the subs could be coded into your cad system or stored in Machs subs folder.
So your code would look along these lines
%
M98 P251(CALL TOOL 1)
G00 X150 Y20.
G01 ETC.
M98 P250 (CANCEL OFFSET)
M98 P252 (CALL TOOL 2)
ETC.
M98 P250 (CANCEL TOOLS)
ETC.
M30
Subs would be
O250
T0 M6
G52 X0
M99
O251
T1 M6
G52 X-50.
M99
O252
T2 M6
G52 X-100.
M99
%