Resolving S7-1200 HMI Time Showing 1970: Sync Configuration

David Krause12 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

Problem Description

An S7-1200 CPU (firmware V4.0 or later) connected to a Siemens HMI panel — Comfort Panel, KTP, Basic Panel, or WinCC Runtime Advanced — displays the date 1970-01-01 in trend views, alarm logs, and standard template pages. The PLC online & diagnostics dialog in TIA Portal correctly shows both the PG/PC time and the module time; clicking Apply completes without error messages, but the HMI continues to display the 1970 epoch value. Recompiling the project, performing a full TIA Portal transfer (PG > PLC > HMI), and power-cycling the panel do not resolve the issue.

This is a clock-domain and configuration problem, not a hardware fault. The HMI runtime and the S7-1200 CPU maintain independent real-time clocks. The HMI only displays the PLC time when an area pointer is configured, the tag is correctly populated by the PLC user program, and the trend view / IO field is bound to the synchronized source. The default project configuration leaves these channels disconnected.

Affected Hardware and Firmware

The behavior described applies to the following Siemens product families. Confirm the firmware on the CPU with Online > Accessible devices or by reading the MLFB / article number on the front label.

Component Typical Article Number Minimum Firmware Notes
S7-1200 CPU 1211C DC/DC/DC 6ES7211-1BE40-0XB0 V4.0 Real-time clock buffered; RTC drift ~ ±2 s/day
S7-1200 CPU 1212C DC/DC/DC 6ES7212-1BE40-0XB0 V4.0 RTC backup ~10 days (capacitor) at 25 °C
S7-1200 CPU 1214C DC/DC/DC 6ES7214-1BG40-0XB0 V4.0 Same RTC behavior as 1211/1212
S7-1200 CPU 1215C DC/DC/DC 6ES7215-1BG40-0XB0 V4.0 Two PROFINET ports; supports NTP as of V4.2
S7-1200 CPU 1217C DC/DC/DC 6ES7217-1AG40-0XB0 V4.0 High-performance CPU; full time instruction set
Comfort Panel TP700 6AV2124-1GC01-0AX0 WinCC Comfort V14 SP1+ Area pointer Date/Time (ID 12)
KTP1200 Basic 6AV2123-1MB01-0AX0 WinCC Basic V14+ Limited area pointer set; verify version
WinCC Runtime Advanced 6AV2104-0... V14+ PC runtime; time source configurable

Reference: Siemens S7-1200 Programmable Controller System Manual (entry ID 109759206).

Root Cause Architecture

Siemens HMI panels and S7-1200 CPUs are designed as independent time masters. By default, the HMI uses its own internal real-time clock and the PLC uses its own buffered RTC. Time-of-day exchange only occurs when one of the following is configured:

  1. An area pointer of type Date/Time (ID 12) is created on the HMI connection and bound to a valid PLC tag.
  2. The PLC user program reads or writes the HMI clock using RD_SYS_T / WR_SYS_T triggered by the area pointer handshake.
  3. The HMI's Time synchronization property is enabled and pointed at the PLC connection.

When none of these is configured, the HMI trend view, alarm view, and tag log all use the panel's internal clock. If the HMI has never received a valid time set (no commissioning PC, no PLC sync, no NTP), its internal clock typically starts at 1970-01-01 00:00:00 — a Linux/embedded epoch artifact carried over from the panel's operating system. The PLC time remains correct because the user manually applied it through Online & Diagnostics, but this value never reaches the HMI.

Engineering note: "Use system time" enabled on an IO field in WinCC refers to the HMI system time, not the PLC clock. The same applies to trend views. The HMI does not automatically discover the PLC and pull its time-of-day.

