找回密码
 立即注册

QQ登录

只需一步,快速开始

微信扫码登录

搜索
查看: 1774|回复: 2

[求助] UG编程后NC程序中自动生成调取附件头指令

[复制链接]

4

主题

31

回帖

993

积分

五级士官

积分
993
发表于 2020-7-22 14:52:34 | 显示全部楼层 |阅读模式
可有大师知道如何利用UG编程后NC程序中自动生成调取附件头指令?就像如图中所示的NC代码。其中M106是标准直头,M101是附件头(角度头:可以360度自动旋转的)。

微信截图_20200722145053.png
微信截图_20200722145130.png

7

主题

67

回帖

988

积分

五级士官

积分
988
发表于 2020-7-23 00:00:34 | 显示全部楼层
应该可以,加个 operator message M101 或M106
开始操作里加个custom comand  读取operator message 写入M101
#operator_message中输入M101 M106


# Default handler for UDE MOM_operator_message
# - Do not attach it to any event!
#
# This procedure is executed when the Operator Message command is activated.
#
   global mom_operator_message mom_operator_message_defined
   global mom_operator_message_status
   global ptp_file_name group_output_file mom_group_name
   global mom_sys_commentary_output
   global mom_sys_control_in
   global mom_sys_control_out
   global mom_sys_ptp_output
    global mom_tool_number
     global t_string
   if { [info exists mom_operator_message_defined] } {
      if { $mom_operator_message_defined == 0 } {
return
      }
   }

   if { [string compare "ON" $mom_operator_message] && [string compare "OFF" $mom_operator_message] } {
        if {[string first "M101" $mom_operator_message]==0} {
            

            MOM_output_literal "M101"
            return
            }
        }
大概就是这样
看大神怎么做

4

主题

31

回帖

993

积分

五级士官

积分
993
 楼主| 发表于 2020-7-27 16:13:39 | 显示全部楼层
jisx0404 发表于 2020-7-23 00:00
应该可以,加个 operator message M101 或M106
开始操作里加个custom comand  读取operator message 写入 ...

试了一下你这个行不通吧

4

主题

31

回帖

993

积分

五级士官

积分
993
 楼主| 发表于 2020-7-29 14:29:31 | 显示全部楼层
C:\Users\Administrator\Desktop

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

咨询QQ:1359218528|发帖须知!|Archiver|手机版|小黑屋|UG爱好者论坛 ( 京ICP备10217105号-2 )

GMT+8, 2025-5-18 18:35

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表