macro_command main()
short a[3],b[3],p=1
int k,l,password,m,n,z,w
bool key=true,key2=false
GetData(password, "本机 触摸屏", LW, 300, 1) //密码输入
GetData(z, "本机 触摸屏", RW, 1000, 1) // 设定密码
GetData(a[0], "本机 触摸屏", RW, 8, 3) // 设定时间
GetData(b[0], "本机 触摸屏", LW, 9020, 3) // 现在时间
if a[2]>b[2] then
SetData(key, "PLC", M, 8034, 1)
else if a[2]==b[2] and a[1]>b[1] then
SetData(key, "PLC", M, 8034, 1)
else if a[2]==b[2] and a[1]==b[1] and a[0]>b[0]then
SetData(key, "PLC", M, 8034, 1)
end if
if password==z then
SetData(key2, "PLC", M, 8034, 1)
end if
end macro_command |