Diagnostic Procedure

  1. Connect the TIA Portal PG/PC to the S7-1200 and select the CPU in the project tree.
  2. Open Online > Online & diagnostics. The Time of day pane shows two values: Module time (the CPU's RTC) and PG/PC time (the engineering station). If these differ by more than a few seconds, the CPU's RTC is drifting or the backup capacitor has discharged.
  3. Click Apply. If the operation succeeds without an SF (system fault) LED on the CPU, the PLC clock is now updated. Re-check by disconnecting and reconnecting — the value should persist.
  4. Select the HMI in the project tree. Open Online > Online & diagnostics for the panel. The Time of day pane on a Comfort Panel reports the panel's own RTC. If this is stuck at 1970, the HMI has never received a valid time and is the source of the displayed values.
  5. Open the trend view configuration. Inspect the Time source for each trend. The default is HMI. Switch to PLC only if the trend's data block carries a valid time stamp populated by the PLC.

Step 1: Correctly Set the S7-1200 Real-Time Clock

Two methods exist. The first is suitable for one-time commissioning; the second is required if the CPU powers down for longer than the backup capacitor holds.

Method A — Online & Diagnostics (one-time)

  1. In TIA Portal, mark the S7-1200 CPU and choose Online > Online & diagnostics.
  2. Select Time of day in the diagnostics tree.
  3. Verify Module time is the value you want; if not, click Apply PG/PC time to write the engineering station's time to the CPU.
  4. Optionally enable Take from PG/PC (UTC) for projects that handle time zones downstream.

Method B — Programmatic write on power-up (WR_SYS_T)

Deploy a one-shot block in OB100 (warm restart) or OB1 first scan to set the time every time the CPU restarts, or to synchronize from an external source such as a master clock or NTP server. The DTL data type is required.

// SCL — Programmatic time set on first scan
// Declared tags:
//   "mySystemTime"  : DTL   (Temp or Static)
//   "retVal"        : INT   (Return value of WR_SYS_T)

#mySystemTime.YEAR       := 2026;
#mySystemTime.MONTH      := 1;
#mySystemTime.DAY        := 1;
#mySystemTime.WEEKDAY    := 1;       // 1 = Sunday
#mySystemTime.HOUR       := 0;
#mySystemTime.MINUTE     := 0;
#mySystemTime.SECOND     := 0;
#mySystemTime.NANOSECOND := 0;

#retVal := WR_SYS_T(#mySystemTime);
// retVal = 0 on success
// retVal = 1 = time not in range
// retVal = 2 = invalid time-of-day (e.g., Feb 30)
// retVal = 3 = RTC defective / write not executed

Reference: S7-1200 Programming and Operating Manual (entry ID 109751706) — section "Time-of-day functions".

Step 2: Configure HMI Time Synchronization

There are two complementary mechanisms. Use both for robust behavior: the area pointer pushes PLC time to the HMI, and the HMI's own time-of-day property ensures the panel uses that value consistently.

2.1 Enable area pointer Date/Time on the HMI connection

  1. In the project tree, expand the HMI device and select Connections.
  2. Double-click the connection to the S7-1200 CPU to open the editor.
  3. Switch to Area pointers.
  4. Tick Date/Time. Configure as follows.
Parameter Setting
Active
PLC tag "DB_HMI_Sync".HMI_Date_And_Time (DTL, 8 bytes minimum on S7-1200 — use DTL of 12 bytes)
Length 8 bytes for legacy compatibility, 12 bytes for DTL on S7-1200
Acquisition cycle 1 s (default) — adjust if HMI tag update load is high
Direction PLC > HMI (default — PLC writes time-of-day)

The area pointer ID 12 occupies 8 bytes in the PLC for the legacy format or 12 bytes for the DTL format. TIA Portal automatically creates a matching DB tag at the selected location.

2.2 HMI time-of-day property

  1. Select the HMI device. Open Properties > Time settings (Comfort Panels) or Properties > General > Time (Basic Panels).
  2. Enable Time synchronization.
  3. Set the source to PLC and select the connection configured in step 2.1.
Note: On a WinCC Comfort/Advanced Panel, the panel's Control Panel > System > Date/Time screen is a manual fallback only. Production HMI screens should not depend on operators setting the time at the panel.

Step 3: Populate the Date/Time Tag in the PLC

The area pointer does not poll the PLC clock automatically. The PLC program must write the current DTL value into the configured tag periodically. Recommended frequency: every 1 s to 10 s, depending on acceptable skew.

// SCL — Time sync tag update in OB1 (cyclic)
// Declared tags:
//   "HMI_Time"   : DTL    (Static, in DB_HMI_Sync)
//   "clk_1Hz"    : BOOL   (Clock memory, MB100 bit 0 — see Note)
//   "firstScan"  : BOOL   (Static, edge flag)

IF "clk_1Hz" AND NOT "firstScan" THEN
    "firstScan" := TRUE;
    RD_SYS_T(RET_VAL := #retVal, OUT := "HMI_Time");
    "DB_HMI_Sync".HMI_Date_And_Time := "HMI_Time";
ELSIF NOT "clk_1Hz" THEN
    "firstScan" := FALSE;
END_IF;

Clock memory must be enabled in the CPU properties: Device configuration > Properties > System and clock memory > Clock memory byte = MB100. Bit 0 toggles at 1.0 Hz with 50% duty cycle.

Programmatic Time Handling — DTL Reference

The DTL data type occupies 12 bytes. Layout for the tag bound to the HMI area pointer:

Byte Field Type Range / Encoding
0–1 YEAR UINT (little-endian) 1970 to 2554
2 MONTH USINT 1 to 12
3 DAY USINT 1 to 31
4 WEEKDAY USINT 1 = Sunday … 7 = Saturday
5 HOUR USINT 0 to 23
6 MINUTE USINT 0 to 59
7 SECOND USINT 0 to 59
8–11 NANOSECOND UDINT (little-endian) 0 to 999,999,999

RD_SYS_T returns UTC. RD_LOC_T returns local time including daylight saving handling. The HMI applies the panel's configured time zone when displaying. Configure time zone in Control Panel > Language & Region on the panel, or in the project under HMI > Properties > Time.

Time-of-Day Interrupt (Optional)

If the application requires an action at a wall-clock time — for example, a daily log rotation at 23:59:00 — configure a time-of-day interrupt OB (OB10). On S7-1200 firmware V4.0 and later, OB10 supports start time, period (once / minute / hour / daily / weekly / monthly / annually / end of month), and a status word in the OB10 interface.

  1. Add OB10 to the program blocks.
  2. Right-click the S7-1200 in the project tree > Properties > Time of day > enable Time-of-day interrupt.
  3. Set the start time, period, and assign OB10 as the event.
  4. Download hardware configuration.

NTP Synchronization (Firmware V4.2 and Later)

On S7-1200 CPUs with firmware V4.2 or higher (e.g., 6ES7215-1BG40-0XB0 with V4.2.x or V4.4.x), the CPU can act as an NTP client and obtain time-of-day from one to four NTP servers. This eliminates drift and the 1970-epoch condition entirely.

  1. Open the device configuration for the S7-1200 CPU.
  2. Select the PROFINET interface X1 (or X2 on CPU 1217C).
  3. In Properties > Time-of-day synchronization, enable NTP.
  4. Enter up to four NTP server IP addresses and the update interval (default 10 s).
  5. Optionally set the time zone offset and daylight saving rules.
  6. Compile and download the hardware configuration.

Reference: S7-1200 System Manual, section "NTP time synchronization".

Time Synchronization Flow

S7-1200 CPU RTCRD_SYS_T / NTP PLC DB tag (DTL)DB_HMI_Sync.HMI_DT HMI Area PointerID 12 — Date/Time HMI internal clockupdated via area pointer WinCC Trend Viewreads HMI clock Alarm / Audit Logreads HMI clock No path exists by default — must be configured explicitly

Verification Procedure

  1. Compile the TIA Portal project (Project > Compile all) and download hardware and software to both CPU and HMI.
  2. Watch the HMI tag DB_HMI_Sync.HMI_Date_And_Time in online mode. The year field should equal the current year within 1 s of update.
  3. Open the trend view. The first time stamp in the trend buffer should now reflect the current date, not 1970.
  4. Power-cycle the CPU. The buffered RTC should retain the time for the duration supported by the backup capacitor (typical 10 days at 25 °C for V4.0; longer on V4.2+). Confirm by re-checking online & diagnostics after a 60-s power-down.
  5. If a WinCC alarm appears with text containing the time stamp, the alarm time should be correct. Sample alarm text: "Motor overload at 2026-01-15 14:32:18".

Extended Troubleshooting Matrix

Symptom Probable Cause Corrective Action
HMI shows 1970 after PLC Apply No area pointer Date/Time configured Configure area pointer per Step 2.1
Area pointer present, HMI still 1970 PLC tag not being written Add cyclic RD_SYS_T → DB tag in OB1
HMI shows time off by 1 h or 2 h UTC vs local time mismatch, DST not handled Use RD_LOC_T for local, configure DST in HMI region settings
CPU time resets to 1970 on power-up Backup capacitor discharged or absent Charge CPU for 24 h powered; replace CPU if RTC battery absent and time must survive power-down
CPU shows "Access error" on time write Time-of-day is in protected mode (CPU in RUN with write protection) Disable time write protection in CPU properties > Time of day
Trend view time correct, but alarm view wrong Alarm view has its own time source setting Alarm view properties > Time > source = HMI clock
Time correct after restart, drifts fast Crystal aging or firmware bug in early V4.0 Update to current V4.x firmware or use NTP sync
Both PLC and HMI show 1970 after long storage Both backup capacitors discharged Set PLC time, set HMI time via Control Panel or via PLC sync

Related Configuration Caveats

  • WinCC tag logging: The tag log uses the time stamp of the HMI clock at the moment the value is logged. If the HMI clock is wrong, all historical data is wrong even after you fix the clock.
  • Audit trail (WinCC Professional): GMP/audit logs rely on the HMI clock. Sync is mandatory in regulated environments.
  • S7-1200 as PROFINET IO device: When the S7-1200 is a PROFINET device (not IO controller), the higher-level controller may write the time. The Time of day parameter on the PROFINET interface must be set to Synchronize.
  • Multiple panels: If the project has more than one HMI panel, each must have its own area pointer and its own DB tag, or the panels share a single DB tag and the CPU serves all.
  • PC Runtime on Windows: The HMI clock follows the host Windows time. Set the Windows time correctly and enable NTP on the host (Settings > Time & Language > Date & time > Set time automatically > On). See Microsoft Windows Time clock support for host troubleshooting.

Why does the S7-1200 show 1970-01-01 when the HMI displays the 1970 date?

The PLC clock is independent of the HMI clock. When you click Apply in Online & Diagnostics, the PG/PC time is written to the CPU. The HMI never receives that value unless an area pointer Date/Time is configured and the PLC populates the bound tag. Verify the pointer under HMI > Connections > Area pointers and add the cyclic RD_SYS_T block.

Which TIA Portal instructions handle time on the S7-1200?

Use RD_SYS_T and WR_SYS_T for UTC, and RD_LOC_T and WR_LOC_T for local time with time-zone and DST compensation. All four operate on a DTL tag. The return value reports the status: 0 = success, 1 = value out of range, 2 = invalid time-of-day, 3 = RTC write not executed.

What is the S7-1200 RTC backup duration?

On firmware V4.0 and later the real-time clock is buffered by a capacitor, typically retaining the time for approximately 10 days at 25 °C after a full charge. Higher ambient temperature shortens the hold-up time. CPUs with a battery slot (e.g., for 1217C with battery board) extend this to months or years. The PLC clock resumes from 1970-01-01 00:00:00 when the hold-up time is exceeded.

How do I get NTP time sync on the S7-1200?

NTP is supported on S7-1200 CPUs with firmware V4.2 and later. Enable it in the device configuration under the PROFINET interface > Properties > Time-of-day synchronization. Add up to four NTP server IP addresses and a synchronization interval. The CPU updates the RTC from the NTP response.

Can the HMI push time to the PLC instead of the PLC pushing to the HMI?

Yes. In the area pointer configuration, swap the direction so the HMI writes the time to the PLC tag, and have the PLC call WR_SYS_T on each write. This pattern is used when the HMI is connected to a master clock (e.g., a GPS-disciplined PC) and the PLC is the time slave.

Back to blog