|
global pop_cycle_hole_counter
incr pop_cycle_hole_counter
global mom_spindle_direction pop_cycle_hole_counter
global mom_current_motion final_tap_mode
global mom_cycle_thread_right_handed
global mom_sys_spindle_direction_code
global mom_cycle_cam mom_motion_event
global mom_tool_pitch fm ff afterG95
global mom_spindle_speed
if {$mom_motion_event == "tap_float_move"} {
if { $mom_spindle_direction == "CLW" } {
set final_tap_mode "84"
} elseif { $mom_spindle_direction == "CCLW" } {
set final_tap_mode "74"
} elseif {[info exists mom_cycle_thread_right_handed]} {
if { $mom_cycle_thread_right_handed == "TRUE" } {
set final_tap_mode "84"
} else {
set final_tap_mode "74"
}
}
} else {
if { $mom_spindle_direction == "CLW" } {
set final_tap_mode "84"
#set final_tap_mode "84.2"
} elseif { $mom_spindle_direction == "CCLW" } {
set final_tap_mode "74"
#set final_tap_mode "84.3"
} elseif {[info exists mom_cycle_thread_right_handed]} {
if { $mom_cycle_thread_right_handed == "TRUE" } {
set final_tap_mode "84"
#set final_tap_mode "84.2"
} else {
set final_tap_mode "74"
#set final_tap_mode "84.3"
}
}
}
if {$fm == "SYNTEC"} {
set ff [string trimright [format "%.1f" [expr $mom_tool_pitch*$mom_spindle_speed]] "0"]
} elseif {$fm == "FANUC"} {
set afterG95 1
set ff [string trimright [format "%.1f" [expr $mom_tool_pitch*$mom_spindle_speed]] "0"]
if {$mom_motion_event != "tap_float_move"} {
if { $pop_cycle_hole_counter == 1 } {
MOM_output_literal "M29 S[format "%.0f" $mom_spindle_speed]"
}
}
} elseif {$fm == "MITSUBISHI"} {
set ff [string trimright [format "%.3f" $mom_tool_pitch] "0"]
}
if {![info exists mom_cycle_cam]} {
set mom_cycle_cam ""
MOM_suppress once Q_tap
} elseif { $mom_cycle_cam == "0" } {
set mom_cycle_cam ""
MOM_suppress once Q_tap
}
|
|