macro_command main()
short mingchen_rw81,pingzhong_lw80,cuxi_rw80
short dingsuA_d128,dingsuB_d129,niandu_d131,qianshenbi_d133,jiaodubianhuatidu_d132,zhouqi1_d164
short zhouqi2_d165,zhixingcishu1_d184,zhixingcishu2_d185,longdaiAxiuzheng_d166,longdaiBxiuzheng_d167
short chaoweixiuzheng_d168,juanraoxiuzheng_d169,a,c,d
float diyijiaodu_rw0,dierjiaodu_rw2
bool nianxiang_m385
GetData(a,"Local HMI",lw,9201,1)//取工艺号
GetData(pingzhong_lw80,"Local HMI",rw,82,1)//取品种
c=a+440
SetData(pingzhong_lw80,"Local HMI",rw,c,1)
GetData(dingsuA_d128,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,128,1)//取定速A
c=a+100
SetData(dingsuA_d128,"Local HMI",rw,c,1)
GetData(dingsuB_d129,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,129,1)//取定速B
c=a+120
SetData(dingsuB_d129,"Local HMI",rw,c,1)
GetData(niandu_d131,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,131,1)//取捻度
c=a+140
SetData(niandu_d131,"Local HMI",rw,c,1)
GetData(diyijiaodu_rw0,"Local HMI",rw,0,1)//取第一角度
c=2*a+460
d=2*a
SetData(diyijiaodu_rw0,"Local HMI",rw,c,1)
GetData(qianshenbi_d133,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,133,1)//去牵伸比
c=a+180
SetData(qianshenbi_d133,"Local HMI",rw,c,1)
GetData(nianxiang_m385,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,200,1)//取捻向
c=a+160
SetData(nianxiang_m385,"Local HMI",RW,c,1)
GetData(longdaiAxiuzheng_d166,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,166,1)//取龙带A修正
c=a+200
SetData(longdaiAxiuzheng_d166,"Local HMI",rw,c,1)
GetData(longdaiBxiuzheng_d167,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,167,1)//龙带B修正
c=a+220
SetData(longdaiBxiuzheng_d167,"Local HMI",rw,c,1)
GetData(chaoweixiuzheng_d168,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,168,1)//取超喂修正
c=a+240
SetData(chaoweixiuzheng_d168,"Local HMI",rw,c,1)
GetData(juanraoxiuzheng_d169,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,169,1)//取卷绕修正
c=a+260
SetData(juanraoxiuzheng_d169,"Local HMI",rw,c,1)
GetData(dierjiaodu_rw2,"Local HMI",rw,2,1)//取第二角度
c=2*a+500
SetData(dierjiaodu_rw2,"Local HMI",rw,c,1)
GetData(jiaodubianhuatidu_d132,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,132,1)//取角度变化梯度
c=a+300
SetData(jiaodubianhuatidu_d132,"Local HMI",rw,c,1)
GetData(zhouqi1_d164,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,164,1)//取周期1
c=a+320
SetData(zhouqi1_d164,"Local HMI",rw,c,1)
GetData(zhouqi2_d165,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,165,1)//取周期2
c=a+340
SetData(zhouqi2_d165,"Local HMI",rw,c,1)
GetData(zhixingcishu1_d184,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,184,1)//去执行次数1
c=a+360
SetData(zhixingcishu1_d184,"Local HMI",rw,c,1)
GetData(zhixingcishu2_d185,"Mitsubishi FX0s/FX0n/FX1s/FX1n/FX2",d,185,1)//去执行次数2
c=a+380
SetData(zhixingcishu2_d185,"Local HMI",rw,c,1)
GetData(cuxi_rw80,"Local HMI",rw,80,1)//去丝线粗细
c=a+400
SetData(cuxi_rw80,"Local HMI",rw,c,1)
GetData(mingchen_rw81,"Local HMI",rw,81,1)//去工艺名称
c=a+420
SetData(mingchen_rw81,"Local HMI",rw,c,1)
end macro_command
用类似的宏指令即可