S7-1200 HMI Trend Graph Empty: TIA Portal Diagnosis and Fix

David Krause19 min read
S7-1200SiemensTroubleshooting
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

S7-1200 HMI Trend Graph Empty: TIA Portal Diagnosis and Fix

Symptom: An analog sensor is wired to an S7-1200 CPU and read in STEP 7 (the watch table shows the correct value), but the HMI trend view stays empty, and a plain I/O field on the same screen also shows "####" or stays at zero. The TIA Portal project compiles, downloads, and the HMI runtime starts without errors. A common variant is that the panel is the WinCC RT simulator while the PLC is the real CPU.

1. Problem Overview

Trend graph problems on SIMATIC HMI panels are almost always caused by one of three upstream defects before the trend object itself is at fault:

  1. A missing or wrong PROFINET/IP connection between the HMI and the S7-1200.
  2. An HMI tag that is not updated because it points at a non-existent or unoptimized DB address.
  3. A runtime mismatch (real CPU + simulated HMI, or real HMI + simulated CPU) where the two endpoints are not on a reachable subnet.

The trend view simply renders whatever value it is given on a time axis. If the upstream I/O field is blank, the trend will be blank too. The fastest triage path on a fresh TIA Portal project is to first read the value in a plain I/O field, then move to the trend view, then to the trend's acquisition settings. This sequence is exactly the path suggested in the original report and avoids wasted hours chasing trend configuration when the connection is broken.

2. Root Cause Analysis

For the S7-1200 / TIA Portal combination, the most common root causes, in descending order of frequency observed in field commissioning, are listed in the table below.

# Root Cause Symptom on HMI Affected Versions
1 HMI connection not created, or wrong IP / subnet / PROFINET name All HMI tags show quality code 0x80 (bad), I/O field shows "####" All TIA Portal V13 to V19
2 HMI tag points at a non-existent PLC tag, or DB is optimized and "S7-1200/S7-1500" symbolic access is not set I/O field shows "####", tag compiler warning at compile time All versions
3 Analog input range mismatch (sensor is 4-20 mA, module set to ±10 V) or underflow at 0 mA Value present but wrong magnitude, often negative or 0 Firmware V4.0+ on CPU 1211C, 1212C, 1214C, 1215C, 1217C
4 Trend view "Source" bound to the raw IW (INT 0-27648) instead of the scaled engineering REAL Trend stays flat at zero or shows a step at 27648 All versions
5 WinCC RT simulation on the engineering PC, real CPU, but the PC's PG/PC interface points to the wrong NIC or Windows firewall blocks TCP 102 / UDP 34964 Connection state = "Disconnected" in the RT launcher All versions
6 No trigger tag on the trend view, or trigger cycle > acquisition cycle, so the buffer is never committed Graph axis time advances but the curve never updates All versions
7 Y-axis lower limit set to 0 and the scaled value is < 0 (typical for 4-20 mA with underflow) Curve appears, but every value is clipped to 0 All versions
8 Trend view mode set to "Historical trend" but no DataLog / CSV path is configured on the panel Trend view shows a red X and a runtime error All versions

3. Prerequisites

Before any configuration, gather the following:

  • TIA Portal V16 or later (V17 / V18 recommended) with STEP 7 Basic and WinCC Basic, or STEP 7 Professional and WinCC Comfort / Professional for Comfort Panels. The portal version must be greater than or equal to the panel's firmware image, otherwise the panel will refuse the download with a "Downgrade not permitted" error.
  • SIMATIC S7-1200 CPU: 1211C DC/DC/DC, 1211C DC/DC/Rly, 1212C, 1214C, 1215C, or 1217C with firmware V4.2 or later. Firmware V4.4 is required for OPC UA server on the 1215C and for full Web API access. The 1217C ships with V4.4 minimum.
  • Analog input module SM 1231: 6ES7231-4HD32-0XB0 (4 AI, 13 bit), 6ES7231-4HF32-0XB0 (8 AI, 13 bit), or 6ES7231-5ND32-0XB0 (4 AI, 16 bit HS). The CPU 1215C and 1217C also expose two onboard AI on inputs I0 and I1 (0-10 V, 10 bit).
  • HMI: KTP400 Basic Mono, KTP400 Basic Color, KTP600 Basic, KTP700 Basic, KTP900 Basic, KTP1200 Basic, or any Comfort Panel (TP700, TP900, TP1200, TP1500, TP1900) with a 6AV2 order number.
  • Wired or simulated PROFINET. For real hardware: a managed or unmanaged switch and Cat 5e or better cabling. For mixed simulation: PLCSIM V16+ (or PLCSIM Advanced V2+) plus WinCC RT Simulation on the same engineering PC, with the HMI runtime started from the project tree by right-click > "Start runtime".
  • A configured sensor wired to channel 0 of the analog module. For 4-20 mA sensors with the 4 AI 13 bit module, a 500 Ω precision shunt at the input is recommended to convert to 1-5 V, or use a module that supports current directly.
