IMDTouchKnowledge BaseShop main store

Explainer

Why WinCC Professional shows the current user via @CurrentUser

HMI and touchscreens Published 6 min read By IMDTouch engineering team

Short answer

Bind a text object directly to the system tag @CurrentUser in Runtime Professional; the panel-style user-change task with the read-user-name action is not needed. No @CurrentUserGroup tag exists, so group membership needs a documented interface, such as a scheduler variable trigger on the tag plus a lookup through the runtime API.

On this page
  1. Why is there no user-change trigger in the SCADA project?
  2. Which tag holds the logged-on user in Runtime Professional?
  3. How do I bind a screen object to @CurrentUser?
  4. Does @CurrentUserGroup exist?
  5. How do I react to a login change without a tag event?
  6. How do I display the user's group membership?
  7. What should the runtime check prove?
  8. Questions asked

In a WinCC Professional project the logged-on user's name is already waiting in a system tag: bind a screen object to @CurrentUser and it follows the runtime's login state, with no task-scheduler job and no read-user-name action. That is why the SCADA configuration offers no user-change trigger — nothing needs to be triggered. Group membership is a separate matter: there is no @CurrentUserGroup tag, so a group display takes a documented lookup interface instead of a standard tag.

Why is there no user-change trigger in the SCADA project? #

Because Runtime Professional does not need one: the panel task-scheduler workflow exists to copy a name the panel runtime does not hand out directly, while the SCADA runtime maintains the logged-on name in a system tag you can bind straight to a screen object.

Panel runtimes and Runtime Professional are different runtime families with different engineering interfaces and system functions. On a panel, the name reaches the screen through a scheduler task with a user-change trigger and a read-user-name action that copies it into an internal tag. The supervisory runtime plays a different role in the machine hierarchy — the role described in what WinCC does in an HMI and SCADA system — and it simply exposes the name as a system tag.

Two consequences follow. First, searching the SCADA configuration for the panel-style trigger is a dead end by design, not a missing option. Second, leave the panel tasks alone: the panels in the project still depend on their own user administration, the same mechanism behind why SIMATIC Logon logout uses the panel Administrator timer. Removing a panel task because the SCADA screen no longer needs one breaks that panel.

Which tag holds the logged-on user in Runtime Professional? #

@CurrentUser does: the internal system tag carries the logon name of the currently logged-on user — exactly the name typed at logon — and the runtime maintains it without any task or copy step.

Select it from the system tags offered in the screen configuration, and confirm the selected item is the runtime's system tag rather than a user-created tag with a similar name. A tag you create yourself carries no connection to the login state; only the runtime-maintained system tag does. Because the runtime writes it on every login and logout, a direct binding gives you the current identity for free.

How do I bind a screen object to @CurrentUser? #

Add a text-capable object, bind its displayed value to the tag and set the acquisition cycle — the documented example selects 1 min — then compile and transfer so the screen carries no unresolved tag reference.

  1. Confirm the screen you are editing belongs to the WinCC Professional application with Runtime Professional, not to one of the panel projects in the same portal.
  2. Place a text-capable object on the screen and select the @CurrentUser system variable as its value source.
  3. Set the object's cycle; the vendor's example for reading the current user name in Runtime Professional selects 1 min, which is plenty for an identity indicator.
  4. Choose an output-only presentation — this is a display, not an editable user-name field — and leave enough visible width for the longest account name used at the installation.
  5. Compile and transfer with the normal deployment process for the runtime. Compilation must finish without an unresolved tag reference, and the deployed screen must contain the new object.

For a pure display nothing else is needed. The object's further settings, including its events, live in the Inspector window under Properties > Events; you only go there if you attach additional processing, and the next sections explain why the tag itself offers no event to attach.

Does @CurrentUserGroup exist? #

No: there is no @CurrentUserGroup system tag in Runtime Professional, and creating an ordinary internal tag with that name will not make the runtime populate it.

The reason is that identity and membership are different data. The user name is a string the runtime knows at logon. Group membership is the association between an account and its authorization groups, and authorization is what decides which protected operations the account may perform. Neither can be read off the name, so a correctly displayed name proves nothing about group lookup or about the access restriction on a protected command.

