1. Problem Statement and Use Case
Many HMIs must translate a small set of numeric state indices coming from the PLC into a human-readable text label. A typical example: a machine exposes a single INT tag called ModeIndex with values 0..4, and the operator must see PARALLEL, SERIAL, SHUNTED, KILLED, or ALIVE on the screen, plus change the color of the indicator accordingly. Building six overlapping text boxes with visibility animation works but is fragile, language-locked, and painful to maintain.
Siemens TIA Portal / WinCC provides a first-class object for exactly this pattern: the Text list. Combined with a Symbolic I/O field, one HMI tag drives the entire text and color chain. This article shows every working method, the trade-offs, the PLC code required to set the index, and the panel-level limits you must respect when commissioning.
2. Prerequisites
| Item | Requirement |
|---|---|
| Engineering tool | SIMATIC TIA Portal V17 / V18 / V19 (WinCC Comfort, Advanced, or Professional) |
| Runtime | WinCC Runtime Advanced or Professional on a TP, KTP, Comfort, or WinCC RT PC target |
| Controller | Any S7-1200, S7-1500, ET 200SP, or S7-300/400 with an HMI connection configured |
| PLC tag type |
INT or DINT (signed) for the index; WORD / BOOL also supported on some objects |
| HMI tag type | Internal or external tag of type Int (range depends on the text list, see limits) |
| Licensing | WinCC Comfort/Advanced license already active on the panel; no extra option required for text lists |
3. Method 1 - Text List with Symbolic I/O Field (Recommended)
This is the canonical Siemens pattern. One HMI tag drives one text list, and the Symbolic I/O field renders the entry that matches the current value.
3.1 Create the HMI tag
- In the TIA Portal project tree, open HMI Tags → double-click Default tag table (or your custom table).
- Add a new tag, e.g.
ModeIndex, of data typeInt. - Set the Connection to the S7 PLC, leave the address in symbolic form if your PLC uses symbolic tags, or enter the absolute address, e.g.
%DB5.DBW0for a data block word. - Acquisition cycle: 1 s is fine for a mode display; raise to 100 ms if the index toggles during hand-shake transitions.
3.2 Create the Text List
- In the project tree, expand HMI → Text and graphics lists → double-click Text lists.
- Click Add new, name it e.g.
ModeList. - Set the List range to Bit (0/1) for boolean fields or Value/Range for integer states. For 0..4 you must use Value/Range.
- Set Default entry (shown when the tag value is out of range) - typically
???orINVALID. - Populate the entries as in the table below.
| Value / Range | Display text (default language) | Optional: text in 2nd language | Color (per entry) |
|---|---|---|---|
| 0 | PARALLEL | PARALLEL | Green |
| 1 | SERIAL | SERIE | Blue |
| 2 | SHUNTED | UEBERBR. | Gray |
| 3 | KILLED | ABGESCH. | Red |
| 4 | ALIVE | AKTIV | Yellow |
Each row can carry a background and foreground color. The color is selectable from the list editor; it is consumed by the Appearance dynamization of any object that is linked to the text list.
3.3 Place a Symbolic I/O Field on the screen
- Open the desired screen, drag a Symbolic I/O field from the toolbox onto the canvas.
- In the properties → General, set:
- Mode = Output (read-only) or Input/Output if the operator can change mode from this field.
-
Tag =
ModeIndex(HMI tag). -
Text list =
ModeList.
- Configure the field: appearance, font, border, and field length so the longest entry fits (count characters including the longest word in the active language).
At runtime the Symbolic I/O field now shows PARALLEL when the PLC writes 0, SERIAL when it writes 1, and so on. If the operator clicks the field, an input popup opens listing all values so the operator can select one - WinCC writes the chosen value back to the PLC tag.
3.4 Why this is the right answer
- One tag, one object - no per-state text boxes, no overlapping z-order issues.
- Multi-language - each list entry stores up to 32 languages. Switching the HMI runtime language on the panel updates the field automatically.
- Consistent colors - colors are part of the list entry, so multiple screens referencing the same list are visually identical.
-
Audit-friendly - operators can pick the mode from a list, no risk of typing
2when they meant20.
4. Method 2 - Pure Read-Only Text Field with a String Tag
If you want absolute control over the displayed text - including dynamic concatenation with other values - skip the text list and let the PLC build the final string.
4.1 PLC side (SCL, S7-1500)
// FB "ModeTextBuilder"
CASE #iMode OF
0: #sModeText := 'PARALLEL';
1: #sModeText := 'SERIAL';
2: #sModeText := 'SHUNTED';
3: #sModeText := 'KILLED';
ELSE
#sModeText := 'ALIVE';
END_CASE;
// Optional: append live diagnostics
#sModeText := CONCAT(STRING_TO_WSTRING(#sModeText),
WSTRING#' I=' + INT_TO_WSTRING(#iCurrent));
4.2 HMI side
- Create a tag
ModeTextof typeWString[254](WString is required for Unicode and is the default on TIA V17+). - Place an I/O field in Output mode and assign the
ModeTexttag. - Set Output format to
Stringand disable input.
WString tags in cyclic continuous acquisition if the string is rebuilt on every PLC scan - use a change-trigger (edge bit) on the PLC side.5. Method 3 - Color and Visibility Animation per State
When a text list is unavailable (e.g. Basic Panel) or you need extra graphical effects (icon swap, blinking), you can still animate a Rectangle or Symbolic I/O field through a Tag-based or PLC-controlled animation.
5.1 Color dynamization on a Symbolic I/O field
- Select the field, open Properties → Appearance → Background color.
- Click the small dynamization icon and add an PLC-controlled animation with up to 10 ranges:
| Range | Color | Trigger value of ModeIndex
|
|---|---|---|
| 0..0 | Green | 0 (PARALLEL) |
| 1..1 | Blue | 1 (SERIAL) |
| 2..2 | Gray | 2 (SHUNTED) |
| 3..3 | Red | 3 (KILLED) |
| 4..4 | Yellow | 4 (ALIVE) |
| Default | Black | outside ranges |
5.2 Visibility of stacked labels
For a 5-state panel, place five text boxes (one per state), each with a visibility animation on the same ModeIndex tag:
- Text "PARALLEL" visible when 0 ≤ ModeIndex ≤ 0
- Text "SERIAL" visible when 1 ≤ ModeIndex ≤ 1
- ... and so on.
6. Method 4 - Tag Value Inside Alarm / Event Text
When the requirement is "show the current mode inside an alarm line" rather than on a screen, TIA Portal lets you embed a tag value as a placeholder in the alarm text. Siemens documents this workflow in the official support entry How do you output a tag value in the alarm text on WinCC (TIA Portal)? The procedure is:
- Open HMI alarms → Discrete alarms (or Analog alarms) and create the alarm.
- Place the cursor in the Event text at the position where the mode should appear.
- Right-click → Insert tag output field.
- Pick the
ModeIndextag, choose the format (Decimal for the raw value, Text + text list ModeList for the human label).
The alarm line then prints, e.g., "Unit switched to PARALLEL (index=0) at 12:43:07". This is invaluable for diagnostics, logbook export, and trending.
7. Driving the Index Tag from the PLC
All four methods above require that the PLC writes a valid integer to ModeIndex. The cleanest pattern is an FB that owns the mode transitions and exposes one ModeIndex output to the HMI tag table.
7.1 SCL implementation (S7-1500)
FUNCTION_BLOCK "FB_ModeController"
VAR
bInit : BOOL := TRUE;
END_VAR
BEGIN
// Latch mode on rising edge of the source flags
IF #bParallel AND (#iMode <> 0) THEN
#iMode := 0; // PARALLEL
ELSIF #bSerial AND (#iMode <> 1) THEN
#iMode := 1; // SERIAL
ELSIF #bShunted AND (#iMode <> 2) THEN
#iMode := 2; // SHUNTED
ELSIF #bKilled AND (#iMode <> 3) THEN
#iMode := 3; // KILLED
ELSIF (#iMode <> 4) THEN
#iMode := 4; // ALIVE (default / no trip)
END_IF;
// Output mirrors the index for HMI polling
#iModeIndex := #iMode;
END_FUNCTION_BLOCK
7.2 Ladder (FBD/ST) equivalent
| bParallel iMode<>0 |
--| |------|/|---------( S )-- iMode := 0 (PARALLEL)
| bSerial iMode<>1 |
--| |------|/|---------( S )-- iMode := 1 (SERIAL)
| bShunted iMode<>2 |
--| |------|/|---------( S )-- iMode := 2 (SHUNTED)
| bKilled iMode<>3 |
--| |------|/|---------( S )-- iMode := 3 (KILLED)
7.3 Resetting on operator action
If the operator selects a new mode from the Symbolic I/O field, the runtime writes the chosen Int back to the PLC tag. Ensure the PLC uses that value as the new authoritative state, e.g. by adding a cyclic move from the HMI tag to the controller's mode variable:
// Cyclic OB1
"DB_Mode".iMode := "HMI".ModeIndex;
ModeIndex from both the PLC (auto-mode) and the HMI (manual-mode) in the same cycle. Use a mode-source bit in the controller to gate writes, or split into two tags (ModeIndexAuto / ModeIndexMan) and a single ModeIndex for display.8. Multi-Language Text Lists
WinCC supports up to 32 project languages. For a text list:
- Open Project → Languages → Add language and pick the target language (e.g., German, French).
- Open the text list
ModeList- a column appears for each language. - Translate each row. The PLC tag is language-agnostic, only the displayed string changes.
- Set the Runtime language on the panel in Control Panel → Language or programmatically via the
SetLanguagesystem function.
Symbolic I/O fields, alarm text, and event text all consume the same text list entry, so a single translation effort updates the entire HMI. See the TIA Portal help section Working with multi-language projects for a list of supported export formats (XLIFF, CSV) used for translator round-trips.
9. Limits, Performance, and Licensing
| Parameter | Limit | Source / panel |
|---|---|---|
| Entries per text list | 1000 (Comfort and up) | WinCC Comfort manual |
| Number of text lists per project | limited by panel memory; typical > 1000 | TP700 / TP1500 Comfort |
| Languages per text list entry | 32 | WinCC Engineering |
| Acquisition cycle (HMI tag) | 100 ms minimum recommended | TP1500 Comfort, WinCC RT PC |
| String tag length |
WString up to 254 chars, String up to 254 chars |
Comfort/Advanced/Professional |
| PLC writes per second on Symbolic I/O | Unlimited; the bottleneck is the HMI acquisition cycle | Engineering guideline |
| Text list support on Basic Panels | Not available | KTP Basic series |
For WinCC Professional / WinCC RT PC you can also bind a text list directly to a DB field using the new WinCC Unified scripting API (HMIRuntime.Tags), but the principle - integer value drives text and color - stays the same.
10. Verification and Commissioning
- Compile the HMI project (TIA Portal → right-click HMI device → Compile). Zero warnings expected.
- Start the simulator (Start runtime) and, in PLCSIM, force
ModeIndexto 0..4 in turn. Confirm the field updates within one acquisition cycle. - Force a value outside the list range (e.g. 99). Confirm the Default entry appears - this proves the fallback is wired correctly.
- Change the panel runtime language to German and verify the second-language column is rendered.
- Click the Symbolic I/O field, select a different value from the popup, and confirm the PLC tag is written back. Trace with a watch table.
- Cycle power to the panel; confirm the value is re-read from the PLC at startup, not retained locally (HMI tags have configurable Retain behavior - disable for mode index).
11. Troubleshooting Matrix
| Symptom | Likely cause | Fix |
|---|---|---|
| Field always shows the default entry | Text list not assigned to the Symbolic I/O field, or HMI tag is offline | Properties → General → Text list = ModeList; check connection in Connections editor |
| Field shows the raw integer (e.g. "2") | Symbolic I/O field is configured as numeric output, not text list | Set Mode = Output and assign the text list, or change Output format to Text |
| Color does not change | Color was set on the object, not the list entry, or appearance is overridden by a theme | Open the text list, set per-row color, then re-compile |
| Only English is shown on the panel | Second-language column is empty in the text list | Open ModeList, fill the DE / FR column, recompile, transfer to panel |
| Operator can pick value 99 from the dropdown | List is bound to a range, not a discrete value set | Add explicit Value/Range rows (0, 1, 2, 3, 4) and mark default as <not used> |
| Display flickers | Acquisition cycle too fast or PLC writes on every scan | Raise HMI cycle to 500 ms; use a change-trigger on the PLC side |
| Alarm text prints the index, not the label | Insert tag output field uses Decimal formatChange the output field to Text + select the text list | |
| Text list editor is greyed out on a KTP Basic | Basic Panels do not support text lists | Upgrade to a Comfort Panel, or fall back to Method 3 (visibility animation) |
12. Comparison of Methods
| Method | Multi-language | Operator input | Color per state | Basic Panel | Engineering effort | Runtime cost |
|---|---|---|---|---|---|---|
| Text list + Symbolic I/O | Yes (built-in) | Yes (dropdown) | Yes (per row) | No | Low | Lowest |
| WString tag + I/O field | PLC must translate | No (read-only) | Manual animation | Yes | Medium | Medium (string xfer) |
| Visibility animation per state | Manual per label | No | Manual per label | Yes | High | Low |
| Alarm text with tag output | Yes (alarm texts) | No | Alarm color rules | Limited | Low | Low (event-driven) |
For the use case of one PLC integer driving one operator label, Method 1 (Text list + Symbolic I/O field) wins on every axis. Reach for Method 2 only when the displayed text must embed other live data, and for Method 3 only when the panel cannot be upgraded from a Basic to a Comfort target.
What is the simplest way to show different text for each value of a Siemens HMI tag?
Create a Text list in the HMI project (HMI → Text and graphics lists → Text lists), add one row per state with the matching value (0..4) and the operator string ("PARALLEL", "SERIAL", ...), then place a Symbolic I/O field on the screen with Mode = Output, Tag = the HMI integer tag, and Text list = the new list. The runtime will render the row whose value matches the tag.
Do Basic Panels (KTP400/700/1200 Basic) support text lists?
No. KTP Basic and KP Basic panels do not expose a Text list editor. Use stacked text boxes with a visibility animation on the integer tag, or upgrade to a Comfort panel (TP700 / TP900 / TP1200 / TP1500) where text lists are a native object.
How can I change the background color of the label automatically with the state?
Open the text list, click the per-row color picker and set a background color for each entry. The Symbolic I/O field consumes that color at runtime. For finer control, add a PLC-controlled color animation on the field and bind it to the same integer tag with up to 10 ranges.
How do I show the current state inside an alarm line?
Open the alarm, place the cursor in the Event text, right-click and select "Insert tag output field", pick the integer tag, and choose format "Text" + the text list. TIA Portal prints the human label rather than the raw integer. Siemens documents this workflow in the support entry 109747174.
Can the operator pick the mode from the same field that displays it?
Yes. Set the Symbolic I/O field to Mode = Input/Output. At runtime the operator taps the field, a popup lists every value defined in the text list, and selecting one writes the integer back to the PLC tag. The PLC FB should then treat that tag as the new authoritative mode and re-emit it on the next cycle.