iCAx开思网

标题: 后置处理程式中三轴极限值的呼叫 [打印本页]

作者: caifu    时间: 2005-2-18 11:16
标题: 后置处理程式中三轴极限值的呼叫
#_______________________________________________________________________________
# 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轴

作者: caifu    时间: 2005-2-18 11:17
希望大家顶起来,让需要的人都看到.
  
注意下划线位置
作者: caifu    时间: 2005-2-18 11:22
产生如下所示的结果
(MAXZ = 10. , MINZ = 0.2)
(MAXX = 71.812 , MINX = -54.476)
(MAXY = 45.852 , MINY = -49.132)
(TIME: 0.4 MIN)
  
但是此语句只能呼叫程式中的最大值,如果用圆弧逼近时不能准确定义其值,走全圆时,不能捕捉其象限点值
作者: caifu    时间: 2005-2-18 11:26
加工时间的呼叫
global mom_machine_time
MOM_output_literal "(TIME: [format "%0.1f" $mom_machine_time] MIN)"
作者: caifu    时间: 2005-2-18 11:26
刀具信息的呼叫
  
global   mom_tool_number
        global   mom_tool_diameter
        global   mom_tool_corner1_radius
        global mom_tool_name
        global mom_tool_diameter mom_tool_corner1_radius mom_tool_flute_length mom_tool_length
  
       MOM_output_literal ";(ToolName=$mom_tool_name\
      D=[format "%.2f" $mom_tool_diameter]\
      R=[format "%.2f" $mom_tool_corner1_radius]\
      F=[format "%.2f" $mom_tool_flute_length]\
      L=[format "%.2f" $mom_tool_length])"
作者: caifu    时间: 2005-2-18 11:52
加工余量的呼叫
  
global mom_stock_part mom_stock_floor  
   MOM_output_literal "(Part stock=[format "%.3f" $mom_stock_part] MM \ Floor stock=[format "%.3f" $mom_stock_floor ] MM)"
作者: caifu    时间: 2005-2-18 11:54
ugnx3.0后处理不能处理螺旋进刀https://www.icax.org/viewthread. ... %3D1&page=#pid=
作者: caifu    时间: 2005-2-18 11:55
各位pb高手帮忙一下,在开起turbo模式后无法输出G18,G19,怎么办?https://www.icax.org/viewthread. ... %3D1&page=#pid=
作者: caifu    时间: 2005-2-18 11:57
加工时间的问题
$mom_machine_time 包含快速移动时间
$mom_cutting_time 只含实际切削的时间
作者: zhoulin96100193    时间: 2005-2-18 12:38
顶一下,学到了不少
作者: cjtking    时间: 2005-2-18 13:01
楼主是好人,强力置顶!强烈要求加分!
作者: zhoulin96100193    时间: 2005-2-18 13:43
有一个地方有一点错误$xmay 应该为$ymax (输出y的最大值的地方)
作者: caifu    时间: 2005-2-18 16:36
zhoulin96100193 wrote:
有一个地方有一点错误$xmay 应该为$ymax (输出y的最大值的地方)

  
谢谢!可能因为在输入的时候搞错了
作者: hcqin888    时间: 2005-2-19 15:26
请问三轴极限用postbuilder怎么加?以上是否是修改tcl文件?谢谢!
作者: 桥少    时间: 2005-2-19 17:58
hcqin888 wrote:
请问三轴极限用postbuilder怎么加?以上是否是修改tcl文件?谢谢!

  
想知道,顶!!!
作者: caifu    时间: 2005-2-20 11:08
hcqin888 wrote:
请问三轴极限用postbuilder怎么加?以上是否是修改tcl文件?谢谢!

  
是修改tcl文件
作者: hcqin888    时间: 2005-2-20 16:53
caifu兄能否放一个tcl文件,小弟参考一下?谢谢
作者: waing3532    时间: 2005-2-22 14:51
好帖,顶起来.
作者: 机器人熊猫    时间: 2005-2-22 21:09

请教楼上各位高手,下载的后处理复制到UG那里?怎样运行他?
我用POST出NC。
菜鸟诚心请教,万分感激!!!!!!!!

作者: thfthf    时间: 2005-2-23 11:46
我的五轴后处理,无法角度抬刀,总是Z轴优先,请问各位高手,于何设置。
作者: cqwcd    时间: 2006-4-11 16:00
你的tcl语法好像漏洞百出啊,楼主,改的我好苦啊!!!!!!!!!!!!!

[ 本帖最后由 cqwcd 于 2006-4-11 16:05 编辑 ]
作者: jackyyibin    时间: 2007-1-4 16:49
global max_z min_z zmax zmin
global max_x min_x xmax xmin
global max_y min_y ymax ymin
global max_b min_b

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]
set bmax [string trimright [format %.3f $max_b] 0]
set bmin [string trimright [format %.3f $min_b] 0]
  
MOM_output_literal ";(Zmax = $zmax , Zmin = $zmin)"   
MOM_output_literal ";(Xmax= $xmax , Xmin = $xmin)"   
MOM_output_literal ";(Ymax = $ymax , Ymin = $ymin)"
MOM_output_literal ";(Bmax = [format "%.3f" $bmax] , Bmin = [format "%.3f" $bmin])"

请各位看看
以上程序错误在哪里?
谢谢!!!
作者: moldboy    时间: 2007-1-6 10:50
dddddddddddddddddddddd
作者: wupengcheng    时间: 2007-1-6 13:28
顶起来.
作者: engineerkey    时间: 2007-1-6 13:49
好东西!




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3