|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
#_______________________________________________________________________________
# Kinematic Declarations在此段中填加如下的设置,,设置XYZ的最大,最小极限值
#_______________________________________________________________________________
set max_z -9999.9
set min_z 9999.9
set max_x -9999.9
set min_x 9999.9
set max_y -9999.9
set min_y 9999.9
proc MOM_end_of_program {} {在此段中呼叫极限值
#_______________________________________________________________________________
# This procedure is executed at the end of the program after all
# the paths are traversed.
#_______________________________________________________________________________
global mom_machine_time
global mom_part_name
global mom_output_file_basename
global max_z min_z
global max_x min_x
global max_y min_y
# MOM_spindle_off
# MOM_coolant_off
# MOM_do_template end_of_program
MOM_output_literal "M30"
MOM_output_literal "END PGM $mom_output_file_basename MM"
MOM_set_seq_off
set zmax [string trimright [format %.4f $max_z] 0]
set zmin [string trimright [format %.4f $min_z] 0]
set xmax [string trimright [format %.4f $max_x] 0]
set xmin [string trimright [format %.4f $min_x] 0]
set ymax [string trimright [format %.4f $max_y] 0]
set ymin [string trimright [format %.4f $min_y] 0]
MOM_output_literal "(MAXZ = $zmax , MINZ = $zmin)"
MOM_output_literal "(MAXX = $xmax , MINX = $xmin)"
MOM_output_literal "(MAXY = $xmay , MINY = $ymin)"
proc MOM_before_motion {} {在此定义极限值
global mom_pos
global max_z min_z
set pb_start_of_program_flag 0
if { $mom_pos(2) < $min_z } { set min_z $mom_pos(2) }
if { $mom_pos(2) > $max_z } { set max_z $mom_pos(2) }
global mom_pos
global max_x min_x
set pb_start_of_program_flag 0
if { $mom_pos(0) < $min_x } { set min_x $mom_pos(0) }
if { $mom_pos(0) > $max_x } { set max_x $mom_pos(0) }
global mom_pos
global max_y min_y
set pb_start_of_program_flag 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) }
注:$mom_pos(0) 为X轴
$mom_pos(1)为Y轴
$mom_pos(2)为Z轴 |
|