Cross-platform note: The trend object on Siemens panels is called "Trend view" or "f(x) trend view" in the toolbox. The Keyence VT-series HMI, AutomationDirect C-More EA9, and Red Lion Graphite panels have analogous objects with different menu paths; see the Keyence trend graph placement guide and the AutomationDirect C-More line trend help page for non-Siemens deployments. The PLC-side logic in STEP 7 is identical across all of them.

4. Configuration Procedure

The procedure is broken into four sequential steps. Do not skip a step: a working trend view depends on every layer below it being correct.

4.1 Verify S7-1200 Analog Input

First confirm the CPU is actually reading the sensor. The simplest check is a watch table on the analog input word. The raw integer is always 0 to 27648 for unipolar ranges (0-10 V, 0-20 mA, 4-20 mA) and -27648 to 27648 for bipolar ranges (±10 V, ±5 V, ±2.5 V), regardless of the engineering unit. TIA Portal exposes this in the device view of the analog module under "Properties > Analog inputs > Input range" and "Scaling".

SM 1231 input range / resolution table:

Module Order Number Voltage / Current Resolution Overflow (decimal)
SM 1231 AI4 x 13 bit 6ES7231-4HD32-0XB0 ±10 V, 0-10 V, 0-20 mA, 4-20 mA 12 bit + sign 32767 / -32768
SM 1231 AI8 x 13 bit 6ES7231-4HF32-0XB0 ±10 V, 0-10 V, 0-20 mA, 4-20 mA, RTD, TC 12 bit + sign 32767 / -32768
SM 1231 AI4 x 16 bit HS 6ES7231-5ND32-0XB0 ±10 V, ±5 V, ±2.5 V, 0-20 mA, 4-20 mA 15 bit + sign 32767 / -32768
Onboard AI (CPU 1215C / 1217C) n/a 0-10 V only 10 bit 32767

Add a Global DB "DataLog" with the following structure in STEP 7:

DATA_BLOCK "DataLog"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
  STRUCT
    aiRaw        : INT;       // mirror of IW, e.g. %IW64
    aiScaled     : REAL;      // engineering value, 0.0 to 100.0
    trendValue   : REAL;      // value consumed by the HMI trend
    trendTrigger : BOOL;      // trigger tag for the trend
  END_STRUCT;
END_DATA_BLOCK

Scale the raw value in OB1 (or a cyclic OB) using the NORM_X and SCALE_X instructions, or a manual linear map. For a 4-20 mA input representing 0-100 °C with the 13 bit module (4 mA = 0, 20 mA = 27648):

"DataLog".aiScaled := (("DataLog".aiRaw - 0) / 27648.0) * 100.0;
"DataLog".trendValue := "DataLog".aiScaled;

For a 4-20 mA loop with explicit underflow / overflow rejection (3.6 mA = 0 °C, 21 mA = 100 °C, out-of-range = -100 °C flag):

IF "DataLog".aiRaw < 5530 THEN
    "DataLog".aiScaled := -100.0;        // underflow
ELSIF "DataLog".aiRaw > 27648 THEN
    "DataLog".aiScaled := 200.0;         // overflow
ELSE
    "DataLog".aiScaled := (("DataLog".aiRaw - 5530) / 22118.0) * 100.0;
END_IF;
"DataLog".trendValue := "DataLog".aiScaled;

For the trigger at a 1 s cadence, add a TON (timer, 1 s pulse) and toggle the trigger BOOL in OB1. Avoid driving the trend from the system clock bit (CLK / %M0.5) directly - it is a CPU flag, not a polled HMI tag, and the trend view will not subscribe to it.

