1. Problem Definition: Barcode-Driven Tab Advancement
Barcode scanners configured in USB-HID (keyboard emulation) mode transmit decoded data as a stream of keystrokes, terminated by a configurable suffix character — typically CR (0x0D), LF (0x0A), or TAB (0x09). When such a scanner is attached to a SIMATIC Comfort Panel or to a WinCC Runtime Advanced station, the HMI cannot distinguish between a real operator pressing Enter on a USB keyboard and a scanner automatically emitting its suffix character. From the runtime's perspective, both arrive as a single Enter/Tab virtual keypress after the ASCII payload.
The operator workflow that engineers most often need to support is: (1) the screen opens, (2) the first I/O field is auto-focused, (3) the operator scans a barcode, (4) the scanner suffix causes the value to be committed and the focus to move to the next I/O field, (5) the operator scans a second barcode into that field, and so on. The challenge is that the second I/O field cannot be focused by a follow-up script because the developer has been asked specifically not to use VBScript. WinCC Advanced V17 provides a non-script path through tab order indices and the Input finished event, but only on Comfort-class panels. The lower-cost Basic Panel family (KTP400 Basic mono, KTP700 Basic PN, KTP900 Basic, KTP1200 Basic) does not expose either feature at runtime, even when the engineering software is TIA Portal V17 with WinCC Advanced.
This article documents the non-script implementation, the exact knob that is most often missed (the screen template's Tag sequence setting), and the verified fallback paths for Basic Panels.
2. Prerequisites
- TIA Portal V17 (any update level from V17.0 through V17.0.0.4 or later; later updates add minor fixes but do not change the events described here).
- WinCC Advanced V17 runtime on the target Comfort Panel, or a WinCC Runtime Advanced installation on a Windows PC.
- A keyboard-emulation barcode scanner. The Zebra DS9208 Product Reference Guide covers the USB HID configuration bar codes and the suffix programming sequence. The Honeywell MetroSelect Single-Line Configuration Guide covers Honeywell Voyager, Vuquest, and IS4125-series engines with equivalent options.
- An HMI screen with at least two I/O fields, each bound to a process tag.
- If a screen template is in use, read access to the template properties — the template's Tag sequence setting is the most common cause of failure (see Section 7).
3. Scanner Suffix Configuration
The suffix that the scanner sends determines whether the HMI sees the value as 'complete.' Different scanner families expose this through different programming menus; the underlying concept is identical. Configure the scanner before connecting it to the panel, then verify in Notepad that every scan produces a value followed by a newline.
| Vendor | Document | Suffix Setting | Default | Required for This Article |
|---|---|---|---|---|
| Zebra (DS9208, DS2208, DS9908) | DS9208 Product Reference Guide | Suffix (None / CR / LF / CRLF / TAB) | CR | CR |
| Honeywell (Voyager 1450g, Vuquest 3320g, IS4125) | MetroSelect Single-Line Configuration Guide | Terminator / Suffix Code | Enter (CR) | Enter (CR) |
4. Tab Order Index Configuration
The tab order index is a per-screen property that determines the order in which tab-able objects receive input focus when the operator or scanner emits a Tab or an event-based focus change. In TIA Portal V17, the tab order editor is opened from the screen editor toolbar: View → Tab Order, or by pressing the Tab Order icon in the lower-right of the screen editor toolbar.
For a two-field screen the configuration is:
- Open the screen containing the two I/O fields.
- From the menu, select View → Tab Order. The screen editor switches to a numbered overlay.
- Click the first I/O field; in the inspector pane (right side) under Properties → Miscellaneous → Tab order, set the index to
1. - Click the second I/O field; set the tab order index to
2. - If there are buttons (for example, a Cancel button) that should be reachable later but not the next tab stop, set their tab order to
0to remove them from the cycle. - Save the screen with Ctrl + S and compile the HMI station.
For screens that use a screen template, the tab order indices of the template objects (header, footer, navigation buttons) are merged with the screen's indices at runtime. If the template's Cancel button is on tab order 3, the runtime will focus the Cancel button after the second I/O field. To keep the auto-tab workflow clean, set template objects that should not participate in the auto-tab to tab order 0, or use the template's Tab order group setting to scope the indices.
When tab order is configured this way, the ActivateScreen system function (Section 6) can refer to the next field by its tab order index. The runtime walks the tab order and the field whose index matches the supplied Object Number receives focus.
5. The 'Input Finished' Event
On Comfort Panels and WinCC Runtime Advanced, every I/O field exposes a set of events under Properties → Events. The relevant events are:
| Event | Fires When | Suitable for Auto-Tab? |
|---|---|---|
| Activate | The field receives input focus | No |
| Deactivate | The field loses input focus (for any reason) | No — fires on manual tab-out as well |
| Input finished | The runtime has accepted the entered value as complete (typically after the user commits with Enter or the scanner suffix) | Yes — only fires when the value is committed |
| Value changed | The tag's value is updated for any reason (including programmatic resets) | Risky — see Section 9 |
The runtime fires the events in this order during a single scan: Deactivate on the source field (if focus changes), Activate on the target field, then Input finished on the source field after the value has been committed to the process tag. Because Input finished is the last event in the sequence, it is the safest trigger for any side-effect that depends on the value being durable (PLC-readable, archived, etc.).
The Input finished event is the correct trigger for the barcode workflow because it fires only when the runtime treats the value as committed — i.e., the scanner's CR suffix has been processed and the process tag has been written. To wire it, select the first I/O field, open Properties → Events, locate the Input finished row, click the empty cell on the right, and add a system function call (Section 6).
If Input finished is not visible in the events list, the HMI device is almost certainly a Basic Panel, not a Comfort Panel. The entire family of SIMATIC Basic Panels (KTP400 Basic, KTP700 Basic, KTP900 Basic, KTP1200 Basic) only exposes Activate and Deactivate on the I/O field — confirmed for the KTP700 Basic PN with firmware 15.1, the device class used during the original report. The Input finished event requires the Comfort runtime. See Section 8 for the Basic Panel fallback.
6. Wiring the ActivateScreen System Function
ActivateScreen is a WinCC system function that opens a screen and, optionally, focuses a specific object on that screen. The relevant parameters are Screen name (the target screen) and Object number (the tab order index of the object to focus, or 0 to focus no object).
For a two-field screen the configuration is:
- Select the first I/O field (tab order = 1).
- Open Properties → Events → Input finished and click the empty right cell.
- From the function list, choose System functions → ActivateScreen (in TIA Portal V17: System functions → Screens → ActivateScreen).
- In the function dialog, set the Screen name parameter to the name of the current screen (for example,
Screen_1). - Set the Object number parameter to
2(the tab order index of the second I/O field). - Confirm with OK.
- Repeat the same configuration for the second I/O field, but set the Object number to
1if the workflow is bi-directional, or to3if a third field exists, and so on.
When the operator scans a barcode into the first I/O field, the scanner's CR suffix causes the runtime to fire Input finished on field 1, which in turn calls ActivateScreen 'Screen_1', 2. The runtime focuses the object with tab order = 2 (the second I/O field). The focus change is what the operator perceives as 'the cursor moved to the next field.'
7. The Template Caveat: 'Tag Sequence Template'
The most common reason the Input finished event appears to be wired correctly but does not behave as expected is the use of a screen template that has been set to 'Tag sequence' mode. In TIA Portal V17, when a screen uses a template, the runtime merges the template's tag sequence with the screen's tag sequence to determine the order in which it requests values from the PLC. When the template's tag sequence is the dominant mode, the runtime cycles through the tag sequence independently of the I/O field events, producing a flow that the user perceives as 'the event never fires' or 'the field updates but the focus does not advance.'
The setting lives on the screen template (Project tree → HMI → Screen management → Templates → [your template] → Properties), not on the global screen settings. A common misdiagnosis is to open the screen itself, look at the Tag sequence panel, and see 'No tag sequence' there, while missing the template's setting that overrides it at runtime.
The fix is unambiguous:
- Open the screen template in the TIA Portal editor (Project tree → HMI → Screen management → Templates → [your template]).
- Open the template's properties (right-click → Properties).
- Locate the Tag sequence setting. Change it from 'Tag sequence' to either None or to the screen-specific tag sequence mode that does not include the fields you want event-driven.
- Recompile the HMI station and download to the panel.
After the template change, the Input finished event fires on the I/O field and the ActivateScreen call focuses the next field as configured. This is the single most frequently reported 'gotcha' in this workflow, confirmed by the original report that the hint was 'life saving.'
8. Basic Panel Limitations and Firmware Constraints
On the Basic Panel family, neither the per-field tab order index nor the Input finished event is exposed at runtime. The reason is structural: the Basic Panel firmware does not implement the same I/O field event set as Comfort Panels. The limitation persists across TIA Portal V15.1, V16, and V17 engineering environments — it is a runtime firmware feature, not an engineering-software feature. The KTP700 Basic PN with firmware 15.1 reported in the original post is a typical example.
For Basic Panels, the verified fallback paths are:
| Approach | Implementation | Trade-off |
|---|---|---|
| ValueChange event on the HMI tag | Bind each I/O field to a process tag. On the tag's ValueChange event, call ActivateScreen with the next field's tab order (or a similar no-script navigation function). | Fires on every write to the tag, including the runtime's internal resets during screen load. This is the exact issue observed in the original report. |
| PLC-mediated scanner | Connect the scanner to a PLC (S7-1200, S7-1500) through the PLC's serial, USB, or Profinet interface, parse the data plus CR in the PLC, and write the result into a dedicated PLC tag. The HMI tag mirrors the PLC tag. The ValueChange on the HMI tag is now driven by the PLC, not by the runtime's internal resets, so it is reliable. | Requires PLC code and a scanner model with a PLC-friendly interface. Adds 5–20 ms of PLC scan latency, which is negligible for operator workflows. |
| Manual touch | Operator touches the next I/O field after each scan. | Defeats the purpose of auto-tab; acceptable only in low-throughput applications. |
Example SCL snippet for an S7-1500 receiving scanner data over a serial interface (CM PtP or a CB 1241 RS-232 module). The handshake bit ScanComplete is the trigger that the HMI monitors:
// SCL: PLC-mediated scanner handler
IF 'ScannerRxBuffer'.LEN > 0 AND 'ScannerRxBuffer'.RIGHT(1) = '$0D' THEN
// Strip CR and commit
'LastScannedValue' := 'ScannerRxBuffer'.LEFT('ScannerRxBuffer'.LEN - 1);
'ScanNumber' := 'ScanNumber' + 1;
'ScanComplete' := TRUE; // rising edge -> HMI ValueChange
'ScannerRxBuffer' := ''; // clear buffer
END_IF;
Mirror LastScannedValue and ScanComplete to HMI tags through the standard HMI tag connection. The runtime's ValueChange will fire only on the rising edge of ScanComplete, not on internal resets.
Of the three options, the PLC-mediated scanner is the most robust. The ValueChange approach works but must explicitly filter out the runtime's startup writes — typically by comparing the new value to a 'last valid' buffer in a small VBScript or in a PLC-side handshake, which means it almost always ends up needing some scripting anyway.
9. Why ValueChange Fires on Reset
When an I/O field is bound to an HMI tag and the screen is opened, the runtime can issue one or more writes to the tag during screen initialization: clearing the field, restoring the last committed value, or applying a configured initial value. Each of those writes triggers the tag's ValueChange event. The same happens when the operator presses a 'Reset' button that clears the field programmatically.
The original report described this exact behaviour: 'I was able to tie a tag to the I/O Field as a process value, and then in the HMI Tag Table, select that tag and use the ValueChange event to activate the screen again with the next I/O field as the object. But this gives me issues when I'm resetting the I/O field because it sees that as a value change as well.'
The cleanest way to suppress these false triggers without a script is to route the value through a PLC tag and let the PLC detect the actual scan event. The PLC sees the scanner's CR, increments a 'scan number' counter, and writes the new value with a handshake bit. The HMI tag mirrors the PLC tag, and the ValueChange event in WinCC is only triggered by the PLC's deliberate write, not by the runtime's own internal resets.
10. Step-by-Step: Comfort Panel Implementation
The full configuration sequence on a Comfort Panel (for example, a KTP700 Comfort or a TP900 Comfort):
- In the HMI device's project tree, open the screen that contains the two I/O fields.
- From the menu bar, select View → Tab Order.
- Click the first I/O field. In the inspector pane, set Properties → Miscellaneous → Tab order to
1. - Click the second I/O field. Set its tab order to
2. - Click outside any field to deselect, then click the first I/O field again.
- In the inspector pane, switch to the Events tab.
- Locate the Input finished row, click the empty cell on the right side, and select Add function.
- From the function catalog, choose System functions → ActivateScreen.
- Set the parameters: Screen name = the name of the current screen (for example,
Screen_1); Object number =2. - Confirm with OK.
- Repeat steps 5–10 for the second I/O field, setting the Object number to
1for a two-field cycle or to3if a third field exists downstream. - If the screen uses a screen template, open the template, right-click → Properties, and confirm the Tag sequence is set to None (or at least does not include the I/O fields).
- Save, compile, and download the HMI station to the panel.
- In simulation (RT Advanced or PLCSIM Advanced with the HMI attached), open the screen and confirm that the first field is auto-focused, then enter a value, press Enter, and verify that the focus moves to the second field.
11. Verification Checklist and Troubleshooting Matrix
Before releasing the project, run the verification checklist below on the physical panel (not only in simulation) because some tab-order behaviour differs slightly between the simulator and the runtime.
| Test | Expected Result | Pass Criteria |
|---|---|---|
| Screen opens; first I/O field has focus | Caret visible in the first field | Caret present |
| Type a value with a USB keyboard, press Enter | Focus moves to the second I/O field | Caret in the second field |
| Scan a barcode with a keyboard-mode scanner configured to send CR | Focus moves to the second I/O field | Caret in the second field; process tag of the first field contains the scanned value |
| Open a 'Reset' button that clears the first field | Focus stays on the first field (it is the field that was active when the button was pressed) | Caret does not advance unexpectedly |
| Scan into the first field, then into the second, with the same scanner | Both values are written to their respective process tags; focus returns to the first field (or stays on the last field, depending on the cycle) | Both tags updated |
Common failure modes and the corresponding fixes:
| Symptom | Likely Cause | Verification | Fix |
|---|---|---|---|
| No 'Input finished' event visible in the I/O field properties | The HMI is a Basic Panel (KTP400/700/900/1200 Basic) | Devices & Networks → HMI → right-click → Change device → look at the device type | Use a Comfort Panel, or switch to the ValueChange + PLC approach described in Sections 8 and 9 |
| Input finished is wired, but focus does not advance | Screen template is set to 'Tag sequence' | Open the screen template → Properties → Tag sequence | Set the template's Tag sequence to None, recompile, redownload |
| Input finished is wired, but ActivateScreen does not focus the second field | Object number does not match the second field's tab order index | View → Tab Order, read the number on the second field | Set the ActivateScreen Object number to that index |
| Focus advances on the first scan, but later scans do not | Scanner's suffix is disabled (suffix = None) or has been overwritten by a configuration reset | Scan the suffix configuration barcode from the scanner's product reference guide; rescan a known barcode in Notepad and observe whether Enter is appended | Reconfigure the scanner's suffix to CR (or TAB if the application specifically requires it) |
| Focus advances twice — once on the first field, once on the second, even though only one scan was performed | Scanner is sending CRLF; CR fires Input finished on field 1, LF fires Input finished on field 2 | Notepad test: scan a barcode, count the number of newlines | Configure the scanner's suffix to CR only (no LF) or TAB only |
| Input finished fires twice in rapid succession (focus advances twice within 50 ms) | Scanner is in 'inter-scan delay' / double-trigger mode and fires twice on the same barcode | Watch the HMI tag trace during a single scan; count Input finished occurrences | Increase the scanner's inter-scan delay, or disable double-trigger in the scanner's configuration |
| Field updates correctly, but the cursor disappears after the focus change | The target field's visibility expression evaluates to false on focus, or the field's Mode is 'Output' only | Open the target field's Properties → Appearance → Visibility and Properties → General → Mode | Set visibility to constant true and Mode to 'Input/Output' |
| Focus advances, but the value is not committed to the process tag | The I/O field's 'Process value' tag is not the same tag that the PLC is reading, or the field's 'Mode' is set to 'Output' instead of 'Input/Output' | Open the I/O field's Properties → General → check Mode and the process value binding | Set the I/O field's Mode to 'Input/Output' and confirm the process value is wired to the correct tag |
| ValueChange approach fires when the screen opens (the operator sees the focus jump to field 2 immediately) | Runtime is writing to the tag during screen initialization, triggering ValueChange | Use an HMI tag trace to log all writes to the tag during a screen-open cycle | Route the tag through a PLC handshake, or switch to a Comfort Panel and use Input finished |
12. FAQ
Why does my I/O field not show the 'Input finished' event in TIA Portal V17?
The 'Input finished' event is only exposed on Comfort Panels and WinCC Runtime Advanced. The Basic Panel family (KTP400 Basic, KTP700 Basic PN, KTP900 Basic, KTP1200 Basic) only exposes Activate and Deactivate on the I/O field. Check the device type under Devices & Networks → HMI → [your HMI] → Device view. To use Input finished, change the HMI to a Comfort Panel (for example, KTP700 Comfort or TP900 Comfort). On a Basic Panel, use the PLC-mediated ValueChange approach described in Section 8.
I wired Input finished to ActivateScreen, but the focus does not move. What is the most common cause?
In most reported cases the cause is the screen template's 'Tag sequence' setting. Open the screen template, right-click → Properties, and set the Tag sequence to None. Recompile and redownload. After the change, the Input finished event fires and the ActivateScreen call focuses the next field as configured.
Does the HMI firmware version (for example, 15.1 on a KTP700 Basic PN) limit the available events?
Yes, but for Basic Panels the limitation is structural: the Basic firmware does not expose Input finished or per-field tab order regardless of the engineering version. The firmware 15.1 reported in the original post is the most recent firmware for the KTP700 Basic PN and does not add the missing events. To use the non-script auto-tab workflow, switch to a Comfort Panel or use the PLC-mediated ValueChange fallback.
Can I configure ActivateScreen to focus an object that is not on the same screen as the calling field?
Yes. ActivateScreen is designed primarily for screen-to-screen navigation. The Screen name parameter accepts any screen in the project. The Object number parameter is the tab order index of the target object on that screen, or 0 to focus no object. For a same-screen auto-tab, set Screen name to the current screen and Object number to the next field's tab order index.
Why does the focus advance on the first scan but not on subsequent scans?
Most often the scanner's suffix has been disabled or the scanner was factory-reset between scans. Scan the suffix configuration barcode from the scanner's product reference guide (for example, the Zebra DS9208 Product Reference Guide or the Honeywell MetroSelect Configuration Guide) to re-enable the Enter (CR) suffix. Verify in Notepad that each scan produces a value followed by a newline.