Adapt the FB_UserMgmtEventHandler function block as follows:
|
Adapt the HandleLogin method as follows:
|
|
Proceed in the same way with the HandleLogout method.
Adapt the POU PLC_PRG as follows:
|
Assign the EventHandler to the visualization as follows.
In old versions, the following approach is not possible, because the assignment of a program from the visualization manager was not possible. |
Create a new POU of type "Program". Name it VisuInit, for example, and adapt the program code as follows:
|
|
Assign the VisuInit program to your project as the start procedure within the Visualization Manager:
Repeat the steps as for a button for logging out.
Load the project to the controller and start it.
The variables are increased at each successful "Login" and "Logout".