"trendTmr".TON(IN := NOT "trendTmr".Q, PT := T#1S);
IF "trendTmr".Q THEN
    "DataLog".trendTrigger := TRUE;
ELSE
    "DataLog".trendTrigger := FALSE;
END_IF;

4.2 Configure the PLC-HMI PROFINET Connection

Open "Devices & Networks" in TIA Portal. Drag the S7-1200 CPU and the HMI panel into the editor, then click the green PROFINET port on the CPU and drag to the HMI port to create the connection, or right-click the HMI and choose "Connect with S7-1200". Verify the following parameters:

  • CPU IP: 192.168.0.1, subnet 255.255.255.0 (the project default). Real CPU 1211C/1212C/1214C/1215C/1217C also support any RFC1918 address; the default works on a green-field bench.
  • HMI IP: 192.168.0.10, subnet 255.255.255.0.
  • PROFINET device name on the HMI matches the name in the project (e.g. "hmi-1"). On a real panel, the name is set in the "Settings > Network & PROFINET" menu. The CPU's "Accessible devices" scan must return the panel by that name.
  • HMI connection in the project tree has the right PLC slot (CPU slot 1) and the right access point: S7ONLINE for Ethernet, or the HMI's own S7 routing path for WinCC RT.
  • The HMI connection "Properties > Protocol" must show the "SIMATIC S7 1200/1500" symbolic access mode, not the legacy "S7-300/400" mode. This is set automatically when the connection is created by drag-and-drop in V16+, but verify it on manually imported projects.

Topology reference (PROFINET cabling):

S7-1200 CPU192.168.0.1PROFINET port X1SM 1231 AI4-20 mA / 0-10 VHMI (KTP / TP)192.168.0.10PROFINET X1PROFINET (TCP/102, UDP/34964)Engineering PC (optional)TIA Portal V18STEP 7 + WinCCPLCSIM V18SoftbusWinCC RTHMI simulator

Common error: If the CPU was assigned IP 192.168.0.1 in the project but the real PLC on the bench has never been downloaded (it still has its old IP 192.168.0.10), WinCC will report "Connection to PLC failed" with error code 0x80072EE2 (connection timeout) and the HMI tag quality goes to 0x80. Always download the CPU and the HMI to the targets, and verify the CPU's MAC address with "Online > Accessible devices" from the engineering PC.

4.3 Create HMI Tags

Open the HMI device, go to "HMI tags", and create the following tags. Set the acquisition cycle to match the trigger period of the trend (default 1 s on a 1 s trigger).

Name PLC tag / DB address Data type Acquisition cycle Display
aiRaw "DataLog".aiRaw INT 1 s Decimal, 0 - 32767
aiScaled "DataLog".aiScaled REAL 1 s Decimal, -100.0 - 200.0
trendValue "DataLog".trendValue REAL 1 s Decimal, -100.0 - 200.0
trendTrigger "DataLog".trendTrigger BOOL 1 s Binary

For S7-1200 / S7-1500 with optimized DBs (the default since V14), the symbolic access mode in the HMI connection must be set to "S7-1200/S7-1500" (TIA Portal sets this automatically when the connection is created by drag-and-drop; verify under "HMI connection > Properties > Protocol > Mode"). If you are using a non-optimized DB (the legacy default on projects migrated from V13), the HMI must use absolute addresses such as %DB1.DBW0 and "S7-300/400" access mode.

For monitoring-only tags, set the tag direction to "HMI -> PLC" only if you need to write back. For all tags consumed by a trend view, leave the direction as "Read only" or "Bidirectional" (the default) - the trend view does not write, but the tag will be polled on the configured cycle regardless of direction.

4.4 Insert and Configure the Trend View

On the desired screen, drag a "Trend view" from the toolbox (under "Controls > WinCC Trend View"). Configure the properties in the inspector pane:

Property Value Notes
Source / Process tag trendValue Use the scaled REAL tag, never the raw INT 0-27648
Trigger tag trendTrigger (rising edge) Without a trigger the trend still updates at the acquisition cycle, but the buffer commit is not deterministic on Basic Panels
Acquisition cycle 1 s Match the PLC side update rate to avoid staircase values
Number of values in buffer 600 (10 min at 1 s) Larger buffers cost panel RAM; Comfort Panels can hold 30 000+
Y-axis upper / lower limit 0.0 / 100.0 Set the engineering range, not 0-27648
Y-axis major / minor ticks 10 / 5 Use 1.0 to make the grid match the engineering unit
Time axis range 60 s window Live trend; for history use "Historical trend" with a DataLog
Index-based display Disabled Default; enable only if the X-axis is the sample count, not time
Toolbar visibility Optional Show the time / zoom / print controls for operator-driven exploration

For non-Siemens panels the trend object is similar but the menu path differs. On the AutomationDirect C-More EA9 panel, the Line Trend Graph is added from Meter/Graph > Line Trend Graph; see the C-More help page for the property layout. On the Keyence VT-series HMI, place a Trend graph from Parts > Meters/Graphs per the Keyence HMI tutorial.

For dashboard / web-based display layers (Prometheus, Grafana, Node-RED dashboard) where the S7-1200 data is exposed via OPC UA or the S7 protocol, the trend panel uses an X-axis time series; see the Grafana trend visualization documentation for the equivalent configuration. The PLC logic is unchanged - only the consumer of the trend data is different.

5. Simulation Mode Considerations

The original report explicitly notes that the PLC is real but the HMI is the WinCC RT simulator (or vice versa). TIA Portal supports four simulation modes, each with its own connection prerequisites:

Mode CPU side HMI side Connection requirement
A PLCSIM V16 - V19 (single instance) WinCC RT on the same PC Softbus: PLCSIM → WinCC RT, no IP needed; both started from the same TIA Portal session
B PLCSIM Advanced V2+ (multi-instance) WinCC RT on the same PC Softbus or TCP via 192.168.0.x; both must reference the same PLCSIM instance ID
C Real CPU on the bench WinCC RT on the engineering PC PC NIC must be in the same subnet, 192.168.0.x. PG/PC interface under Windows must point to that NIC
D Real CPU on the bench Real panel on the bench Standard PROFINET, both on the same switch or direct patch cable

For mode C, the most common pitfall is that the engineering PC's PG/PC interface is set to the wrong NIC, or the Windows Defender firewall blocks TCP 102 / UDP 34964. In the project tree, right-click the HMI and select "Online > Accessible devices" - this should return the CPU's MAC address. If nothing returns, fix the IP and switch first. The CPU's PROFINET diagnostic LEDs (Link and RX/TX on port X1) confirm the link state at a glance.

For mode B, PLCSIM Advanced instances must be licensed and started before the WinCC RT is started, and the HMI's "Access point" must be set to the PLCSIM instance. If the RT starts first, the connection will fail with a non-specific error and must be re-initialized.

WinCC RT tip: In TIA Portal V17 / V18, the RT launcher logs the connection state at the bottom-left. If the trend is empty but the I/O field reads correctly, the issue is inside the trend object (trigger, source, buffer). If the I/O field reads "####" or "---", the issue is upstream (connection, tag, scaled value). Always fix the I/O field first, then move to the trend.

6. Verification Checklist

After each download, perform these checks in order:

  1. Online > "Go online" on the CPU. Confirm the online value of "DataLog".aiRaw matches the sensor reading. Use the device configuration to verify the input type matches the wiring (e.g. "Voltage 0-10 V" vs "Current 4-20 mA"). A 0-20 mA input set as 0-10 V will saturate at half scale.
  2. Online > "Go online" on the HMI. Confirm the HMI tag "trendValue" shows a value in the upper-right "Value" column. If it shows 0x80 (bad), the connection is broken.
  3. In WinCC RT, click the screen with the I/O field. The value must match the PLC online value. If it does not, fix the upstream layer first.
  4. Click the screen with the trend view. The trend curve should begin plotting from the left edge within one acquisition cycle (1 s). If the curve is flat but the time axis is advancing, the trigger tag is wrong or the source is the raw INT.
  5. Force "DataLog".trendValue to a known value (e.g. 75.0) from the watch table. The trend line should jump to 75 % of the Y-axis range. If it does, the path is healthy; if not, the source binding is broken.
  6. For 4-20 mA sensors, disconnect the loop and verify the value drops to the underflow code (-100.0 in the example). Reconnect and verify the curve resumes within one cycle.
  7. Verify the panel's clock (in the diagnostics screen or via "Device > Date / Time") matches the PLC's clock, otherwise the historical trend timestamps will be offset.

7. Troubleshooting Matrix

Observed Most Likely Cause Fix Estimated Time
I/O field shows "####", HMI online tag quality 0x80 Connection failed Check IP, subnet, PROFINET name, PG/PC interface, Windows firewall 5 min
I/O field shows 0, no error Wrong tag address, or scaled value never written Cross-check the DB online, OB1 watch on "DataLog".aiScaled 3 min
I/O field correct, trend shows zero flat line Trend source bound to the raw INT instead of the scaled REAL Change the trend "Source" to trendValue (REAL) 1 min
Trend updates, but is noisy / jumps Acquisition cycle faster than the PLC update, or no smoothing in PLC code Match cycles; add a PT1 filter block on the AI in the PLC 5 min
Trend shows values from the past, not live Trend view mode set to "Historical" with a non-existent log Switch the mode to "Cyclic continuous" or "Cyclic single" 2 min
Trend runs but the X-axis does not move Trigger tag not toggling Add a TON in OB1 to toggle "DataLog".trendTrigger every second 3 min
Panel says "Connection to PLC failed" after a few minutes PG/PC interface on engineering PC reverts to default Set it explicitly under "Set PG/PC interface" in the Windows control panel 2 min
Compiled fine, downloaded fine, but RT shows red X over the trend Trend view references a tag that was deleted from the HMI tag list Recompile (Project > Compile all); reinsert the trend source 2 min
Trend curves at 0, 4-20 mA sensor, AI value above 5530 Y-axis lower limit 0 + negative underflow clipped Set Y-axis lower to -10 or to the engineering minimum 1 min
Trend shows correct shape but values are half of expected Two SM 1231 channels configured, only one wired, the trend bound to the unwired channel Bind the trend to the wired channel address 2 min

Decision flowchart for empty trends:

Trend view emptyI/O field reads correctly?NoFix upstreamConnection, tag, scalingYesSource = REAL?REAL source?NoBind scaled REALe.g. DataLog.trendValueYesTrigger toggling?Add 1 s TON pulseTrend is correct

8. Cross-Platform and Advanced Considerations

For deployments that go beyond a single S7-1200 and a single HMI - for example, a plant-wide dashboard, a remote monitoring page, or a historian - the trend value from the PLC can be exposed to external consumers without changing the PLC code. The S7-1200 firmware V4.4+ supports an OPC UA server on the 1215C and 1217C that publishes DB tags by name; a Node-RED flow or a Grafana instance can subscribe to the same DB and render a trend with the same source tag.

For S7-1200 firmware V4.5+ (released with TIA Portal V18), the S7 Web API exposes the same data over HTTPS, and the panel's historical log can be pushed to an S7-1500 or a SCADA system via the integrated PUT/GET instructions. The PLC logic in this article remains valid: scale the analog value into a REAL, expose that REAL as an HMI tag, and bind the trend view to it. The consumer of the trend - WinCC, Grafana, Node-RED, or a third-party SCADA - does not change the PLC code.

For trends that must persist across power cycles, configure a DataLog on the S7-1200 with the "trendValue" tag as the data source, set the log path to the panel's SD card (Comfort Panels) or to the internal flash (Basic Panels with limited size), and bind a "Historical trend" view to that DataLog. The live "Trend view" and the "Historical trend" can be on the same screen, with the operator selecting between them via a tab or a button.

For very high sample rates (faster than 1 s), the Comfort Panel's trend buffer of 30 000 values supports a 1 Hz trend for 8.3 hours. For higher rates, use the 100 ms or 250 ms acquisition cycle on a Comfort Panel and reduce the buffer count to keep memory in check. The Basic Panels top out at 2 s and a 100-value buffer; if higher resolution is needed, a Comfort Panel is required.

9. FAQ

Why does my S7-1200 HMI trend view stay empty even though the analog input is wired correctly?

The most common cause is that the trend source is bound to the wrong HMI tag, usually the raw INT (0-27648) instead of the scaled REAL engineering value. Set the trend "Source" to the scaled tag (for example "DataLog".trendValue) and the curve will appear. If the value is also missing in a plain I/O field, the issue is upstream in the PLC-HMI connection.

Can I run a real S7-1200 CPU with a simulated HMI panel to test the trend graph?

Yes. Start WinCC RT Simulation in TIA Portal, set the PG/PC interface to the network adapter that is on the same subnet as the CPU (typically 192.168.0.x), and use the project HMI connection. PLCSIM is not required in this configuration, but the real CPU must be reachable on the subnet and the Windows firewall must allow S7 communication (TCP port 102, UDP port 34964).

What is the difference between a "Trend view" and a "Historical trend" in WinCC?

A Trend view displays live values polled on a fixed cycle, with an in-memory buffer that scrolls off when full. A Historical trend reads values from a log (DataLog or CSV) stored on the panel or an external path, and it can scroll back through days or weeks of history. For a simple S7-1200 application, the Trend view is sufficient; for long-term logging, configure a DataLog on the S7-1200 and bind the Historical trend to it.

What trigger tag should I use for a 1 s trend update?

Add a TON (timer) of 1 s in OB1 that pulses a BOOL in your DB, and bind that BOOL as the trend's "Trigger tag" on a rising edge. Avoid using %M0.5 or %MB0 / %MW0 directly, as the HMI may not interpret them consistently. With no trigger tag, the trend updates at the acquisition cycle but is not deterministic.

Do I need a Comfort Panel for trend views, or is a Basic Panel sufficient?

For the S7-1200 series, the trend view is supported on KTP400 Basic, KTP700 Basic, KTP900 Basic, KTP1200 Basic, and all Comfort Panels. The Basic Panels have a smaller number of buffers (around 100 values per trend) and do not support historical trends with logs. Comfort Panels can hold 30,000 or more buffered values and support full historical and f(x) trends.

Back to blog