I would change the program number of the following Tool Change Subprogram to any available number between and including O9020 and O9029, then register the numeral 6 in the corresponding parameters 6080 to 6089. This would have the following program called as a Macro Program and not a Subprogram and therefore, allow arguments to be passed to it by the Macro Call block. By doing so, the actual tool change position in X and Y could be specified via the Tool Change Command Block. To use this system, parameter 6071 would have to be set to Zero (it would currently have "6" registered) so that there is no conflict with regards to which program number will be called by M06.
The Block shown in Red in the following program would be changed to the following:
G53 X#24 Y#25
To specify a Tool Change location by the Tool Change Call Block, the syntax would be as follows:
M6 X_ _ Y_ _
Where:
X_ _ = the desired X Tool Change position in Machine Coordinate values
Y_ _ = the desired Y Tool Change position in Machine Coordinate System values
If either argument is omitted in the Call Block, the respective axis Tool Change Position will be the Reference Return position (Machine Coordinate System Zero)
Regards,
Bill
%
O9001(DVF5000 A1 M06 W0 TM 20180419)
IF[#1007EQ1]GOTO600(MACRO M CODE MST SKIP)
#14=#4114(REC SEQ NO)
#15=#4001(REC G1 G0)
#16=#4003(REC G90 G91)
G31
IF[#1000EQ1]GOTO500(HEAD=T)
IF[#3010EQ-1]GOTO500
G05.1Q0
N10G80G40
N30G91G30Z0.M19M222M233
M39
N40G91G30X0.Y0. (Change to G53 X#24 Y#25)
N50M06
N60
M232M223
N500
N#14G#15G#16
G05.1Q1
N600
M99
%