请大家看下,在宏指令中,用到三菱PLC的M20,能驱动
macro_command main()
bool a,b,c
GetData(a, "plc", M, 0, 1)
if a==1 then
b=1
SetData(b, "Local HMI", RW_Bit, 0, 1)
end if
//
GetData(b, "Local HMI", RW_Bit, 0, 1)
if b==1 then
C=1
SetData(C, "plc", M, 20, 1)
end if
end macro_command
但如果将M20换成三菱中的M8034(屏中用SM8034),就不能执行
macro_command main()
bool a,b,c
GetData(a, "plc", M, 0, 1)
if a==1 then
b=1
SetData(b, "Local HMI", RW_Bit, 0, 1)
end if
//
GetData(b, "Local HMI", RW_Bit, 0, 1)
if b==1 then
C=1
SetData(C, "plc", SM, 8034, 1)
end if
end macro_command
请大家帮我改进一下,谢谢 |