A WinCC push button cannot use @CurrentUser directly as its Operator-Control Enable condition. The user tag contains the active username as text, while the enable property requires a Boolean result. Compare the username first, then connect the comparison result to the button property.
Why the Direct Tag Connection Fails
@CurrentUser is a string, not a login-status bit. It therefore does not change to 1 after login or 0 after logout. Connecting it directly to a property that expects true or false creates a data-type mismatch and will not provide the required access control.
| Item | Data required | Purpose |
|---|---|---|
@CurrentUser |
String | Identifies the active username |
| Username comparison | Boolean result | Returns true only for the permitted user |
| Operator-Control Enable | Boolean condition | Enables or disables button operation |
Configure the Username Comparison
Use a dynamic dialog or script to compare @CurrentUser with the username permitted to operate the button. Apply the resulting Boolean value to Operator-Control Enable under the button's Miscellaneous properties.
- Select the push button in the graphic window.
- Open Miscellaneous and locate Operator-Control Enable.
- Create a dynamic dialog or script for that property.
- Compare
@CurrentUserwith the required username. - Return true when the strings match and false when they do not.
IF @CurrentUser equals permitted_username THEN
Operator-Control Enable = true
ELSE
Operator-Control Enable = false
END IF
Enable Versus Visibility
Use Operator-Control Enable when the button must remain visible but must not accept operator input. A display or visibility property controls whether the object appears; it does not implement the same behavior. Do not connect @CurrentUser directly to either Boolean property—perform the string comparison first.
Verify the Configuration
Log out and confirm that the button cannot be operated. Log in with the permitted username and confirm that it becomes operable, then log in with a different username and confirm that it remains disabled. If the result never changes, monitor the value of @CurrentUser and verify that the comparison text exactly matches the active username.
FAQ
Does WinCC @CurrentUser become 1 after login?
No. @CurrentUser contains the active username as a string, so it must be compared with the permitted username to produce a Boolean result.
How do I disable a WinCC button until a user logs in?
Apply a dynamic dialog or script to Miscellaneous > Operator-Control Enable. Return true when @CurrentUser matches the permitted username and false otherwise.
Why does my WinCC button disappear after login?
Check whether you configured a display or visibility property instead of Operator-Control Enable. Use the enable property when the button should stay visible but reject operator input.