Overview
This article documents how to implement an automatic operator login at runtime start on SIMATIC Basic Panels (KTP400 Basic, KTP700 Basic, KTP700 Basic 2nd generation, KTP900 Basic, KTP1200 Basic, KTP1200 Basic 2nd generation) programmed with TIA Portal / WinCC (TIA Portal) Comfort or Advanced. Automatic login is commonly requested when an HMI must power up directly into the operator's main screen without presenting a password dialog, for example on OEM starter kits, kiosk-style HMIs, or single-role machines.
Three engineering approaches are presented:
-
Dummy start screen + value-change event using the system function
Logon. -
Area pointer "Coordination" + tag trigger firing the
Logonfunction on tag change. -
Scheduler / planned task calling
Logononce at runtime start (supported only on Comfort Panels and on Basic Panels whose runtime image supports scheduled tasks - see compatibility section).
Prerequisites
| Requirement | Specification |
|---|---|
| Engineering tool | TIA Portal V16 / V17 / V18 (V15.1 minimum for system function parameter expansion) |
| HMI runtime | WinCC Comfort or WinCC Advanced (Basic Panel target) |
| Panel families | KTP400 Basic PN, KTP700 Basic PN, KTP700 Basic PN 2nd, KTP900 Basic PN, KTP1200 Basic PN, KTP1200 Basic PN 2nd |
| Runtime firmware | KTP Basic 2nd gen: image version >= V16 update 4; legacy KTP Basic: image version >= V13 SP2 |
| User administration | Enabled with at least one user group and one user account (e.g., "Operator") |
| Tag memory | One internal HMI tag of type Bool or Int with a start value |
| Documentation | SIMATIC HMI Panels - Operating Manual (Basic Panels), WinCC (TIA Portal) - System Functions Reference |
User Administration on Basic Panels
User administration in TIA Portal is configured under Runtime settings > User administration of the HMI device. Each panel supports a limited number of users and groups; the limits differ between 1st and 2nd generation devices:
| Panel | Max. users | Max. groups | Password length |
|---|---|---|---|
| KTP400 Basic / KTP700 Basic (1st gen) | 32 | 10 | 1-24 characters |
| KTP700 Basic 2nd / KTP900 Basic / KTP1200 Basic (1st gen) | 32 | 10 | 1-24 characters |
| KTP1200 Basic 2nd gen | 50 | 15 | 1-24 characters |
Create at least one group (e.g., "Operators") with appropriate area authorizations and assign at least one user (e.g., "Operator") to that group. The login used for the automatic procedure must exist with a known, project-defined password - never rely on default empty passwords because they are stripped at compile time.
Confirm the user can be logged in manually from the runtime via the standard user button before automating the procedure. This isolates credential problems from automation problems.
System Function Reference
The TIA Portal Logon system function logs the named user on with the supplied password. Its parameters:
| Parameter | Type | Description |
|---|---|---|
| User | String / WString constant or tag | User name as defined in user administration |
| Password | String / WString constant or tag | Plain-text password (compiled into the runtime file) |
| Return value | Bool / Int tag (optional) | Receives 1 / TRUE on success, 0 / FALSE on failure |
Two complementary functions are useful for cleanup:
-
Logoff- terminates the current user session. -
GetUserName- reads the currently logged-in user into a string tag for diagnostics.
Detailed parameter semantics are in the WinCC (TIA Portal) system manual referenced in the Prerequisites table. The Logon function executes synchronously on the HMI runtime; no screen change is performed by the function itself.
Approach 1 - Dummy Start Screen with Value-Change Event
This is the most widely supported method on legacy and current Basic Panels because it uses only screen events and the built-in Logon function - no scripting, no scheduler, no project-wide event needed.
Concept: Configure the panel's startup screen to a dedicated, empty "AutoLogin" screen that contains an internal trigger tag. When the screen loads, the tag's start value triggers a value-change event that runs the Logon function with hard-coded credentials and then activates the real start screen.
Step-by-step - Approach 1
- In the HMI tag table create an internal tag
HMI_StartupTriggerof typeBoolwith Start value = 1. - Add a new screen
AutoLogin. Leave the visual content empty (optional text "Logging in..."). - In the project tree, under HMI device > Screens > AutoLogin > Events, open Loaded.
- Add the following function list on the Loaded event:
-
Set tag- setHMI_StartupTrigger= 0 (to avoid re-trigger on screen refresh). -
Logon- User = "Operator", Password = the operator's password constant. - Optionally:
Set tag- write return value ofLogoninto a diagnostic tagHMI_AutoLoginResult. -
ActivateScreen- Screen name = "Main", Number = configured screen number (default 1).
-
- In the value-change event of
HMI_StartupTriggeradd a redundantActivateScreencalling the main screen as a safety net. - Open Runtime settings > General > Start screen and select AutoLogin as the project's start screen.
- Compile and download the project to the panel.
Why it works: The screen's Loaded event fires exactly once per runtime start because the trigger tag is reset to 0 inside the same function list. Manual operator navigation back to AutoLogin after first start will still reset the trigger, but the value-change event will not fire (0 -> 0) and the user will simply be re-validated, which is harmless.
Approach 2 - Area Pointer Coordination with Tag Trigger
The Coordination area pointer is a 1-word interface that lets the PLC handshake with the HMI for life-bit and operator acknowledgement. It also exposes the runtime's "operating state" via individual bits. By assigning a tag of the PLC's choosing as the trigger source, you can fire Logon from a value-change event anywhere in the project without relying on a dedicated screen.
Step-by-step - Approach 2
- Enable the Coordination area pointer under Runtime settings > Connections > Area pointer with a tag from the PLC (e.g.,
DB_HMI.Coordination, length = 1 word). - Create a trigger tag
HMI_LoginPulseof typeBool, Start value = 0, internal. - Open HMI device > Events > Tag value changes and add an event for
HMI_LoginPulseon the change from 0 to 1. - Add to that event:
-
Set tag-HMI_LoginPulse= 0 (clear the pulse). -
Logon- User = "Operator", Password = operator password. -
ActivateScreen- "Main".
-
- From the PLC startup OB (e.g.,
OB100) or first scan, set the HMI bit that drivesHMI_LoginPulseto 1 for one cycle after the HMI signals "ready". A common pattern:
// Pseudo-ST in PLC startup
IF "HMI_Coord".%X11 THEN // bit "ReadyForOperation" from Coordination pointer
"HMI_LoginPulse" := TRUE;
END_IF;
Why it works: The Coordination area pointer tells the PLC when the HMI runtime is fully initialized. Driving HMI_LoginPulse from the PLC ensures that the value-change event fires after the HMI user administration is loaded - which is required for Logon to find the user entry.
Approach 3 - Scheduler (Where Supported)
Some Basic Panel images support the Scheduler (planned tasks) editor under HMI device > Schedules. Where supported, you can configure a one-shot task that fires Logon at runtime start.
- Open HMI device > Schedules and add a new trigger named
AutoLogin. - Set the trigger condition to "Runtime start" (available on Comfort Panel images and selected 2nd gen Basic Panel images).
- Configure the event to call the
Logonsystem function with the operator credentials. - Optionally follow with
ActivateScreento your main screen.
Parameter Mapping Summary
| Approach | Trigger source | Required panel feature | Robustness | Recommended use |
|---|---|---|---|---|
| 1 - Dummy screen | Screen Loaded event + tag change | None (universal) | High | Stand-alone panels, OEM starter kits |
| 2 - Coordination pointer | PLC startup handshake | Coordination area pointer | Highest (PLC-driven) | Tightly coupled PLC-HMI systems |
| 3 - Scheduler | Runtime start trigger | Scheduler with Runtime start trigger | Medium | Comfort Panels and 2nd gen Basic |
Verification
- Reboot the panel (power-cycle, do not just restart the runtime from the loader).
- Observe: the panel briefly shows the
AutoLoginscreen (Approach 1) or the configured main screen directly (Approach 2 / 3). - Open the user button on the runtime and confirm that the current user is the configured operator, not "Logged out".
- Inspect the diagnostic tag
HMI_AutoLoginResult- it must contain 1 (TRUE) after startup. If it reads 0 theLogoncall rejected the credentials; jump to the Troubleshooting section. - Stop and restart the HMI runtime from the loader (Start > Start Runtime) three times and verify identical behavior.
- Power-cycle the panel and verify again. The trigger must fire on every cold start.
Troubleshooting Matrix
| Symptom | Likely cause | Corrective action |
|---|---|---|
User stays logged out; Logon return = 0 |
Wrong user name (case sensitive) or password mismatch between project and runtime | Recompile project after correcting the constant; re-download full project, not delta |
| User stays logged out; no function list executes | Event is configured on the wrong trigger object (e.g., wrong tag) | Verify the tag's event configuration in Project tree > HMI tags > Events |
| Login fires on every navigation back to AutoLogin screen | Trigger tag not reset to 0 inside the function list | Add a Set tag step at the top of the function list that sets the trigger to 0 |
Coordination pointer approach: Logon fires before runtime is ready |
PLC sets the pulse on first scan before HMI sets the ReadyForOperation bit | Gate the PLC pulse on the HMI "Ready" bit (Coordination bit 11), not on first scan |
| Scheduler approach: trigger does not exist in editor | Panel firmware does not support Runtime-start trigger | Switch to Approach 1 or 2 |
| Login succeeds but main screen does not load | Screen number mismatch with ActivateScreen
|
Use screen name parameter rather than screen number |
| User logs in but immediately logs out | Another event runs Logoff after the startup sequence |
Search project for Logoff calls and review ordering |
Security Considerations and Field-Proven Caveats
- Credentials compiled into the HMI runtime file are extractable from the .ap* / .br* image. Do not reuse the same password for operator accounts on HMIs that ship into unsecured environments.
- On 2nd generation KTP Basic panels, user passwords are hashed in the project but the plaintext is still compiled into the runtime; treat the compiled runtime as confidential.
- If you need an "automatic" feel without hard-coded credentials, configure a button that calls
Logonwith credentials from a tag, and have the operator authenticate via RFID or barcode reader that writes the tag. This decouples the credential from the project file. - Adding automatic login disables the original "User view" logon dialog for the operator role. Always provide a path (e.g., shift change button) that calls
Logoffbefore allowing a different role to log in. - Combine with the User login required for operation option in the screen's security settings if you want all other screens to remain protected by group membership while still bypassing the logon dialog.
Field Commissioning Notes
- Always validate the procedure on the actual target panel, not only the TIA Portal simulation. The PC simulation may handle screen Loaded events differently than the embedded runtime.
- If the panel is part of a larger HMI network with a master panel, configure the operator credentials identically on every panel to avoid mismatches after master-to-slave tag distribution.
- For migration from WinCC flexible projects: the same
Logonsystem function exists; the dummy-screen pattern translates directly to TIA Portal screens without changes. - On KTP1200 Basic 2nd generation panels, the runtime supports up to 50 users; reserve at least one slot for a "ServiceAutoLogin" account used only during commissioning and disable that user at production handoff.
Which SIMATIC Basic Panels support automatic login at startup?
All KTP400 / KTP700 / KTP900 / KTP1200 Basic (1st and 2nd generation) panels running TIA Portal image V13 SP2 or later support the Logon system function. For the dummy-screen approach the panel firmware requirement is minimal; for the scheduler approach with "Runtime start" trigger the panel image must be V13 SP2 Update 6 or newer.
Can the Logon system function be called from a script on Basic Panels?
No. Basic Panels do not support VBScript or ANSI-C user scripts. Use the function list editor on screen events, tag value-change events, or scheduler events. Comfort Panels and WinCC Runtime Advanced on PC systems support scripted equivalents but Basic Panels are limited to the function list.
Why does my operator still see the logon dialog after configuring the dummy screen?
The most common cause is that the start screen of the project is not the AutoLogin screen. Open Runtime settings > General and confirm that "Start screen" is set to the dummy screen containing the function list. Also verify that the trigger tag's start value is 1 so the value-change event fires on the very first evaluation after the screen loads.
How do I prevent the automatic login from triggering after a runtime restart from the loader?
Reset the trigger tag in the function list itself (set to 0 before the Logon call), and use a screen Loaded event as the primary trigger. Manual navigation back to the AutoLogin screen after the first login will then reset the tag without firing the value-change event again, preventing re-login.
Is automatic login GDPR- or audit-compliant for production lines?
For FDA 21 CFR Part 11 or similar audit environments, automatic login with shared credentials violates individual accountability requirements. In those environments do not use automatic login; instead implement individual badge login via RFID or username/password on a controlled terminal. The methods in this article are intended for non-audited operator panels where the role rather than the individual is what matters for access control.