How can the maximum and minimum X,Y and Z moves be reported when generating an NC-code program from a Post Builder post?
Solution
1. In Post Builder go to 'Program & Tool Path -> Custom Command -> Import -> pb_cmd_check_travel_limits.tcl -> Open -> OK' to import the command.
2. Create a proceedure named PB_CMD_before_motion and add the PB_CMD_check_travel_limits command.
3. Add a Custom Command to the End of Program event.
4. Add the following TCL code to the Custom Command.
global mom_sys_max_travel
global mom_sys_min_travel
global mom_sys_control_out
global mom_sys_control_in
set co $mom_sys_control_out
set ci $mom_sys_control_in
MOM_output_literal "$co\MAX X [format "%-6.4f" $mom_sys_max_travel(0)]$ci"
MOM_output_literal "$co\MAX Y [format "%-6.4f" $mom_sys_max_travel(1)]$ci"
MOM_output_literal "$co\MAX Z [format "%-6.4f" $mom_sys_max_travel(2)]$ci"
MOM_output_literal "$co\MIN X [format "%-6.4f" $mom_sys_min_travel(0)]$ci"
MOM_output_literal "$co\MIN Y [format "%-6.4f" $mom_sys_min_travel(1)]$ci"
MOM_output_literal "$co\MIN Z [format "%-6.4f" $mom_sys_min_travel(2)]$ci"
5. The maximum and minimum values will be output at the end of the program when posted.
% (MAX X 401.5000) (MAX Y 304.5000) (MAX Z 125.0000) (MIN X -28.3738) (MIN Y -4.0476) (MIN Z 26.0000)Notes