Displaying and Entering Double Values in WinCC IO Fields

David Krause11 min read
SiemensTutorial / How-toWinCC
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

WinCC Comfort, WinCC Professional, and WinCC Unified all support the IEEE 754 64-bit floating-point type (commonly called double, float64, or in TIA Portal "Floating-point number 64 bit IEEE 754"). The full theoretical range is approximately -1.7976931348623157e+308 to +1.7976931348623157e+308, with a mantissa resolution of 15 to 17 significant decimal digits. The challenge addressed in this article is mapping the entire displayable and editable range of a WinCC tag onto an HMI object — typically an I/O Field — while still allowing the operator to read and write values such as 12345678912345, 99999999.44444444444, or 1010101010101010101010.4 without losing precision in the lower-order digits.

Typical drivers for this requirement are the Trend Control properties ValueAxisBeginValue and ValueAxisEndValue, which are exposed as double-typed configuration properties and accept values in the order of ±1e307. Operators need a side panel (rather than the inline editor) to re-scale the axis without opening the Trend Control configuration dialog.

Scope of this article: the configuration patterns below apply to WinCC Comfort/Advanced (TIA Portal V15-V20) and WinCC Unified (V16-V20). Where the RT Unified object model differs from the classic RT Professional / Comfort object model, the differences are called out explicitly.

IEEE 754 Double-Precision Background

Before configuring the HMI object, lock down the numerical constraints imposed by the underlying data type. A 64-bit IEEE 754 double is encoded as:

  • 1 sign bit
  • 11 exponent bits (biased by 1023, range -1022 to +1023)
  • 52 mantissa bits (53 bits of precision including the implicit leading 1)
Parameter Value
Smallest positive normal 2.2250738585072014e-308
Largest positive finite value 1.7976931348623157e+308
Smallest positive subnormal 4.9406564584124654e-324
Machine epsilon (2-52) 2.220446049250313e-16
Decimal digits guaranteed exact 15
Decimal digits maximum round-trip 17
Trend Control axis limits (WinCC) ±1.0e+307
I/O Field default limits (WinCC) ±1.0e+308

The practical consequence: a value such as 99999999.44444444444 cannot be stored exactly. The closest representable double is 99999999.4444444477558135986328125, which is what the runtime hands back to the IO Field. If the configured output format is 99999999999999,99999999999999 (14 integer + 14 fractional digits), the value rendered is 99999999.44444444800000. Operators viewing the screen will see a value that differs from what they typed if more than 15 significant digits are entered.

Prerequisites

  1. TIA Portal V15.1 or later — V16 or later is required for the 64-bit floating-point tag type with full WinCC Unified support; V17/V18/V19/V20 are all field-current.
  2. WinCC Comfort/Advanced or WinCC Unified runtime license sufficient for the configured screens.
  3. A HMI tag of data type "Floating-point number 64 bit IEEE 754" created in the HMI tag table. The PLC side (S7-1200/S7-1500) tag may also be LReal (64-bit).
  4. An active Trend Control on the screen (or any double-typed property you want to drive) so that the IO Field has a meaningful target.
  5. Engineering access to the screen where the IO Field will be placed; runtime must be in "Stop" or in the configuration client.

Step-by-Step: Configure an IO Field for Double Display and Entry

Step 1 — Create or Re-use a 64-Bit Tag

  1. In the project tree, open PLC tags or HMI tags and create a new tag.
  2. Set Data type to Floating-point number 64 bit IEEE 754 (TIA displays this as LReal when mirrored from the PLC, or as Double in the HMI tag table).
  3. Confirm the address points to a double-precision location (e.g. %MD100 on S7-1500 consumes 8 bytes, not 4).

Step 2 — Place the I/O Field on the Screen

  1. Open the target screen in the WinCC screen editor.
  2. From the toolbox, drag an I/O Field onto the canvas.
  3. In the properties pane, under General > Tag, bind the I/O Field to the tag from Step 1.
  4. Set Mode to Input/output if operators must both read and write the value, or to Output if the value is only displayed.

Step 3 — Configure the Output/Input Format

WinCC uses a positional numeric format string (not C-style %f or %g). Each 9 reserves a digit position, each 0 reserves a digit position and forces a leading zero, and the decimal separator is the locale-aware , (German) or . (US English) — confirm with Project > Language & Runtime Settings > Number format.

Use case Format string Sample input Displayed value
Plain integer up to 14 digits 99999999999999 12345678901234 12345678901234
14 integer + 14 fractional 99999999999999,99999999999999 99999999.44444444444 99999999.44444444800000 (rounded at the 15th significant digit)
Scientific when the number is large 9,99999999999999e+999 1.01e+20 1,01000e+0020
Forced-decimal fixed precision 9999999999,0000000000 0.000000000123 0,0000000001 (rounded down)
Signed value with leading sign +99999999999999;-99999999999999 -42 -42

