唉,这个宏论坛太冷清了.幸好,我今天晚上又重新看了一下宏指令说明书,把问题找到了,成功了,真高兴.经过修改以下才是正确的宏程序:
macro_commmand main()
short a[5],b[5],c[5],d,e,f,g
getdata(a[0],''Local HMI'',RW,1,5)
getdata(b[0],''Local HMI'',RW,11,5)
getdata(c[0],''Local HMI'',RW,21,5)
getdata(d,''Local HMI'',RW,0,1)
getdata(e,''Local HMI'',RW,10,1)
getdata(f,''Local HMI'',RW,20,1)
getdata(g,''Local HMI'',RW,1000,1)
if g==d then
setdata(a[0],''Local HMI'',RW101,5)
else if g==e then
setdata(b[0],''Local HMI'',RW101,5)
else
g==f
setdata(c[0],''Local HMI'',RW101,5)
end if
end macro_commmand |