(author: Chris P)
(version: 0.1)
(date: 05/30/20)

(m6 tool call with g43 offset applied)

o<m6_tool_call_main_panel> sub
; Lathe specific version

#<tool_number_entry_main_panel> = #1
#<x_tool_change_position> = #2
#<z_tool_change_position> = #3
#<use_tcp_mode> = #4

G49

(probe mode rules for WCO, Rotation and probe position measuring only)
o100 if [#<use_tcp_mode> EQ 1]
    (move to stored tool change position for m6 call)
    G90
    G53 G0 Z#<z_tool_change_position>
    G53 G0 X#<x_tool_change_position>
    o<m6_tool_call_main_panel> return
o100 endif

T#<tool_number_entry_main_panel> M6 G43

o<m6_tool_call_main_panel> endsub

M2 (end program)
