1. program&tool path >>custom command >>IN "B_CMD_BEFORE_MOTION" ,paste these into it: (Postbuilder中已有此指令,不过内容是空的。)
global mom_pos machine_limits
if { ![info exists machine_limits] } {
for {set i 0} {$i<3} {incr i} {
set machine_limits($i,0) $mom_pos($i)
set machine_limits($i,1) $mom_pos($i)
}
}
for {set i 0} {$i<3} {incr i} {
if { $mom_pos($i) < $machine_limits($i,0)} {
set machine_limits($i,0) $mom_pos($i)
}
if { $mom_pos($i) > $machine_limits($i,1)} {
set machine_limits($i,1) $mom_pos($i)
}
}
2.program&tool path >>programm >>programm end enquence >>add block "CUSTOM COMMAND" before %.
global machine_limits
MOM_output_literal "(X : [ format "%.2f" $machine_limits(0,0)] [ format "%.2f" $machine_limits(0,1)] )"
MOM_output_literal "(Y : [ format "%.2f" $machine_limits(1,0)] [ format "%.2f" $machine_limits(1,1)] )"
MOM_output_literal "(Zmin: [ format "%.2f" $machine_limits(2,0)] )"
结果:
G91 G28 Z0.0
G90
M30
%
(Machine time = 17.0 min)
(Tool= D20 )
(X : -64.72 89.59 )
(Y : -61.54 31.65 )
(Zmin: -47.90 ) |