IMDTouchKnowledge BaseShop main store

Explainer

Reading an RFID Card UID Into an HMI Over USB

HMI and touchscreens Published 8 min read By IMDTouch engineering team

Short answer

The USB port on an MTP1500 Unified Comfort supplies power and a connector, not a data path. The card UID reaches a runtime tag only if the reader presents as a USB keyboard, speaks a documented connection such as Modbus RTU on the RS422/485 port, or comes through HMI option+ with a function that exposes the identifier. UID identification stays separate from HMI login, so the panel needs no account for each user.

On this page
  1. What the USB port on the panel provides
  2. The three paths that move a UID to a tag
  3. What HMI option+ has to prove
  4. Identification by UID is not an HMI login
  5. Reading the value at each boundary
  6. Worked example: sizing a string tag for a 4-byte UID typed in keyboard mode
  7. The decision for each case
  8. Questions asked

Plug an RFID reader into USB port X61 on an MTP1500 Unified Comfort and you get power and a connector, nothing more. The card UID reaches a screen tag only through an interface the panel actually supports: a reader in USB keyboard emulation typing into a focused input field, a documented serial connection such as Modbus RTU on the RS422/485 port, or a vendor integration like HMI option+ whose documented functions hand the identifier to the runtime. You also do not need an HMI login for every user: the panel identifies the card and forwards the string, and a controller or database decides who may pass. What follows is what each path requires, where the value can stop moving, and which route fits an installation with many users and several access points.

What the USB port on the panel provides #

The Unified Comfort interface description for this device class names two PROFINET interfaces (X1 with two ports, and X2), RS422/485 on X20, and USB host ports X61 through X64. Your reader sits on X61, which is a host port: it supplies 5 V and enumerates devices.

What it will enumerate is a short list. The vendor's support entry on supported USB devices for Unified panels, entry ID 19188460, names external USB mouse and USB keyboard including trackball and touchpad, USB sticks formatted FAT32 or NTFS, and its own SIMATIC mobile handheld barcode readers. That is the documented set. The panel runtime has no generic driver loader, so whether your RFID reader works is decided by its USB device class, not by the cable: a reader in keyboard emulation enumerates as a USB keyboard and sits inside the supported set, while a serial-over-USB or vendor-specific interface has no documented driver and no tag will ever see its data. Do not treat the panel as a desktop PC or try to install a driver on it.

The three paths that move a UID to a tag #

Path What the panel sees What you build The catch
Keyboard emulation on X61 Keystrokes from a supported keyboard-class device A screen input field bound to a string tag; the terminator marks a completed read Keystrokes land wherever focus is
Modbus RTU reader controller on X20 Register data the panel polls A tag mapped to the controller's UID register plus a new-read flag Needs a reader or gateway with a real RS422/485 interface
HMI option+ integration A documented vendor function Whatever its function exposes; verify it is the UID, not only a login Must list your panel model, runtime and reader

Keyboard emulation is the shortest route. The reader types the UID as characters exactly as a USB keyboard would, into whichever input field has focus, so you bind a string tag to that field, set the output format in the reader's configuration facility, and treat the terminating character as the read-complete event. Keep focus on that field during operation; a keystroke stream with nowhere to land is the usual reason a healthy reader shows nothing.

The serial route has a real data channel behind it. The Modbus RTU runtime's supported-device list includes the MTP1500 Unified Comfort, and its RS422/485 interface is X20, so a reader head with a serial controller, or a small gateway, can serve each UID in registers with a sequence flag the panel can watch. The controller can timestamp and forward reads to your database while the panel only displays.

The third route is the vendor integration, and it has to prove itself before you build on it.

What HMI option+ has to prove #

HMI option+ is the integration candidate for this panel family, but it stays a candidate until its documentation matches your equipment. Check four things: the supported panel models; the runtime version installed on the panel, recorded from the device itself, because TIA Portal V18 names the engineering release only; the reader interfaces it supports; and what its functions return. The last one decides: a documented function must place the card identifier into a tag you can display and forward. A function that only performs a login fails your requirement even when the reader is on the compatibility list, because you need the UID on screen and in a database, not a logged-on user.

Before any of that, establish what the designation on your hardware names, whether reader, credential or component family, from the nameplate and documentation, because the interface mode lives on the reader while the UID length lives on the card. A stalled read on an RF1040R head, a read block that stays busy, is a reader-side fault with its own fix, covered in diagnosing an RF1040R read block stuck busy.

Identification by UID is not an HMI login #

A UID selects a credential record; authorization decides what that credential may do at a particular station. Keep the two apart. The panel does identification and forwards the string; one controller or database holds the credential-to-permission mapping for every workstation, so a card is revoked once, centrally, instead of at each screen.

HMI user management is a separate mechanism that guards panel operation rights, who may edit setpoints or acknowledge alarms, and its methods are catalogued in login methods on a Unified Comfort Panel by user management. An HMI account for every badge would tie authorization to one panel and still would not scale across your stations. When a panel-side card login is wanted, the card-to-user assignment is done on the panel, not in the project file, as why RFID card assignment happens on the panel not in the project explains; on the Comfort Panel family the documented card-login integration is RFID card login on a Comfort Panel with PM-LOGON Basic, which logs a user on but does not expose UIDs for a database.

If the panel's own login instead throws an authorization failure, a None fault on an MTP1500 after a V19 upgrade for example, that is the user-management layer, covered in fixing a WinCC Unified V19 None authorization failure on an MTP1500. One security note where it belongs: the UID is an identifier, not proof of identity, so let the controlled system make the actual decision.

Reading the value at each boundary #

