回复:808D 自定义画面脚本中如何简单读写G54零点偏移量值?

坏坏龙

  • 帖子

    3
  • 精华

    1
  • 被关注

    0

论坛等级:游民

注册时间:2012-12-24

普通 普通 如何晋级?

发布于 2018-07-22 09:30:38

4楼

 


<let name="ax_name"type="string"/>
<let name="num_mach_axis"/>
<let name="axis_index_in_channel" />
<let name="frame_type"/>
<let name="zero_offset"/>

<form name="Main">

 <caption>User Mask</caption>

  <init>
 
 <op>axis_index_in_channel = 0</op>
 
  <!--frame_type
    0 = G500
    1 = G54
    2 = G55
    3 = G56
    4 = G57
    5 = G505
    6 = G506
    ...
    nn = G5nn
    ...
    99 = G599
 -->
 <op>frame_type = 2</op>
 
 <!-- reading total number of axes -->
    <op>num_mach_axis = "nck/Channel/Configuration/numMachAxes"</op>
 
    <op>zero_offset = frame_type * num_mach_axis + axis_index_in_channel</op>
 
    <op>ax_name = "nck/Channel/GeometricAxis/name[$axis_index_in_channel]" </op>
 <control name="InputField1" xpos="90" ypos="57" height="16" width="80" hotlink="true" format="%8.3f" font="1" type = "double"/>
 
 </init>
 
  <paint>
  <text xpos = "90" ypos = "40">$$$ax_name</text>
  </paint>
 
  <timer >
  <op>InputField1 = "nck/Channel/UserFrame/linShift[U1,$zero_offset]" </op>
    <update_controls type="true" />
  </timer>
 
  <focus_in />
 
  <edit_changed >
  <op>"nck/Channel/UserFrame/linShift[U1,$zero_offset]" = InputField1</op>
 <function name="ncfunc.pi_service" return="error"> _T"_N_SETUFR" </function>
    <if>
      <condition>error == 0</condition>
      <then>
        <MsgBox text="Offset value could not be written!" caption="confirm error" retvalue="error" type="BTN_OK" />
      </then>
    </if>

   
    <function name="ncfunc.pi_service" return="error"> _T"_N_SETUDT", _T"003", _T"00000", _T"00000"</function>
    <if>
      <condition>error == 0</condition>
      <then>
        <MsgBox text="Offset value could not be activated!" caption="confirm error" retvalue="error" type="BTN_OK" />
      </then>
    </if>
  </edit_changed >
 
  <index_changed />
  <close />
  <key_evennt />
  <message />
</form>

400回复的一份自定义画面读写G54坐标偏置的脚本!可以直接在自定义画面中,直接读写零偏。

谢谢各位大神的回复!!!

评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SINUMERIK

共有25768条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
X 图片
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。