QUESTION: How can I automatically log in a default user after a reboot without using the Login Box? How can I ensure that a default user is always logged in during Runtime, even if another user has logged out beforehand?
ANSWER: After a reboot and during Runtime you want to achieve minimum availability of your HMI system without using the Login Box. Nevertheless, the Login function should be retained for higher-level operations. In addition, if no user is logged in, then a default user is to be logged in automatically. The rights of the default user are to be specified in the User Administrator to suit your requirements.
You can implement this function with the following C script. Proceed as follows for this:
1. Copy the attached function "Silentlogin.pas" into your project in the "PAS" subfolder.
2. In your project go to Global Script > C Editor > Actions > Global Actions and open the global action "Silentlogin.pas".
3. In the line "PWRTSilentLogin ("Login","Password");" replace the user "Login" with your default user and "Password" with the password of your default user.
4. Compile and save the C script.
5. Set a variable trigger to the variable @CurrentUser. Select "2 s", for example, for the cycle. This ensures that the system is not overloaded by the script. In the example described the variable @CurrentUser (contains the currently logged in user) is queried every 2 s for changes. The script is called only when the user changes, e.g. when the current user logs out.
6. Make sure that you have activated "Global Script Runtime" in the computer Properties, "Startup" tab.
The following additional steps are required for SIMATIC PCS 7 users (SIMATIC PCS 7 V6.0 SP1 and higher):
1. Copy the system picture @Welcome.pdl to a safe location to be able to restore the original picture.
2. Open the picture @Welcome.pdl with the Graphics Designer.
3. Open the C script stored in Select Picture (Right-click > Event > Picture Object > Miscellaneous > Open Picture).
4. Comment out the line "PASSLoginDialog(Screen);" with prefixed //.
5. Compile the C script.
6. Save the system picture @Welcome.pdl.
Warning: If you run the OS project editor again, make sure that the system picture @Welcome.pdl is not taken from the basic data. For this, in the tab "Basic Data > Basic pictures in project deviate from delivered state > accept delivered state" must not be marked for @Welcome.pdl.
If you are using SIMATIC LOGON version V1.2 or higher, then you do not need the "Silent Login" function, because beginning with this version SIMATIC LOGON includes its own convenient function for automatic login into WinCC Runtime. If you use the "Silent Login" function and wish to switch to SIMATIC LOGON, then undo the steps performed above.
Procedure in SIMATIC LOGON beginning with version V1.2:
· Open User Administration in WinCC Explorer and create a grouped named "DefaultGroup" in your project. Make the relevant settings for authorization levels in the group. The only "User" of this "Default User" group is created automatically and entered in the Registry. You must not assign any parameters for this user.
· In the SIMATIC LOGON configuration window, go to the "General" tab and select the function "Log on 'Default User' after user logoff", and close the dialog with "OK" (Fig. 1).

Fig. 1: Configuration dialog for SIMATIC LOGON
With these settings the "Default User" is logged in automatically when you start WinCC Runtime and when other users log off.
File for free downloading:
Silentlogin.exe ( 29 KB )
The sample program is freeware. Any user can use, copy or forward this program FREE OF CHARGE. The authors and owners of this program take no responsibility whatsoever for the functionality and compatibility of this software. Use of the software is entirely at the users own risk. Since this software is free of charge, there is no warranty, no claim for error correction and no hotline support.
Keywords: Silent Login, Autologon
|