The value travels from card to reader to interface to runtime tag to screen object to controller or database, and it stops at exactly one of those boundaries when it fails. Test with one known card and read the value at each point:

  • Reader output: the complete string from the reader's diagnostic or configuration facility, separators, prefixes and terminator included.
  • Tag value: what the tag actually holds, compared character for character with the reader output.
  • Screen object: confirm the display is bound to that tag.
  • Controller: confirm the string received on the far side of the panel's connection.

Then present the same card repeatedly, the same string each time, and a second card, a different string, before any database work. One more rule: an unchanged tag value cannot distinguish a re-presented card from no card at all, so give every path a new-read indication, the terminating character in keyboard mode, a sequence counter or flag from the controller in Modbus mode.

Worked example: sizing a string tag for a 4-byte UID typed in keyboard mode #

Inputs, with where each comes from:

  • UID length: 4 bytes, the common single-size credential; confirm it on your card's datasheet, because 7- and 10-byte UIDs exist and change the arithmetic.
  • Reader output format, read from the reader's configuration facility: uppercase hexadecimal bytes separated by single spaces, terminated by one carriage return. This is an example configuration; read yours off the reader.
  • Target: an HMI string tag, for example CardUID, whose length you set in the project.

Rule in words: the tag must hold every character the reader types. Each byte renders as two hexadecimal characters, and each separator and the terminator adds one more.

Arithmetic: 4 bytes x 2 characters = 8 characters; 8 + 3 separator spaces = 11 characters; 11 + 1 carriage return = 12 characters. Set the tag to 16 characters, at least the 12 needed, so the read fits with margin, and any tag shorter than 12 characters truncates it.

The numeric trap, in case you are tempted to store the UID as a number: take the example card 04 A3 1B 7F. As a number that is 0x04A31B7F = 4 x 16,777,216 + 10 x 1,048,576 + 3 x 65,536 + 1 x 4,096 + 11 x 256 + 7 x 16 + 15 = 67,108,864 + 10,485,760 + 196,608 + 4,096 + 2,816 + 112 + 15 = 77,798,271. Rendered back to hexadecimal, the leading zero is gone, 4A31B7F with 7 characters, and a lookup keyed on 8-character strings misses the record.

Decision: store the UID as text in a 16-character tag for this reader, and normalize before the database lookup: strip the terminator and separators down to the bare 8-character hexadecimal form, and apply the same normalization on the database side.

The decision for each case #

If the reader's documentation offers a keyboard-emulation mode, use it on X61: set the mode, bind the string tag to a focused input field, take the terminator as read-complete, normalize, forward. It is the shortest documented route and needs nothing beyond the project and the panel's supported keyboard class.

If the reader speaks only a vendor-specific USB protocol, HMI option+ is the only integration worth building on, and only when its documentation names your panel model, your runtime version and your reader, and exposes the identifier to a tag. Otherwise replace the head with a keyboard-emulation unit or a serial reader.

If several access points share one database, put a reader controller or the PLC between the cards and the panels: UIDs arrive over Modbus RTU on X20 or the controller's documented connection, each panel displays and forwards, and one mapping table decides access for every station.

For the reader already sitting on X61, commit to keyboard emulation as the default. Move to the serial-controller path when you need a real read event, centralized revocation or several heads under one controller, and use HMI option+ only when its documents name your exact combination.

Questions asked

Why does the reader work on a laptop but show nothing on the panel?

A laptop loads a driver for almost any USB class, so a serial or vendor-specific reader works there. The panel supports only its documented device list, so the same reader shows nothing if its USB class is not on it. The laptop test proves the reader and card are healthy; it says nothing about panel support, which the device class decides.

Will a USB-to-serial adapter on X61 make a serial reader work?

No. The supported-device list for Unified panels does not include serial adapters, and the panel runtime has no generic driver loader for USB devices, so the adapter never creates a serial channel the project could use. Give a serial reader the RS422/485 port X20 with Modbus RTU, or place a gateway that serves the UID over a connection the panel documents.

How do I add a second workstation without reworking the credentials?

Repeat only the display side. The new panel gets the same string tag and input field, or the same Modbus register mapping, and it forwards UIDs to the same controller and mapping table. The credential data does not change, and no panel accounts are created, because the authorization decision stays in the one central table every station queries.

Is the UID alone enough security for access control?

No. Common credentials broadcast their UID in the clear, so it can be copied and replayed. Use the UID to select the record, and let the controlled system apply the site's required protection level; where cloning is a real risk, specify credentials with cryptographic authentication instead of relying on the identifier.

Keep reading

  • Selection guide

    Running five machine HMIs and a line overview on WinCC Unified

    Yes: one WinCC Unified project serves five machine screens plus a line overview. Choose between dedicated Unified panels per machine or one Unified PC Runtime with browser clients; the runtime license includes two access points but only one control-mode connection, so five operating stations need four additional WinCC Unified Client Operate licenses.

    HMI and touchscreens

  • How-to

    Connecting a KTP600 to LOGO 8 with WinCC V13

    A KTP600 Basic connects to a LOGO! 8 with an S7 connection in TIA Portal V13: choose the S7-200 driver, enable Allow S7 access in the LOGO! project, place both devices in one IP subnet, and bind tags to the V addresses the LOGO! mapping table assigns. Prove it with one forced value read back on the panel before building screens; the Siemens V11 example shows the arrangement, your 0BA8 supplies the addresses.

    HMI and touchscreens

  • Troubleshooting

    Why a Comfort Panel script cannot restart a USB port

    Comfort Panel scripts have no documented function to disable and re-enable a USB port, so a script cannot restart the RFID reader connection. Sort each drop-out into one of two logged failure states, recover it by USB reconnection or a panel power cycle, and escalate to Siemens support with the Option+ and TIA Portal versions.

    HMI and touchscreens

Fixing Vijeo Designer Error 1850 Secondary Drive Not Found