楼主最近还看过
宏指令 刚刚做了一个 我直接贴代码 两个屏IP 最后一位 一个是7 一个是8
macro_command main()
short HMI_IP
bool A,B,C,D=1,E=0
GetData(HMI_IP, "Local HMI", LW, 9132, 1) //获取触摸屏IP
GetData(A, "Mitsubishi iQ-R Series (Ethernet)", M, 4561, 1) //切换单双屏 A==0使用双屏 A==1使用单屏
GetData(C, "Mitsubishi iQ-R Series (Ethernet)", M, 4563, 1) // 弹窗触发
if A == 1 then
SetData(E, "Local HMI", LB, 10000, 1)
end if //双屏模式
if A == 0 and HMI_IP == 7 and C == 0 then //屏1
SetData(D, "Local HMI", LB, 10000, 1)
end if
if A == 0 and HMI_IP == 7 and C == 1 then
SetData(E, "Local HMI", LB, 10000, 1)
end if
if A == 0 and HMI_IP == 8 and C == 1 then //屏2
SetData(D, "Local HMI", LB, 10000, 1)
end if
if A == 0 and HMI_IP == 8 and C == 0 then
SetData(E, "Local HMI", LB, 10000, 1)
end if
end macro_command
宏指令 刚刚做了一个 我直接贴代码 两个屏IP 最后一位 一个是7 一个是8
macro_command main()
short HMI_IP
bool A,B,C,D=1,E=0
GetData(HMI_IP, "Local HMI", LW, 9132, 1) //获取触摸屏IP
GetData(A, "Mitsubishi iQ-R Series (Ethernet)", M, 4561, 1) //切换单双屏 A==0使用双屏 A==1使用单屏
GetData(C, "Mitsubishi iQ-R Series (Ethernet)", M, 4563, 1) // 弹窗触发
if A == 1 then
SetData(E, "Local HMI", LB, 10000, 1)
end if //双屏模式
if A == 0 and HMI_IP == 7 and C == 0 then //屏1
SetData(D, "Local HMI", LB, 10000, 1)
end if
if A == 0 and HMI_IP == 7 and C == 1 then
SetData(E, "Local HMI", LB, 10000, 1)
end if
if A == 0 and HMI_IP == 8 and C == 1 then //屏2
SetData(D, "Local HMI", LB, 10000, 1)
end if
if A == 0 and HMI_IP == 8 and C == 0 then
SetData(E, "Local HMI", LB, 10000, 1)
end if
end macro_command