楼主最近还看过
不同用户不同密码登入不同页面的实例(宏指令)
macro_command main()
bool status,OFF=false,ON=true //
short page,b,f
int a ,c,d,e
GetData(a, "Local HMI", Lw, 9220, 1) //密码
GetData(b, "Local HMI", Lw, 9219, 1) //用户编号
GetData(c, "Local HMI", Lw, 9500, 1) //用户1密码
GetData(d, "Local HMI", Lw, 9502, 1) //用户2密码
GetData(e, "Local HMI", Lw, 9504, 1) //用户3密码
GetData(f, "Local HMI", Lw, 9506, 1) //用户4密码
GetData(status, "Local HMI", LB, 9060, 1) //HIM内存里存在的事件记录文件数目
if status==true then
SetData(ON, "Local HMI", LB, 1, 1)
page=0
end if
if status==false and a==c and b==1 then
page=23
end if
if status==false and a==d and b==2 then
page=21
end if
if status==false and a==e and b==3 then
page=22
end if
if status==false and a==f and b==4 then
page=20
end if
SetData(page, "Local HMI", LW, 0, 1)
SetData(OFF, "Local HMI", LB, 0, 1)
SetData(OFF, "Local HMI", LB, 9060 , 1)
end macro_command