WinCC I/O Field: Display INTEGER as Decimal REAL in TIA Portal
1. Problem Overview
Field instrumentation and SIMATIC S7-1200/S7-1500 user programs frequently deliver process values as 16-bit or 32-bit integers where the least-significant digit already encodes the engineering resolution. A temperature transmitter scaled to 0.1 °C/count produces 1234 for 123.4 °C, a pressure transmitter produces 10132 for 1013.2 hPa, and a flow meter produces 1230 for 123.0 l/min. PLC programmers routinely guard the FB interface with INT or DINT tags because integer math is faster, deterministic, and avoids the 32-bit boundary issues that creep into REAL operations on S7-1200 firmware ≤ V4.2.
The operator, however, must read 123.4 °C, not 1234. Re-writing the PLC block to perform the divide-by-10 conversion is undesirable because:
- The PLC code is shared across multiple stations with different display conventions.
- Audit / validation of the safety-relevant FB must not be re-opened just to move a decimal point.
- The same raw integer is consumed by trending, archiving, and the SCADA layer where it must remain unscaled.
- PLC cycle time is reserved for I/O scanning, not display formatting.
This reference documents every supported method to render an INT/DINT/WORD process tag with a configurable decimal separator inside a WinCC I/O field, covering Basic Panels, Comfort Panels, RT Advanced, RT Professional, and WinCC Unified, on TIA Portal V14 SP1 through V20.
2. Prerequisites
| Item | Requirement |
|---|---|
| Engineering tool | SIMATIC STEP 7 / TIA Portal V14 SP1, V15, V15.1, V16, V17, V18, V19, or V20 (Basic, Comfort, Professional, or Unified PC) |
| HMI runtime | WinCC RT Advanced, WinCC RT Professional, or WinCC Unified V16+ |
| Panel | SIMATIC Basic Panel (KTP400 mono … KTP1200), Comfort Panel (TP700 … TP2200), IPC with RT Advanced, IPC with RT Professional, or Unified Comfort Panel (MTP700 … MTP2200) |
| PLC tag | DB member or process tag of type INT, DINT, or WORD
|
| HMI tag license | For RT Professional / Unified: a script-enabled runtime license (no PowerTag restriction) |
| Optional | PowerTag for internal REAL variable when the script method is used |
3. Method 1 — Linear Scaling on the HMI Tag
The fastest method requires zero PLC change and keeps the HMI tag as an integer in the engineering view.
3.1 Procedure
- In the TIA Portal project tree, expand HMI Tags and double-click the tag that is bound to the I/O field.
- Switch to the Properties inspector and open Properties > Value (or the older "Scaling" group on V14 SP1).
- Enable Linear scaling.
- Set PLC end value and HMI end value such that the ratio produces the desired display range. Example for a 0–1000 PLC count mapped to 0–100.0 °C display:
PLC start value : 0 PLC end value : 1000 HMI start value : 0.0 HMI end value : 100.0 - Compile and download the HMI station. The I/O field still binds an integer but the value bar and the formatted output use the scaled real range.
3.2 Limitations
- The HMI tag remains of type
INT/DINT. Display is rounded unless the receiving I/O field adds a decimal place (see Method 3). - Trends and archives store the raw integer, not the scaled real — verify downstream consumers.
- Linear scaling applies to value-bar / gauge widgets but does not produce a literal "12.3" string on its own.
4. Method 2 — Re-Type the HMI Tag as REAL
Switching the HMI tag data type forces the runtime to convert the integer to a 32-bit IEEE-754 float at the HMI boundary. No PLC change is required.
4.1 Procedure (TIA Portal V14 SP1 – V18)
- Open the HMI tag editor.
- Select the integer tag bound to the I/O field.
- In the General column, change HMI Type from
Int/DInt/WordtoReal. - Confirm the connection. The PLC address is preserved; only the HMI-side representation changes.
- Open the I/O field on the screen and set Format > Display format > Decimal (RT Advanced/Professional) or set Decimal places = 1 (Comfort Panels).
- Compile and download.
4.2 Procedure (WinCC Unified, TIA Portal V16 – V20)
- Open the Unified HMI tag editor and select the integer tag.
- Under Properties, change Data type to
Float32(or the older synonymReal). - Open the screen and select the I/O field. In the Properties pane under Format, enable Decimal places and set DecimalPlaces = 1.
Real but the PLC tag is INT, the runtime performs an implicit widening conversion every cycle. On a Comfort Panel this is harmless; on RT Professional with a 1 kHz scheduled task multiplied by 2 000 tags, budget approximately 0.4 % CPU per 100 conversions.5. Method 3 — Comfort Panel "Decimal Places" Property
Comfort Panels (TP700, TP900, TP1200, TP1500, TP1900, TP2200) and Unified Comfort Panels (MTP series) expose a property that visually shifts the decimal separator inside an integer value without changing its type or its source. This is the cleanest answer for the original TIA V14 SP1 Professional scenario.
5.1 Procedure
- Open the screen containing the I/O field.
- Select the I/O field. In the Properties > General pane, scroll to Representation / Format.
- Set Decimal places to the number of fractional digits you want to display (1 for "12.3", 2 for "1.23", etc.).
- Verify the value in the simulation: a PLC value of
123displays as12.3with one decimal place. - Compile and download to the panel.
5.2 Field-Proven Behaviour
- Range checking respects the original integer limits — a 16-bit signed integer still clamps at ±32 767.
- If the user enters "12.3" on the panel, the integer tag stores
123. The fractional part is preserved only on display; lossless round-trip is achieved. - The decimal separator follows the project language (comma in DE/FR/IT, dot in EN/US). Use Project > Languages > Decimal separator to override.
6. Method 4 — Script + Scheduled Task (RT Professional / Unified)
When the I/O field sits on an RT Professional PC or a Unified PC runtime and no native decimal-places property is available, a tiny scheduled VBS / JavaScript converts the integer into an internal REAL.
6.1 RT Professional (VBScript)
' Scheduled task body - runs every 1000 ms
Dim iVal : iVal = SmartTags("Temp_RAW_INT")
SmartTags("Temp_HMI_REAL") = iVal / 10.0
6.2 Procedure
- Create an internal HMI tag
Temp_HMI_REALof typeReal. - Create a new scheduled task: RT Professional > Scheduled Tasks > Add new.
- Set trigger = Cyclic, 1 s. Set action = VBScript action.
- Paste the script from §6.1. Replace tag names with your project names.
- Bind the I/O field to
Temp_HMI_REALinstead ofTemp_RAW_INT. - Set the I/O field Format property to Decimal with one decimal place (see §7).
6.3 WinCC Unified (JavaScript)
// Scheduled task - 1 s
let raw = Tags("Temp_RAW_INT").Read();
Tags("Temp_HMI_REAL").Write(raw / 10.0);
6.4 Why Schedule Rather Than a Direct Tag Formula?
Unified does not support tag-side expressions between an Int and a Real in a single step. The scheduled script is the lowest-overhead workaround and gives a deterministic 1 Hz update without flooding the tag log.
7. Method 5 — RT Professional I/O Field "Format" Property
The RT Professional runtime distinguishes decimal, binary, hexadecimal, date/time, and string output formats on the I/O field itself. Reference: I/O field: Format (RT Professional) — TIA Portal V20 documentation.
7.1 Procedure
- Select the I/O field on the screen.
- Open Properties > General > Format.
- Set Output format = Decimal.
- Set Display signed or unsigned depending on the integer range.
- Bind the I/O field to a
Realtag (Method 2) or to a script-scaled REAL tag (Method 4). Set Decimal places = 1.
7.2 Supported Format Tokens
| Format | Result for input 1234 | Use case |
|---|---|---|
| Decimal, signed, 1 dp | 123.4 | Temperature / pressure / flow scaled by 10 |
| Decimal, signed, 2 dp | 12.34 | Voltage scaled by 100 |
| Decimal, unsigned, 0 dp | 1234 | Counters (default) |
| Hexadecimal | 4D2 | Diagnostics |
| Binary | 10011010010 | Bit-field diagnostics |
| String | 1234 (as text) | Barcode / serial |
8. Method 6 — WinCC Unified V19/V20 Integer-as-Decimal Procedure
Siemens Knowledge Base article 109816808 — WinCC Unified: Display integer value in an I/O field with decimal places documents the canonical Unified workflow.
- Create (or reuse) a variable of type Integer — supported types are
Int,DInt,Word,DWord, and the unsigned equivalents. - Place an I/O field on the screen and bind it to the integer variable.
- Select the I/O field and open Properties > Format.
- Enable Decimal places and choose how many fractional digits to render (1 for "12.3", 2 for "1.23", …).
- Compile the HMI and start the Unified runtime. The integer is rendered with the configured separator at runtime.
9. Method Comparison
| Method | PLC change | Runtime change | Round-trip safe | Panels supported | CPU cost |
|---|---|---|---|---|---|
| 1 Linear scaling on tag | No | Tag properties | Partial (display only) | All | Negligible |
| 2 Change HMI tag type | No | Tag + I/O field | Yes | All | Low (implicit cast) |
| 3 Comfort decimal-places property | No | I/O field only | Yes | Comfort / Unified Comfort | None |
| 4 Script + scheduled task | No | Tag + script + task | Yes | RT Professional / Unified PC | Medium (depends on period) |
| 5 RT Professional Format | No | I/O field only | Yes | RT Professional | None |
| 6 Unified decimal places (KB 109816808) | No | I/O field only | Yes | Unified V17 – V20 | None |
10. Verification Procedure
- In TIA Portal, click Start simulation on the HMI station (or Online > Start Runtime for RT Professional).
- Force the integer tag with the PLCSIM watch table to a known value (e.g.,
1234). - Confirm the I/O field displays
123.4with one decimal place and the comma/dot separator matches the project language. - Enter
567.8in operator-input mode and read back the integer tag — it must hold5678. - Trigger an out-of-range value (e.g.,
65535for a 16-bit tag with two decimals). Verify the field shows655.35, not a wrap-around. - If using Method 4, open the scheduled-task log and confirm the script fired at the configured interval.
11. Troubleshooting Matrix
| Symptom | Likely cause | Remedy |
|---|---|---|
| I/O field shows "1234" with no decimal | Decimal places not set or panel class does not support it | Set Decimal places = 1 (Comfort / Unified) or use Method 2/4 on Basic / RT |
| Field shows "#####" | Value too large for the configured field width | Increase the field width in characters or reduce decimal places |
| Field shows decimal but value rounded | Method 1 (linear scaling) only — display is still INT | Switch to Method 2, 3, 5, or 6 |
| Script method: tag stuck at 0 | Scheduled task not started or disabled | Verify task is enabled in runtime; check for compile errors |
| Decimal separator wrong language | Project language locale override | Project > Languages > Decimal separator, or use a custom format string |
| Operator enters "12.3" but PLC stores 12 | Integer truncation on write — expected behaviour | Round-trip preserves the integer; document for operators |
| Compile warning: type mismatch | HMI tag is REAL, PLC tag is INT | Expected — the runtime performs an implicit cast; warning can be hidden |
| RT Professional shows "0,0" | Internal REAL tag not created as PowerTag | Ensure the internal tag is created with PowerTag option for cross-screen visibility |
12. Frequently Asked Questions
How do I show an integer like 1234 as 123.4 in a WinCC I/O field without changing the PLC?
On a Comfort or Unified Comfort Panel, select the I/O field, open Properties > Format, set Decimal places = 1, and download. The field renders 1234 as 123.4 without any PLC, tag, or script change.
Does the TIA Portal Basic edition expose the decimal-places property?
No. The decimal-places shift is a Comfort, Advanced, Professional, and Unified feature. On Basic Panels (KTP series) the I/O field only formats integers and you must change the HMI tag type to Real (Method 2) or pre-scale the value in the PLC.
Can I keep the underlying tag as INT and still display decimals on RT Professional?
Yes. Use the scheduled-script approach: create an internal Real tag, schedule a 1 Hz VBScript SmartTags("RealTag") = SmartTags("IntTag") / 10, and bind the I/O field to the Real tag with Output format = Decimal and one decimal place.
What TIA Portal versions support the WinCC Unified decimal-places workflow?
The workflow documented in Siemens KB 109816808 applies to WinCC Unified V17 through V20. The property label changed from "Decimal digits" (V17) to "Decimal places" (V19/V20). Both behave identically at runtime.
Will the operator lose precision when typing 12.3 into a decimal-places I/O field bound to an INT tag?
No. The panel writes the value multiplied by 10 (i.e., 123) back to the PLC integer tag. The decimal separator is purely a display and entry convenience — round-trip is lossless up to the integer range (±32 767 for 16-bit, ±2 147 483 647 for 32-bit).