How Can We Help?

Print

Automatic logout of the user when the screen saver is turned on

 

In this post, we will show you how to add a simple automatic logout of the current user when the screensaver starts.
This way, as soon as the screen saver starts, the user level rights are reset to 0.

For that, we use the local bit LB60142 (Screen saver is ON) and LB60133 (Reset current user level)
See Useful Reserved Registers of HMI

With HMI-Tool

Add the users

In the Macro Editor, add a new macro and compile it.

#include "MacroInit.h"
void Macro_main(IN *p)
{
MarcoInit
//ToDo
if (LocalBit[60142]) // Screen saver is ON
{
LocalBit[60133]=1; // Reset current user level
}
}

Add the macro to the “Global Macro” list.

And set its execution frequency to 1000 ms as example

How does it work? Try it out!

You can download the example: Reset_User_Level