For the common Trend-Control axis requirement (full double range, mixed magnitudes), use the 14/14 split:

Output format:  99999999999999,99999999999999
Input format:   the same string is used as the input mask; the runtime
                parses decimal, scientific (1e10), and signed input
                within the limits of the I/O field's Min/Max properties.

Step 4 — Set Min/Max Limits to the Double Range

  1. In the IO Field properties, open Limits > Min and set the value to -1.7976931348623157e+308 (or simply -1E+308 — the field accepts scientific notation).
  2. Set Limits > Max to 1.7976931348623157e+308.
  3. Optionally tick Apply limit value on invalid input so the runtime clamps out-of-range entries instead of rejecting the input event.
Trend Control quirk: the Trend Control property editor in WinCC Comfort/Advanced accepts axis values up to ±1.0e+307, not ±1.0e+308. If you set the I/O Field to ±1.0e+308 and the operator enters 9.9e+307, the value is accepted by the I/O Field but the Trend Control will silently clamp it. Use ±1.0e+307 on both objects to keep them in sync.

Step 5 — Link the IO Field to the Trend Control

  1. Select the Trend Control on the same screen.
  2. In Properties > Trend > ValueAxisBeginValue, click the binding icon and select PLC/HMI tag; bind it to the same 64-bit tag.
  3. Repeat for ValueAxisEndValue if you want both ends operator-adjustable; otherwise bind the second I/O Field to a second tag.
  4. For the y-axis in WinCC Unified, the property is ValueAxis.BeginValue / ValueAxis.EndValue on the trend view's TrendArea object.

Step 6 — Configure the Decimal Places the Operator Can Type

The IO Field does not allow an arbitrary number of decimal places at runtime. The format string caps the count of fractional digits the operator can enter:

  • Format 99999,99 → operator can type at most 2 fractional digits.
  • Format 99999,99999999999999 → operator can type at most 14 fractional digits.

If the operator types a value with more fractional digits than the format string allows, the runtime truncates (does not round) the excess from the right. Choose a format that matches the meaningful precision of the underlying process value; for axis scaling, 2-4 fractional digits is usually sufficient.

WinCC Unified: Defining the Output Format

WinCC Unified V17+ uses a slightly different output-format model. The screen-object properties dialog exposes a Format field that takes a WinCC-Unified-specific pattern. According to the official WinCC Unified engineering documentation, the pattern supports:

  • Binary data format with the inputs Sign "B" and an optional Number of digits field — for displaying bits in a 32-/64-bit tag.
  • Decimal data format with optional Thousand separator, Decimal places, and Leading zeros fields.
  • Hexadecimal data format (sign "H", optional digit count).
  • Floating-point data format that internally maps to double semantics.

For the Trend Control axis case in WinCC Unified, configure the I/O Field as follows:

  1. Open the I/O Field properties under Properties > General > Format.
  2. Select data format Floating-point.
  3. Set Decimal places = 0 if you want integer-style axis values, or 4 for engineering scaling.
  4. Set Leading zeros = 0 (default) to allow the operand to grow with the magnitude.
  5. Bind the Process value to the same 64-bit tag used for TrendArea.ValueAxis.BeginValue.

WinCC Unified automatically switches to exponential notation once the absolute value exceeds the digit count of the format, which mirrors the behavior of the Trend Control's inline editor.

Reference: Defining the output format (RT Unified) - WinCC Unified.

Mantissa Resolution and Rounding — The Real Bottleneck

Even with a format string that nominally allows 28 digits, only 15-17 digits will ever be accurate. This is the single most common source of confusion when implementing double-typed IO Fields.

Worked example — operator types 99999999.44444444444 into an IO Field bound to a 64-bit tag:

  1. The runtime parses the literal as double. The closest representable value is 99999999.4444444477558135986328125.
  2. That value is written to the tag (and therefore to the Trend Control axis).
  3. On the next refresh cycle, the I/O Field re-reads the value and renders it with the configured format. With 99999999999999,99999999999999 the rendered string is 99999999.44444444800000.
  4. The operator sees 99999999.44444444800000, types 99999999.44444444800000 back in, and observes no change — confirming the round-trip.

If the requirement is to display the literal the operator typed, store it as a string in the PLC and convert on demand. For numeric axis scaling, the 15-digit resolution is adequate for any practical engineering range.

Limits When the Value Exceeds the Format Width

