A USB barcode scanner feeds an HMI text entry object as keyboard input: set the scanner to HID keyboard emulation, select the entry object's USB input style, touch the object, then scan. Prove it in a PC text editor, in the software simulator, and only then on the panel, with each tag sized for the longest label you scan.
A USB barcode scanner feeds an HMI text entry object as keyboard input. There is no barcode driver to install and no barcode object to place: the panel treats the scanner as a USB keyboard, and the string lands in whichever entry object you select on screen. Set the scanner to HID keyboard emulation, put the text entry object on the style that accepts USB input devices, then prove the chain in order: a PC text editor first, the software simulator second, the panel last. This article walks that order, builds the two-object screen a scan station usually needs, and names the symptom that points to each wrong layer.
What you need
- The scanner and its programming sheet, from the scanner maker. The sheet is a card of barcodes you scan to change the scanner's own settings.
- A PC with a plain text editor for the first test.
- The panel programming software with its simulator, and the download cable.
- A panel whose documentation lists USB input devices. If you are still choosing the panel, test startup and runtime on the bench first.
- The real labels you will scan, including the longest one on the bench.
Set the scanner to USB HID keyboard emulation
Panel documentation describes the supported path plainly: a USB barcode reader connects to the display unit and inputs data into the variables behind on-screen objects, and it does this as keyboard input. A scanner set to serial or virtual COM output is not on that path.
- Open the scanner's programming sheet and scan the code for USB HID keyboard emulation. Makers name the mode differently, so match the sheet to your model.
- Plug the scanner into the PC.
- Open a plain text editor.
- Scan a known label.
- Read what appears. The decoded characters should arrive as if typed, and note the terminator: some scanners send an automatic Enter at the end of each scan, others send Tab or nothing.
If the characters appear in the editor with no driver install, the scanner side is done. If nothing appears, or the wrong characters appear, the scanner is not in keyboard emulation and nothing downstream will work.
Create the entry object for USB input
- Place a Text Entry object on the screen. Pick Text, not Numeric, unless every label on the bench is purely numeric: letters cannot land in a numeric tag.
- Select Object Style 2, the style that enables USB input devices and suppresses the popup keypad. Software that numbers styles differently will still describe the option as the one for USB keyboards and scanners.
- Assign a text tag sized for the longest label you will scan, with a small margin.
- Download the project to the panel.
Touch the object after the download. No keypad should appear. That is the style working: with the default style the object raises the on-screen keypad, and the touchscreen keypad design article covers keeping those taps reliable where operators still type.
Rehearse in the simulator
The Project Simulator in the programming software works with HID USB devices connected to the PC, so you can exercise the whole receive path before the panel is mounted or wired.
- Connect the scanner to the PC.
- Run the Project Simulator with your project loaded.
- Click the entry object on the simulated screen.
- Scan a valid label.
- Read the string in the object, then open the simulator's Tag list tool and read the same string as the tag value.
The tag holds whatever the device sends, framing included. A magnetic stripe card read through this path arrives with its full track data, start and separator characters included, so strip unwanted framing with the scanner's prefix and suffix settings or in your own logic. If the simulator receives the scan and the panel does not, the fault is on the panel side: port, cable, object style, or which object is selected.
Run it on the panel
- Plug the scanner into the panel's USB host port, the port the manual lists for keyboards and barcode readers; on the panel this article targets it is labeled USB port B.
- Run the project and touch the entry object. The keypad stays down.
- Scan a label. The string lands in that object's tag.
With several entry objects on one screen, the active one is the only object that receives the data string from the USB device. The operator's sequence is fixed: touch the object to fill, scan, read the tag. Every other entry object on the screen stays unchanged.
Example: two entry objects, one bench screen
Scenario: a packing bench panel runs one screen with two Text Entry objects, both on the USB input style. Object A takes the product label, a UPC-A code, which carries 12 digits; the label on this bench reads 012345658748. Object B takes the work-order label, encoded in Code 128 as WO04872, 7 characters.
Set the tags before the first scan. Object A gets a 14-character text tag: 12 digits used, 2 spare, enough for a 14-digit carton code if the bench adds one. Object B gets a 10-character tag: 7 used, 3 spare.
Scan with object A selected: 12 fits inside 14, so the full code lands, and the Tag list tool shows 012345658748. Select object B and scan the work-order label: 7 fits inside 10, so WO04872 lands complete, and object A still holds the UPC.
Then the truncation check. Shrink object B's tag to 5 characters, re-download, and scan the same label: only the first 5 characters arrive, WO048, and the tail is gone because the destination was too small. The documented version of this fault is a 12-digit code that left just its first 9 digits in an undersized destination. Size the tag to the longest label and one re-download and scan confirms the fix.
Result: one scanner, two objects, two independent tags, and a tag sizing rule checked in a single scan.
Symptoms and what each points to
| Symptom | What it points to | What to do |
|---|---|---|
| Keypad pops up on touch | Object not on the USB input style | Select the style again and re-download |
| Scan does nothing | Scanner not in HID keyboard mode, or no object selected | Redo the PC editor test, then touch the object first |
| Tail of the code missing | Tag shorter than the label | Resize the tag to the longest label and re-download |
| Extra characters around the data | Scanner prefix or suffix framing | Reprogram prefix and suffix, compare with the PC editor result |
| USB mouse dead while the project runs | Expected behaviour: a project in run mode has no cursor | None; judge the scanner by the entry object only |
Sign the station off
Run the end-to-end check in the order that finds a fault fastest:
- PC editor shows the label's characters, with the terminator noted.
- Project Simulator: the object and the Tag list tool both show the full string.
- Panel: touch raises no keypad, the scan fills the selected object, and the longest real label arrives intact.
- Two-object test: select each entry object in turn, scan the same label, and confirm each tag updates on its own.
Keep scan-filled tags away from anything that starts motion until the PLC link has been tested on a harmless tag; the operator panel PLC link setup walkthrough covers that test order. Once the code reaches the PLC, the same string can be echoed back to the panel as a text display; displaying a PLC string on the panel covers that side.
Recommendation: Set the scanner to USB HID keyboard emulation and prove it in a PC text editor before anything else. Give every label a Text Entry object with the USB input style selected and a tag sized to the longest code plus a margin, rehearse the scan in the Project Simulator, and run the two-object test on the panel before the station goes on the line. If the scanner cannot be set to HID keyboard emulation, or the panel's documentation lists no USB input devices, stop at the editor test and change the scanner or the panel.
Questions
Does the panel need a barcode driver or a barcode object?
No. The scanner sends plain keystrokes over the USB HID keyboard class, so the panel handles it on the keyboard input path it already has. There is no barcode-specific object to place and no barcode protocol to configure in the project. If the scanner cannot be set to HID keyboard emulation with its programming sheet, it will not feed an entry object this way. Scanners that only offer serial or virtual COM output are a different wiring job, outside this procedure.
Which symbology should the labels use?
Match the symbology to the characters the code must carry. Code 39 holds 43 characters: the digits, uppercase A to Z, the space, and the dash, dot, dollar, slash, plus and percent symbols. Code 128 carries all 128 ASCII characters, so it also takes lowercase letters. A purely numeric label such as a 12-digit UPC-A code can land in a numeric entry tag; anything with letters needs a text entry tag.
Can one scan fill two entry objects at once?
No. The USB device sends its string to the one active object, the one selected on screen, and every other entry object on that screen stays unchanged. If the same label must feed two tags, scan it once into one tag and copy from there in your PLC or script logic, or scan it a second time with the other object selected.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.