OK了 代码如下
macro_command main()
bool test1 , test2
bool t = true , f = false
GetData(test1, "Local HMI", LB, 500, 1)
GetData(test2, "Local HMI", LB, 501, 1)
if (test1 == t and test2 == f) then
SetData(t, "Local HMI", LB, 502, 1)
else
SetData(f, "Local HMI", LB, 502, 1)
end if
end macro_command |