IMDTouchKnowledge BaseShop main store

How-to

Sending the Active HMI User to the PLC With Login Macros

HMI and touchscreens Published 6 min read

Short answer

FactoryTalk View has no system tag that copies the logged-in user or group into the controller. Create one login macro per Runtime Security group, each writing its group name to the same PLC STRING tag, and a logout macro that clears it. The PLC then reads a role, not a password.

On this page
  1. Why nothing reaches the PLC by itself
  2. Choose the group name or the user name
  3. Prepare the controller side
  4. Build the login and logout macros
  5. A worked example with the counts
  6. Test every transition
  7. What goes wrong in practice
  8. Questions asked

There is no dedicated tag that carries the FactoryTalk View user into the controller. The panel tracks the signed-in user as the HMI tag system\User, and the PLC sees nothing until the application writes something across. The write belongs to the security event itself: one Login Macro per Runtime Security group, each writing that group's name into the same controller tag of data type STRING, plus one Logout Macro that clears it. The controller then gates permissions on plain text such as Maintenance instead of guessing who is at the screen. These steps build that handoff on a PanelView Plus 1250, whose runtimes come from FactoryTalk View Studio for Machine Edition.

Why nothing reaches the PLC by itself #

system\User lives in the HMI tag database, so it exists only inside the FactoryTalk View application. A screen can display it, but a controller cannot browse another device's HMI tags, and a tag definition never writes anything on its own. The transfer has to be triggered by the login and logout events, which is exactly what the Login Macro and Logout Macro fields in the Runtime Security editor are for.

Reject one alternative before you build anything: storing the HMI password in the PLC and comparing it in ladder. A match only proves that a number matched. It never identifies the active FactoryTalk account, it breaks the day someone changes the password on the panel, and it parks a credential in controller memory. Authentication stays on the panel; the controller receives the resulting role as data.

Choose the group name or the user name #

Decide this first, because it fixes how many macros you will write.

  • The controller needs an authorization level: send the group name. Nearly every machine asks "is Maintenance signed in," not "is this particular person signed in," and groups are the version you can maintain.
  • The controller must record the individual: send the user name, and assign the login macro to each user account instead of each group. The macro count then tracks your account list.

Send one format in one tag. Mixing group names and account names in the same string forces the PLC to test every value against two lists, and any account that shares a name with a group becomes ambiguous.

Prepare the controller side #

Create one tag of data type STRING in the controller. That tag is the entire destination; every macro writes to it.

Prove the path before touching macros. Put a push button or entry object on a screen and write to the tag over the same communication shortcut the macro will use. A macro cannot repair a broken shortcut or a read-only destination, and debugging that through security events wastes hours.

Define the logged-out state as the empty string. Any value the controller does not recognize as a group grants nothing, so permissions fail closed by construction.

Search the project for anything else that writes this tag. A second writer makes the role look intermittent, and the macros will take the blame.

Build the login and logout macros #

  1. Open the Macros file in FactoryTalk View Studio and create a new macro for the first group.
  2. Give the macro one statement: the destination is the direct reference to the controller STRING tag, and the expression is the group name in quotes, spelled and capitalized exactly as the group appears in Runtime Security.
  3. Repeat for every group the controller must distinguish. Same destination in every macro, different group name in every expression.
  4. Create one logout macro that writes the empty string to that same destination.
  5. In the Runtime Security editor, assign each group its Login Macro, and assign the Logout Macro so every group shares it.
  6. Save, create the runtime, and download it to the panel as an MER. That download is also the step that can overwrite the terminal's runtime user accounts, so read up on keeping PanelView Plus user passwords after an MER download before you deploy.

A worked example with the counts #

An illustrative line runs three Runtime Security groups, Operator, Maintenance and Administrator, and the PLC gates three permission levels on one string.

Item Value
Login macros 3, one per group
Logout macros 1, shared
Total macros 3 + 1 = 4
Controller tags 1 STRING

The names carry numbers worth checking. Operator is 8 characters, Maintenance is 11, Administrator is 13. If the controller logic compares the string's length along with its text, Maintenance must arrive as 11 characters; 10 means a truncated write, and the permissions must not enable.

