|
普通机后处理改为进玉自动出程序单后处理视频
tcl文件如下修改
一、加output_desr
#=============================================================
proc MOM_end_of_program { } {
#=============================================================
MOM_force Once M_coolant
MOM_do_template coolant_off
MOM_force Once M_spindle
MOM_do_template spindle_off
PB_CMD_program_end1
MOM_do_template end_of_program
MOM_set_seq_off
MOM_do_template rewind_stop_code
PB_CMD_program_end2
output_desr
#**** The following procedure lists the tool list with time in commentary data
LIST_FILE_TRAILER
#**** The following procedure closes the warning and listing files
CLOSE_files
}
二、加prog_head
#=============================================================
proc PB_start_of_program { } {
#=============================================================
if [llength [info commands PB_CMD_kin_start_of_program] ] {
PB_CMD_kin_start_of_program
}
prog_head
PB_CMD_init_turbo
MOM_set_seq_off
PB_CMD_program_start
PB_CMD_init_helix
PB_CMD_fix_RAPID_SET
}
三、加spindle_check,set_value_ju
#=============================================================
proc MOM_start_of_path { } {
#=============================================================
global mom_sys_in_operation
set mom_sys_in_operation 1
global first_linear_move ; set first_linear_move 0
TOOL_SET MOM_start_of_path
if [llength [info commands PB_CMD_kin_start_of_path] ] {
PB_CMD_kin_start_of_path
}
PB_CMD_start_of_operation_force_addresses
PB_CMD_path_start
spindle_check
set_value_ju
}
四、加cut_depth_circular
#=============================================================
proc MOM_linear_move { } {
#=============================================================
global feed_mode mom_feed_rate mom_kin_rapid_feed_rate
if { ![string compare $feed_mode "IPM"] || ![string compare $feed_mode "MMPM"] } {
if { [EQ_is_ge $mom_feed_rate $mom_kin_rapid_feed_rate] } {
MOM_rapid_move
return
}
}
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
五、加cut_depth_line
global first_linear_move
if { !$first_linear_move } {
PB_first_linear_move
incr first_linear_move
}
MOM_do_template linear_move
cut_depth_line}
六、加在最后面
#=============================================================
proc MOM_end_of_group { } {
prog_end
}
#=============================================================
##################################################################################
#=================================================================
proc prog_head { } {
#=================================================================
global mom_group_name mom_date mom_tool_name
global prev_spind
global tool_name cut_descr cut_stock cut_depth
set tool_name ""
set cut_descr ""
set cut_stock 1
set cut_depth 0
set prev_spind 0
# MOM_output_literal "%"
# MOM_output_literal "( ttp )"
# MOM_output_literal "(PROGRAM NAME: $mom_group_name)"
# MOM_output_literal "(Time: $mom_date)"
# MOM_output_literal "(Cutter Name: $mom_tool_name)"
# MOM_output_literal "T1D1"
# MOM_output_literal "HSCB(0.01)"
# MOM_output_literal "G90G54G00X0.Y0."
}
#=================================================================
proc prog_end { } {
#=================================================================
# MOM_output_literal "G91 Z150."
# MOM_output_literal "M05"
# MOM_output_literal "M09"
# MOM_output_literal "M30"
# MOM_output_literal "%"
}
#=================================================================
proc spindle_check { } {
#=================================================================
global mom_spindle_speed prev_spind
if { $mom_spindle_speed < 1 } {
if { $prev_spind == 0 } {
set mom_spindle_speed 1500
} else {
set mom_spindle_speed $prev_spind
}
}
set prev_spind $mom_spindle_speed
}
#====================================================================
proc set_value_ju { } {
#====================================================================
global tool_name cut_descr cut_stock
global mom_tool_name mom_stock_part
if { $tool_name == "" } {
set tool_name $mom_tool_name
} else {
if { $tool_name != $mom_tool_name } {
set tool_name "操作中刀径不同"
}
}
if { $cut_stock == 1 } {
set cut_stock $mom_stock_part
} else {
if { $cut_stock > $mom_stock_part } {
set cut_stock $mom_stock_part
}
}
if { $cut_stock < 0 } {
set cut_descr "光"
} elseif { $cut_stock >= 0 && $cut_stock <= 0.1 } {
set cut_descr "中"
} else {
set cut_descr "粗"
}
}
#======================================================================
proc cut_depth_line { } {
#======================================================================
global cut_depth
global mom_pos
if { $cut_depth > $mom_pos(2) } {
set cut_depth $mom_pos(2)
}
}
#======================================================================
proc cut_depth_circular { } {
#======================================================================
global cut_depth
global mom_pos
if { $cut_depth > $mom_pos(2) } {
set cut_depth $mom_pos(2)
}
}
#======================================================================
proc output_desr { } {
#======================================================================
global tool_name cut_descr cut_stock cut_depth
global mom_group_name mom_machine_time
global mom_output_file_basename mom_output_file_directory mom_sys_output_file_suffix
set desr_file_name "${mom_output_file_directory}${mom_output_file_basename}.${mom_sys_output_file_suffix}"
MOM_close_output_file $desr_file_name
set desr_file_name "D:\\ju_conf\\temp\\$mom_group_name.xl"
MOM_remove_file $desr_file_name
MOM_open_output_file $desr_file_name
MOM_output_literal "$mom_group_name $tool_name $cut_descr [format %3.2f $cut_stock] [format %4.1f $cut_depth] [format %4.0f $mom_machine_time]"
MOM_close_output_file $desr_file_name
} |
|