I'm having one heck of a time trying to get the screen to change automatically to the login screen when someone logs out. I essentially want the HMI to be locked out unless someone is logged in. I'm also using the auto login/logout with the USB key functionality. I've tried using a macro but it never changes the screen.
Below is the main macro I've been trying to use. I've got it set to run once a second, and then I also have a PLC control word, LW-100, set to be a "Change Window" attribute, which is where I write the login window value to.
Any help would be greatly appreciated, I've been stuck on this for like 3 days
Below is the main macro I've been trying to use. I've got it set to run once a second, and then I also have a PLC control word, LW-100, set to be a "Change Window" attribute, which is where I write the login window value to.
Code:
macro_command main()
short logged_in // where the current security class is stored, anything other than 0 is logged in
short login_window = 70 // value of login screen
GetData(logged_in, "Local HMI", LW, 9222, 1) // Read from LW-9222, where current class is stored
if logged_in == 0 then
SetData(login_window, "Local HMI", LW, 100, 1) // if LW-9222 is 0, change screen to login screen
else
end if
end macro_command
Any help would be greatly appreciated, I've been stuck on this for like 3 days