WinCC displays **** (asterisks) when the value cannot fit in the configured format width. This is a deliberate overflow indicator. Two strategies prevent it:

  1. Use exponential notation for the upper range. A format of 9,9999e+999 covers any positive double value up to ±1e+999 (well past the 1e308 limit) in 10 characters.
  2. Match the format width to the tag range. For axis values that will always be within ±9.999e+15, a 16-digit format covers everything without exponential switching.

WinCC Unified's Floating-point format with the Automatic decimal places checkbox off renders exponential automatically; this is generally the cleanest approach for Trend Control axis values.

Validation of the Trend Control Value

The Trend Control property ValueAxisBeginValue / ValueAxisEndValue will:

  • Clamp the value to ±1.0e+307 silently if outside range.
  • Swap the values internally if BeginValue > EndValue, producing an inverted axis.
  • Re-render the y-axis labels immediately on the next redraw cycle.

Add a VBScript or C-script on the I/O Field's Value changed event to validate EndValue > BeginValue before writing, to avoid silent axis inversion.

Verification Procedure

  1. Compile the project (TIA Portal Project > Compile > Software (rebuild all)).
  2. Start the WinCC Runtime (or the PLCSIM with the HMI simulation).
  3. Navigate to the screen with the IO Field.
  4. Type 1.0e+300 — confirm the value is accepted and the Trend Control axis adjusts.
  5. Type 123456789012345 — confirm full 15-digit display.
  6. Type 1234567890123456789 (19 digits) — confirm 15-digit rounding with no runtime error.
  7. Type -1.0e+308 — confirm the value is clamped to -1.0e+307 by the Trend Control (warning in the alarm log if configured).
  8. Type alphabetic characters — confirm the IO Field rejects the input and restores the previous value.

Troubleshooting Matrix

Symptom Likely cause Fix
Field shows *** Value does not fit the configured digit width Switch to exponential format or widen the format string
Last few digits differ from typed value Mantissa limit of IEEE 754 (15 digits) Document the rounding in the operator hint; reduce decimal places
Value rejected with red border Outside IO Field Min/Max limits Set Min/Max to ±1E+308 for full range
Trend axis does not change Tag not bound to the Trend Control property Re-bind ValueAxisBeginValue to the same HMI tag
Axis inverts after write EndValue < BeginValue Add a value-changed script that clamps the order
Value flickers between two states Two writers (PLC + HMI) alternating Set the acquisition cycle longer than the PLC update; or use one writer only
Input field accepts letters Data type set to String, not LReal/double Re-bind to a 64-bit floating-point tag
Runtime tag quality = "bad" PLC connection interrupted or wrong DB offset Check connection diagnostics in WinCC tag management
WinCC Unified: format field greyed out Tag is bound to a 32-bit Real property of the control Bind to a property that exposes the full 64-bit value
Trend axis limit clamps at 1e307 silently Trend Control internal limit Use ±1e307 as the IO Field limits to match

Performance and Acquisition-Cycle Notes

The IO Field updates on every acquisition cycle of the HMI tag. For a Trend Control axis, a 1-second cycle is sufficient and avoids PLC-side bus load. If the I/O Field is on a separate screen and only refreshed on screen change, set the acquisition mode to Cyclic continuous so the operator always sees the current axis range when they navigate to the screen.

FAQ

What is the maximum value an IO Field can display in WinCC?

By default, an IO Field bound to a 64-bit IEEE 754 tag accepts and displays values from -1.0e+308 to +1.0e+308. To actually render such large values, use a format string that supports exponential notation (e.g. 9,9999e+999) or the WinCC Unified Floating-point format with auto-decimal.

Why does my 17-digit value show rounding at the 15th digit?

IEEE 754 double precision guarantees 15 decimal digits of exact representation and up to 17 in round-trip. Values with more than 15 significant digits cannot be stored exactly and are rounded to the nearest representable double. This is a hardware-level limit, not a WinCC limitation.

Can I bind an IO Field directly to a Trend Control axis property?

Yes. Bind the HMI tag (64-bit LReal) to both the IO Field's Tag property and the Trend Control's ValueAxisBeginValue / ValueAxisEndValue property. Any change to the IO Field is reflected on the y-axis on the next redraw cycle.

What format string lets the operator type a scientific value like 1e20?

Use the WinCC Unified Floating-point format with auto-decimal, or in classic WinCC use a numeric format that includes the exponent placeholder (e+999). The runtime parser accepts 1e20, 1E+20, and 1,0e+20 notations regardless of format string.

Why does the Trend Control cap axis values at 1e307 while the IO Field allows 1e308?

The Trend Control uses an internal axis range of ±1.0e+307 to keep label rendering and tick generation within double-precision-safe bounds. If your IO Field accepts a larger value, the Trend Control silently clamps it. Set the IO Field Min/Max to ±1.0e+307 to keep the two objects consistent.

Back to blog