本帖最后由 eica_chen 于 2013-4-3 16:05 编辑
根据LW9222的第0位 1位 2位 。。。6位的值来判断LW500 中的字符串显示
比如
如果LW_BIT 922200=1,则LW500字符串显示“aaa”或者“文字1”
如果LW_BIT 922201=1,则LW500字符串显示“bbb”或者“文字2”
不知道字符串怎么赋值啊 请指教啊。
如果有示例程序 麻烦发一个给我研究下 多谢
如下指令有什么问题啊
每次只能给U赋值0、、、
macro_command main()
bool on = true
bool off = false
bool A
bool B
bool C
bool D
bool E
bool F
short U
GetData(A, "Local HMI", LW_BIT, 922200, 1)
GetData(B, "Local HMI", LW_BIT, 922201, 1)
GetData(C, "Local HMI", LW_BIT, 922202, 1)
GetData(D, "Local HMI", LW_BIT, 922203, 1)
GetData(E, "Local HMI", LW_BIT, 922204, 1)
if A == 0 and B == 0 and C == 0 and D == 0 and E == 0 and F == 0 then
U = 0
else if A == 1 and B == 0 and C == 0 and D == 0 and E == 0 and F == 0 then
U = 1
else if A == 1 and B == 1 and C == 0 and D == 0 and E == 0 and F == 0 then
U = 2
else if A == 1 and B == 1 and C == 1 and D == 0 and E == 0 and F == 0 then
U = 3
else if A == 1 and B == 1 and C == 1 and D == 1 then
U = 4
end if
SetData(U, "Local HMI", LW, 12, 1)
SetData(on, "Local HMI", LB, 120, 1)
end macro_command |