1. Problem Statement
In Siemens WinCC runtime, an HMI/SCADA Trend Control renders the Min, Max, Present, and value bar (ruler) read-outs as whole integers even though the underlying tag value is a real/float data type (IEEE-754 single or double precision). This symptom affects:
- Numerical tick labels on the y-axis bound to a Float-tagged curve
- Read-outs returned by the toolbar's Ruler / Statistics functions (Min, Max, Average, Sum, Standard Deviation)
- The bar value shown when the trend cross-hair cursor is positioned over the curve
- Status displays in the legend area and the online table
- The trend's present-value indicator on the right margin of the diagram
The visible value remains an integer regardless of the source tag being declared as Float, Double, or Real, and regardless of whether the tag is internal, an S7/MPI/TCP driver tag, or an ODBC-connected external value. Because the source data set described in the original report (an ODBC database storing all measurement points as float) loses fractional information at the HMI, the apparent loss of precision is purely a display problem, not a value-integrity, scaling, or driver problem. Process logic, alarms, and archive values are unaffected.
GetTagFloat from a Global Script before changing any configuration.2. Root Cause Analysis
The WinCC Trend Controls separate value acquisition from value rendering. Acquisition honors the tag data type; rendering honors a separate display-format string associated with the tag, the value axis, and the statistics area. Each layer can independently truncate fractional digits, which is why the fix requires multiple property checks rather than a single switch.
For a newly created internal tag without explicit format configuration, WinCC defaults to a decimal format that depends on the data type and the project build. A summary of the historical defaults is provided below.
| Tag Data Type | Legacy Default (≤ V7.2) | Modern Default (≥ V7.3) | Rendered Result for 12.345 |
|---|---|---|---|
| Binary Tag | Binary | Binary | 1 |
| Signed 16-bit / 32-bit | Decimal (signed) | Decimal (signed) | 12 |
| Unsigned 8/16/32-bit | Decimal (unsigned) | Decimal (unsigned) | 12 |
| Float (32-bit) / Double (64-bit) | Decimal (signed) | Float | 12 (legacy) or 12.345 (modern) |
When the format string is set to Decimal rather than Float, the rendering stage truncates the fractional portion of every value, regardless of how many bits of mantissa the source provides. The ODBC driver returns a float, the WinCC tag stores a float, the archive stores a float, but the format string Decimal tells the Trend Control to round-trip the number through a signed-integer print routine. Project migration from V7.2 or earlier to V7.3+ retains the legacy Decimal default for existing tags, which is the most common cause in long-lived installations.
3. Configuration: Decimal Places for Internal and Process Tags
Open the Tag Management in WinCC Explorer (V7.x) or the HMI tag table in TIA Portal (WinCC Professional / Unified):
- Locate the tag driving the trend curve.
- Open the tag properties dialog (right-click → Properties in WinCC V7; Properties pane in TIA Portal).
- Switch to the Properties tab (or Value tab in TIA Portal).
- Locate the Format / Display Format property group.
- Set the format to
Float(or a numeric format string) instead of the defaultDecimal. - Set Decimal Places to the desired precision (typically 1–3 for process values).
- Click Apply, then Recompile the OS or relaunch Runtime.
In WinCC V7.x the property path is:
Tag Management → <Channel> → <Connection> → <Tag> → Properties → Format
In TIA Portal (WinCC Professional):
Project tree → HMI Tags → Tag table → <Tag> → Properties → Value → Format / Decimal Places
4. Configuration: Decimal Places for ODBC-Sourced Tags
Tags fed through the WinCC ODBC driver follow the same formatting rules, but the format must be set on the WinCC tag, not on the database column. The ODBC driver returns the value with native precision; WinCC re-renders it using the tag's display format. Database-side column types (REAL, FLOAT, DOUBLE) do not propagate a format hint to the WinCC rendering layer.
- In WinCC Explorer, open Tag Management → ODBC.
- Select the ODBC connection used by the trend (for example
MySQL_ProcessDataorMSSQL_Historian). - Open each tag's properties and set Format to
Float. - Set Decimal Places to 1–3, matching the column's numeric precision.
- Repeat for every tag whose trend curve loses fractional digits.
- Save, recompile, and restart Runtime.
Refer to the Siemens Industry Online Support entry on the WinCC ODBC channel for the complete list of supported SQL Server, MySQL, and Oracle types and their mapping to WinCC tag data types. Where the database column is DECIMAL(p,s), the format must still be set explicitly to Float; the driver returns a string representation that WinCC parses as a float, but only Float format preserves the fractional digits in the rendered output.
5. WinCC Trend Control Value Axis Configuration
If the format on the tag is already set to Float but the y-axis tick labels still show integers, the Trend Control's Value Axis has its own display parameters that override the tag format. This is the most common cause of partial fixes where the read-out shows decimals but the axis labels remain integer.
Open the Trend Control configuration:
- Right-click the Trend Control in the Graphics Designer → Configuration Dialog (WinCC V7) or double-click the control (TIA Portal).
- Navigate to Value Axes.
- Select the axis (Value Axis 1, 2, ...) bound to the affected tag.
- Under Settings, locate Decimal Places and Representation.
- Set Decimal Places to a value ≥ 1 and the Representation to
Numeric / Float. - Apply, then click OK.
This setting controls only y-axis tick labels; it does not affect per-point read-outs. For those, the tag format (Section 3) and the statistics format (Section 7) are authoritative.
6. Per-Curve Configuration in the Trend Control
When multiple curves share a value axis but have different precision requirements, use per-curve overrides:
- Open the Trend Control configuration dialog.
- Navigate to Curves.
- Select the curve.
- Under Y-Axis, set Decimal Places independently.
- Confirm with OK.
This is useful when one trend holds both pressure (2 decimals) and flow rate (1 decimal) curves on the same axis. Note that per-curve overrides are subject to the parent value-axis configuration; if the value axis is set to Decimal, per-curve Float may still produce integer labels at the tick marks.
7. Ruler / Statistics Output Formatting
The toolbar Min, Max, Present, and Average read-outs in the Online Trend Control and Online Table Control are formatted using the trend's Online Configuration → Statistics Area settings. This is the third and most often missed layer of configuration.
- Configuration Dialog → Online Configuration.
- Select the Statistics Area tab.
- For each statistic field (Min, Max, Average, Sum, Standard Deviation), check the box Format and select
Floatwith desired Decimal Places. - Apply.
If the statistics format is left as Decimal, the read-outs will continue to show integers even after the tag format and value-axis format are correctly set to Float. Operators typically report this as "the chart shows decimals but the pop-up numbers still round" — a clear indicator that the statistics-area format is the missing piece.
8. Verification Procedures
After recompiling and restarting Runtime:
- Open the affected picture in Graphics Designer runtime.
- Activate the trend control and observe the y-axis tick labels; confirm 1–3 fractional digits.
- Hover the cursor over a curve to display the cross-hair ruler.
- Verify that the read-out shows the expected fractional digits (for example
12.345rather than12). - Open the Statistics toolbar and confirm Min, Max, Average, and Present show decimals.
- Compare the displayed value with the value returned by the
GetTagFloatWinCC C / VBS script for the same tag.
A simple VBS verification snippet for the Global Script area:
Dim v
v = HMIRuntime.Tags("MyFloatTag").Read
HMIRuntime.Trace "Tag=" & v & " Type=" & TypeName(v)
If TypeName(v) returns Empty or String, the tag is not bound as float. If it returns Single or Double, the data layer is correct and the problem is purely the display format. For TIA Portal WinCC Professional, the equivalent is:
Dim v
v = SmartTags("MyFloatTag")
HMIRuntime.Trace "Tag=" & v
Cross-check the displayed value with a WinCC archive export to CSV. If the CSV shows 12.345 but the trend displays 12, the issue is unambiguously a rendering configuration problem.
9. Format String Reference
| Format Code | Meaning | Example Output for 12.345 | Recommended Use |
|---|---|---|---|
d / Decimal
|
Signed integer | 12 | Counter values, state codes |
f / Float
|
Fixed-point float (uses configured Decimal Places) | 12.345 (3 dp) or 12.3 (1 dp) | Process values, setpoints |
e |
Scientific | 1.234500e+001 | Very large or very small values |
g |
General (auto) | 12.345 | Mixed-range displays |
x |
Hexadecimal | C | Diagnostic raw values |
o |
Octal | 14 | Legacy system interfaces |
For process display, f with 1–3 decimal places is the most common. The format codes map directly to the .NET ToString format specifiers used internally by WinCC Unified controls. For a full enumeration, refer to the Siemens WinCC V7.5 manual collection under Tag Management → Format Specifications.
10. Version-Specific Considerations
10.1 WinCC V7.x (Legacy)
- Default format for new Float tags changed in V7.3 from
DecimaltoFloat. - Tags migrated from older projects inherit
Decimaland must be re-formatted. - Configuration is per-tag in Tag Management; the trend control's own axis format is independent.
- For V7.5 SP2 and later, the Configuration Dialog exposes a Bulk Edit mode to re-format many tags at once.
10.2 WinCC Professional (TIA Portal)
- Tag format is set in the HMI tag table, Properties → Value → Format.
- The TrendView control exposes per-axis Decimal Places via Properties → Axis → Y-Axis → DecimalPlaces.
- PLCs that deliver REAL (32-bit) or LREAL (64-bit) are mapped to the WinCC tag's configured data type; ensure the WinCC tag is also declared as Real / LReal.
- Cross-reference compilation caches tag properties; a "Recompile all" may be required after a bulk format change.
10.3 WinCC Unified (TIA Portal V18+)
- Unified Trend Control uses Formatting properties on the trend curve, including Decimal Places and Thousand Separator.
- Per-point format can be overridden by JavaScript callbacks in custom controls.
- The legacy Tag Management format property is replaced by tag-level format string in the Unified tag editor.
- Tag format follows .NET standard (C-style format strings such as
F1,F2,N3).
For Unified, the standard Siemens-published sample projects include a TrendFormatting template that demonstrates the difference between tag-level, axis-level, and curve-level format properties. The WinCC Unified manual on the Siemens Industry Online Support site documents the full property hierarchy.
11. Common Pitfalls and Field Notes
- Pitfall 1 — Setting format on the wrong tag: If the trend is bound to an internal mirror tag rather than the source ODBC tag, the format must be set on the mirror, not on the original.
- Pitfall 2 — Decimal Places left at 0: Even when Format = Float, setting Decimal Places to 0 reproduces the integer-display bug. Always verify the Decimal Places counter shows a non-zero value.
- Pitfall 3 — Configuration not recompiled: WinCC caches compiled picture data; a change to tag format requires recompiling the OS or re-loading the picture. This is the single most common reason a format change "does not take."
- Pitfall 4 — Archive format override: Some user archives apply a separate format; verify the archive column, not just the tag.
- Pitfall 5 — Multi-language switching: Decimal Places is language-independent; the separator character (period vs comma) is language-dependent. Verify with all installed runtime languages if the project is multi-lingual.
-
Pitfall 6 — Scaled values: Tags with linear scaling configured still display in raw units; verify that the scaling is not silently converting the display to integer. Use
ReadTagin a script with verbose tracing. - Pitfall 7 — Driver-side type promotion: Some S7 driver versions promote a Float tag to Double only when explicitly requested. If the driver returns a string and the tag is Float, the format mask may be ignored entirely.
-
Pitfall 8 — Rounding at the AS: If the PLC is rounding to integer in the AS logic (for example
REAL_TO_INT), no amount of WinCC configuration will restore fractional digits. Verify the raw value at the AS boundary. - Pitfall 9 — Trend Control template inheritance: Picture templates with pre-set axis formats can override per-instance format settings. Always check the template's Configuration Dialog.
12. Related Trend Display Issues
| Symptom | Likely Cause | Fix |
|---|---|---|
| Y-axis scaling collapses to 0–100 | Axis set to Automatic with wrong tag data type | Switch to Manual and enter the float range |
| Trend updates in steps of 1.0 | Float tag archived but integer value supplied from PLC | Verify the PLC tag is REAL, not INT |
| Cross-hair value stops at decimal point | Deprecated I/O field bound to the same tag without Float format | Re-format sibling controls on the same picture |
| Statistics shows the wrong units | Statistics inherit the tag's unit field | Verify the unit string in tag properties, not in trend configuration |
| Trend displays integers only on Panel, not on PC Runtime | Panel project uses RT Compact format mask | Set Decimal Places in the panel's HMI tag table |
| Float values display correctly but archive export is integer | User archive column type mismatch | Re-create the archive column with type Float/Double |
13. Diagnostic Workflow Summary
- Confirm tag data type with
GetTagFloatin a Global Script. - Open Tag Management → Tag → Properties → Format; set to
Float, Decimal Places ≥ 1. - Open Trend Control Configuration Dialog → Value Axes → Decimal Places ≥ 1, Representation = Numeric.
- Open Trend Control Configuration Dialog → Online Configuration → Statistics Area; set Format = Float for Min, Max, Average, Present.
- Recompile OS / Restart Runtime.
- Verify on screen, in statistics, and via CSV export.
- If the symptom persists, check AS-side scaling and driver-side type promotion.
Why does my WinCC trend show integer values when the tag is configured as Float?
The tag data type controls acquisition and storage, but the display is governed by the tag's Format property. Set Format to Float and Decimal Places to a value ≥ 1 in Tag Management, then recompile Runtime.
Does changing the tag format affect the value stored in the archive?
No. The archive stores the full float value. Format changes are display-only and never modify acquisition, scaling, alarms, or archive data.
My ODBC tags still show integers even after I set Format to Float — why?
Verify the format is set on the WinCC-side tag in the ODBC channel, not on the database column. Recompile Runtime after the change. Clear the WinCC project cache if the new format does not appear.
Where is the Decimal Places setting for the y-axis tick labels?
Open the Trend Control Configuration Dialog, select the value axis (Value Axis 1, 2, ...), and set Decimal Places under Settings. This is independent of the tag format and controls only the axis labels.
Do these format settings apply to WinCC Unified as well?
Yes, but the property paths are different. In WinCC Unified V18+, set the Decimal Places property directly on the trend curve or on the value axis of the Trend Control in the TIA Portal Properties pane using standard .NET format strings.
Why do my Statistics read-outs still round to integers after fixing the tag format?
The Statistics Area has its own Format property independent of the tag. Open Configuration Dialog → Online Configuration → Statistics Area and set each statistic field (Min, Max, Average, Sum, Standard Deviation) to Float with the desired Decimal Places.