|
|
定制命令名称 before_motion
global max_x
global min_x
global max_y
global min_y
global max_z
global min_z
global mom_pos
global mom_cycle_rapid_to_pos
global mom_cycle_feed_to_pos
global mom_cycle_retract_to_pos
global mom_motion_type
if { $mom_pos(0) < $min_x } { set min_x $mom_pos(0) }
if { $mom_pos(0) > $max_x } { set max_x $mom_pos(0) }
if { $mom_pos(1) < $min_y } { set min_y $mom_pos(1) }
if { $mom_pos(1) > $max_y } { set max_y $mom_pos(1) }
if { $mom_pos(2) < $min_z } { set min_z $mom_pos(2) }
if { $mom_pos(2) > $max_z } { set max_z $mom_pos(2) }
if { ![string compare "CYCLE" $mom_motion_type] } {
if {$mom_cycle_rapid_to_pos(2) < $min_z} {
set min_z $mom_cycle_rapid_to_pos(2)
}
if {$mom_cycle_rapid_to_pos(2) > $max_z} {
set max_z $mom_cycle_rapid_to_pos(2)
}
if {$mom_cycle_feed_to_pos(2) < $min_z} {
set min_z $mom_cycle_feed_to_pos(2)
}
if {$mom_cycle_feed_to_pos(2) > $max_z} {
set max_z $mom_cycle_feed_to_pos(2)
}
if {$mom_cycle_retract_to_pos(2) < $min_z} {
set min_z $mom_cycle_retract_to_pos(2)
}
if {$mom_cycle_retract_to_pos(2) > $max_z} {
set max_z $mom_cycle_retract_to_pos(2)
}
}
|
|