macro_command main()
short a[4]
GetData(a[0], "Local HMI", LB, 40, 1)
if (a[0]==1) then
a[1]=12
end if
SetData(a[1], "Local HMI", LW, 40, 1)
GetData(a[2], "Local HMI", LW, 41, 1)
if (a[2]==2) then
a[3]=1
end if
SetData(a[3], "Local HMI", LB, 41, 1)
end macro_command
我的意思是:当LB40为1时,将数值12写入LW40里面,当LW41的数值等于2时,LB41等于1.这样编写对吗? |