The test matrix scales the same way: 1 check of the logged-out state, plus 2 checks per group after login and after logout, gives 1 + 2 × 3 = 7 checks. Adding a fourth group costs one login macro, zero new controller tags, and two more checks. Build exactly that and nothing more.

Test every transition #

Run the sequence against the live controller rather than only in development; macro writes need the real path, and testing HMI simulation against a live PLC covers setting that up. User management that passes in development can still fail on the terminal itself, a pattern covered in when HMI user management works in simulation but not on the panel, so finish the checks on the panel.

  • Start logged out: the tag is empty and no permission logic is active.
  • Log in as Maintenance: the tag reads Maintenance and only the intended logic enables.
  • Log out: the tag clears before anyone else signs in.
  • Log in as Administrator and repeat the pair.
  • Pull the communication link mid-session and restore it: the tag holds its last value through the outage, so permission logic should require a healthy connection to the panel as well as a recognized group.
  • Power-cycle the panel: whatever the tag holds at boot is what the PLC acts on, so make the startup state grant nothing until a real login arrives.

What goes wrong in practice #

  • Every login produces the same role: one macro was assigned to all groups, or every macro writes the same expression.
  • The role survives logout: the Logout Macro was never assigned, or it writes a different tag than the login macros do.
  • The tag never moves: the macro is not assigned in Runtime Security, the expression's group name does not match the group spelling, or the write path is dead. The plain write you tested earlier separates the last cause from the first two.
  • The role flickers: a second object or macro is writing the same tag.

One boundary to hold: the role string is authorization, not safety. Machine safety functions stay in the safety-rated logic and never depend on an HMI string or an HMI session.

Questions asked

Can the PLC read system\User directly?

No. system\User lives in the FactoryTalk View tag database inside the application, and a controller cannot browse another device's HMI tags. You can bind it to a string display on any screen, but crossing to the controller still needs a write triggered by a security event, which is exactly what the login and logout macros provide.

What if the PLC needs the individual user name, not the group?

Assign the login macro to each user account instead of each group, keep the same STRING destination, and set each expression to the account name. Count before you commit: a site with 3 groups and 12 accounts goes from 3 login macros to 12. Stay with the group design unless records genuinely require individuals, and never mix account names and group names in one tag.

Does the string clear when the panel loses power or the link drops?

No. The write already happened, so the controller keeps the last value it received. After a reboot or an outage the tag still shows the group that was signed in earlier, until a logout or a new login writes again. Gate permissions on a recognized group string plus a healthy panel connection, and treat a restarted line as logged out until proven otherwise.

Do the macro assignments survive a runtime download or a restore?

The macros and their Runtime Security assignments are part of the project, so they deploy with the runtime you download. What a download or a restore can replace is the set of runtime user accounts stored on the terminal itself. Re-create or re-enable those accounts after deployment, then log in once per group to confirm each assignment still fires.

Does this mechanism work on other PanelView Plus sizes?

The login and logout macro mechanism belongs to FactoryTalk View Machine Edition rather than to one screen size, so a runtime built from that project type carries it across the PanelView Plus family. Confirm per terminal that it is in the project's supported device list and that its firmware matches the runtime version you download.

Keep reading

  • Troubleshooting

    Why a PanelView Plus Shortcut Fails to Reach an Offline PLC

    The shortcut that runs is the one on the Runtime (Target) tab, and it must end at the ControlLogix CPU, not at the 1756-EN2T. Map the route through the EN2T to the CPU slot, copy it to the runtime schema, and download with "replace communications" checked. The EN2T revision is not this fault.

    HMI and touchscreens

  • Troubleshooting

    Why HMI SFTP Cannot See the SD Card Data Log Files

    On a PanelView Plus 7 Series B terminal, the SFTP service publishes internal storage only; the SD card and USB drives never appear to a remote client. A data log whose path root is removable media cannot be retrieved remotely until you redirect it to internal storage or copy it at the terminal with the file explorer application.

    HMI and touchscreens

  • How-to

    Relaying serial PLC data through a C-more HMI to SCADA

    The C-more EA9 is a communications client: it polls the PLCs it is configured for and exposes nothing for Ignition or KepServer to browse. Make the panel the relay instead — add a Modbus TCP server as a second PLC device and copy FX3 tags into it with Tag Copy events triggered from the system clock tags, since scheduled copies run at best once per minute.

    HMI and touchscreens