Before building anything, pin down what the requirement actually is: a descriptive group label for the operator, a list of all applicable memberships, or the permission to perform one particular operation. These need different checks, and only the first is a display question at all.

How do I react to a login change without a tag event? #

Use the task scheduler with a variable trigger on the tag: standard system variables carry no assignable event, but a scheduled task started by a variable trigger runs when the tag's value changes.

This is the answer to the dead end of trying to attach an event to @CurrentUser in the tag configuration — a tag value and a tag event are separate capabilities, and the system tag offers only the value. The variable trigger detects the change and starts your processing, but it does not supply any group data. It is a detector, not a lookup.

How do I display the user's group membership? #

Through a documented interface, not a standard tag: read the current user's name with the runtime API function for Runtime Professional, then resolve membership against the account authority the station actually authenticates against.

The runtime API documentation for Runtime Professional includes a function that returns the name of the current user. Combine it with the scheduler route above: a variable trigger on @CurrentUser starts a task, the task calls the documented interface, and the result goes into an internal tag you create for the display. Where SIMATIC Logon is the authentication authority, resolve membership against that authority, because the local user administration may not know the account at all.

One caution on manuals: the Get Group Number system function, which writes the logged-in user's group number to a tag, belongs to WinCC Unified. That is a different runtime; do not expect it in a V13 Professional project.

What should the runtime check prove? #

Three observations settle it: a known-account login shows that name untruncated, an account change with the screen open updates the display, and a logout clears the name rather than leaving a cached one.

Run the check at the station where operators will use it. The current user belongs to the runtime session on each station, so a login observed on one client is not a measurement of another client's session; a multi-station requirement means repeating the check per station, each in its own runtime context. On logout, compare the display with the actual runtime login state instead of prescribing a particular blank text — and know the failure mode: a client logout that does not complete can leave the tag set, the case covered in a WinCC client logout failure that leaves the current-user tag set.

Questions asked

Which acquisition cycle should the @CurrentUser binding use?

The documented example selects 1 min, which suits an identity indicator that changes a few times per shift. A shorter cycle shows a new login faster but reads the tag more often on every screen that displays it; match the cycle to how quickly operators must see a change, not to a fixed rule.

Does the display update when another user logs on while the screen is open?

Yes, when the object is bound directly, because the display follows the tag on its acquisition cycle. A script that reads the name once at screen opening produces a snapshot that can go stale after the next login; if the display lags, look for such a script or a cached copy tag.

Can I read the group number like on a comfort panel?

Not with a standard tag in Runtime Professional. The panel route reads a group number from the panel's own user administration, and the Get Group Number system function belongs to WinCC Unified, a different runtime. In Runtime Professional, resolve membership through a documented interface against the account authority actually in use.

Is the displayed user the same on every operator station?

Not automatically. The current user belongs to the runtime session on each station, so a login observed on one client says nothing about another station's session. If several stations must show identity, run the login, change and logout check on each one in its own runtime context.

Keep reading

  • Explainer

    Why a Comfort Panel shows only VB scripts, not C scripts

    There is no setting to enable C scripts on a Comfort Panel. The configured target decides: a Comfort Panel supports VB scripts only, while C scripts execute in WinCC Runtime Professional, the PC-based SCADA runtime. If C-script logic is required, run that part on a Professional Runtime PC target or rewrite it in VB for the panel.

    HMI and touchscreens

  • Comparison

    Excel chart in WinCC runtime: static image or live data link

    WinCC runtime never reads an Excel workbook: render the chart to a JPEG or PNG and refresh it with a cyclic script and a flag file, or license WinCC DataMonitor so Excel reads live process values, logging tags and alarms through the Excel Workbook Wizard. Choose the image route when the chart must appear on the runtime picture.

    HMI and touchscreens

  • Explainer

    Why WinCC Professional full screen hides a second HMI runtime

    WinCC Professional Runtime in full-screen mode claims the entire work area of the extended desktop by design, so a co-resident Advanced Runtime is hidden behind it, not stopped. Run both runtimes in window mode with one window per monitor, because Advanced Runtime is not released for multi-monitor use and only one Professional Runtime runs in parallel on one operating system.

    HMI and touchscreens

Why WinCC TIA Portal REAL exponential display is runtime limited