恭喜,你发布的帖子
发布于 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坐标偏置的脚本!可以直接在自定义画面中,直接读写零偏。
谢谢各位大神的回复!!!
请填写推广理由:
分享
只看
楼主