Resolving LOGO! OBA8 RTC Time Read via VM Mapping and OPC

David Krause11 min read
OPC / OPC UASiemensTroubleshooting
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: LOGO! OBA8 RTC Time Not Readable Through Standard VM Mapping

A field engineer integrates a Siemens LOGO! 8 OBA8 (article numbers 6ED1052-1MD08-0BA1, 6ED1052-2MD08-0BA1, etc.) with SIMATIC WinCC 7.2 through a third-party OPC server (IBH, Kepware, or Softing). The engineer wants to monitor the LOGO!'s internal real-time clock (RTC) — date and time — inside a WinCC tag database so that the SCADA mimics show "PLC time" and a centralized time stamp can be archived.

The LOGO! Soft Comfort VM (Variable Memory) mapping table in the project editor only exposes user-programmable addresses VM0 through VM850. The RTC values physically live in VM986 and above — outside the editable user range. The engineer cannot enter VM986 as an OPC tag address because the LOGO! Soft Comfort address selector caps at 850 and the LOGO! runtime refuses read/write requests from the user program to those high addresses.

The symptom is straightforward:

  • OPC server enumerates user variables in the 0–850 window correctly.
  • OPC server cannot resolve tags such as VM986 (RTC year), VM987 (RTC month), or any system clock cell.
  • WinCC tag is created with status "Address not found" or returns quality "BAD" (0xC0).
  • The LOGO! program itself cannot read or write that VM range — only the operating system and external clients can.
Critical constraint: The LOGO! firmware 0BA8 reserves VM851–VM1023 for internal system data (RTC, astronomical clock outputs, analog I/O status, run-time meters, etc.). The LSC editor hides them from the user block interface. Any client wishing to read them must address the LOGO! through an external communication channel — never from the LOGO! circuit program.

Root Cause: VM 851–1023 Is System-Reserved, Not User-Editable

According to the LOGO! 8 System Manual (0BA8 Standard / 0BA8 FS4), the LOGO! 8 basic module partitions its variable memory into three regions:

Range Owner Access From LSC Circuit Program Access From External Client (OPC, HMI, S7)
VM0 – VM850 User program Read/Write Read/Write
VM851 – VM974 System reserved (input/output images, run-time/hours counters, analog thresholds) Read-only through special functions Read-only
VM975 – VM1023 System reserved (RTC, astronomical clock, status words) Not accessible Read-only

The RTC registers occupy the upper sub-region. Documented cell layout for firmware 0BA8 (FS4, ES FIRMWARE 1.16.x and later) is:

VM Address Content (Decoded) Encoding Valid Range
VM990 RTC status (validity / DST flag) Bit field 0x00 – 0x03
VM991 Day of week 1 = Mon … 7 = Sun 1 – 7
VM992 Second BCD or INT (model dependent) 0 – 59
VM993 Minute BCD or INT 0 – 59
VM994 Hour BCD or INT, 24-hour mode 0 – 23
VM995 Day BCD or INT 1 – 31
VM996 Month BCD or INT 1 – 12
VM997 Year (2-digit) BCD or INT, offset from 2000 0 – 99 (= 2000 – 2099)
Field verification: Open the LOGO! Soft Comfort Online > VM Mapping dialog with a live connection to the OBA8 base module. Sort by address ascending. The VM addresses 990–997 will display values that update every second when the LOGO! is in RUN. If the cells are static or read 0xFF, the battery is missing/dead and the RTC is uninitialized.

The discrepancy at the user's site is therefore not a bug: the LOGO! operating system simply will not let any program-driven block read VM990–VM997. Only the OS uses them. External clients must ride on top of one of the LOGO!'s published communication protocols.

LOGO! OBA8 Communication Channels That Expose VM 851–1023

The LOGO! 8 base module (any 0BA8 variant) provides four client-reachable communication paths. The user only needs one of them.

  1. S7 PUT/GET (TCP port 102) — Passive server on the LAN. The LOGO! publishes the entire VM space (0–1023) including RTC. Any S7-1200, S7-1500, WinAC, PC station with SIMATIC NET OPC, or third-party OPC server (IBH Link, Kepware Siemens TCP/IP Ethernet, Softing S7/S5 OPC, LibNoDave-based tools) can poll VM990+ directly.
  2. Modbus TCP (TCP port 502) — The LOGO! 0BA8 firmware exposes a Modbus TCP server. Holding registers map 1:1 to VM addresses (400001 + offset).
  3. LOGO! Web Server (HTTP port 80) — Read-only HTML pages; not suitable for SCADA tags but useful for manual verification.
  4. LOGO! HMI Synchronization (HTTP-based JSON) — The Siemens sample described in the engineering notes forwards VM990+ to a Siemens HMI or any HTTP client. Detailed below.

Solution Path A — OPC DA Bridge via S7 PUT/GET

This is the canonical solution when WinCC 7.2 is the SCADA and a third-party OPC server is already in use for the LOGO! integration.

Step 1: Verify LOGO! Network Configuration

  1. Open LOGO! Soft Comfort > Tools > Ethernet Connections.
  2. Assign a static IP inside the SCADA subnet, e.g. 192.168.10.20 / 255.255.255.0.
  3. Set Allow S7 PUT/GET Communication = Enabled (default on 0BA8 firmware ≥ 1.16, but verify in Web Server > Security).
  4. Save and download to the base module.

Step 2: Confirm OPC Server Reaches VM990+

The OPC server's tag database must be addressed in S7 absolute syntax, not LOGO! VM syntax. Convert as follows:

LOGO! VM S7 DB1 Address (byte.bit) Modbus Holding Register
VM990 DB1.DBX990.0 (byte 990) 400991
VM991 DB1.DBX991.0 400992
VM992 DB1.DBX992.0 400993
VM993 DB1.DBX993.0 400994
VM994 DB1.DBX994.0 400995
VM995 DB1.DBX995.0 400996
VM996 DB1.DBX996.0 400997
VM997 DB1.DBX997.0 400998

OPC tag configuration example (Kepware Siemens TCP/IP Ethernet driver):

Channel1.Device1.RTC_Second    = DB1,BYTE,992   (scaling 0-59)
Channel1.Device1.RTC_Minute    = DB1,BYTE,993   (scaling 0-59)
Channel1.Device1.RTC_Hour      = DB1,BYTE,994   (scaling 0-23)
Channel1.Device1.RTC_Day       = DB1,BYTE,995   (scaling 1-31)
Channel1.Device1.RTC_Month     = DB1,BYTE,996   (scaling 1-12)
Channel1.Device1.RTC_Year      = DB1,BYTE,997   (offset +2000)
Channel1.Device1.RTC_DoW       = DB1,BYTE,991   (scaling 1-7)
Channel1.Device1.RTC_Status    = DB1,BYTE,990   (bit0=valid, bit1=DST)
Byte order: The LOGO! returns RTC values as unsigned 8-bit integers in BIG-endian byte order. OPC servers configured for S7 communication already expect BIG-endian byte ordering for byte-oriented tags. If you accidentally select little-endian (Intel), the value will appear inverted in only a subset of cells (e.g. year 23 displays as 32). Switch the driver to "byte swap = none".

Step 3: Connect OPC DA to WinCC 7.2

  1. In WinCC Explorer, right-click Tag Management > Add New Driver > OPC > OPC DA.
  2. Browse the local/remote OPC server you created in Step 2 (e.g. Kepware.KEPServerEX.V6).
  3. Import the RTC tags listed above into the WinCC tag database.
  4. Set the update cycle to 1000 ms (1 s) — the RTC changes only once per second.
  5. Format the tags as 16-bit unsigned integer and create computed WinCC tags for human-readable text output.

Computed WinCC tag for full timestamp string:

'20' + RIGHT('00'+ TEXT(RTC_Year),2) + '-' +
RIGHT('00' + TEXT(RTC_Month),2) + '-' +
RIGHT('00' + TEXT(RTC_Day),2) + ' ' +
RIGHT('00' + TEXT(RTC_Hour),2) + ':' +
RIGHT('00' + TEXT(RTC_Minute),2) + ':' +
RIGHT('00' + TEXT(RTC_Second),2)

Solution Path B — LOGO! HMI/JSON Synchronization Sample

Siemens publishes a downloadable sample that scripts an external application (HMI runtime or a small PC utility) to read VM990+ via the LOGO!'s HTTP/JSON interface. The archive is referenced in the LOGO! 8 application examples library:

LOGO! 8 System Manual — Section 4.6 "Communication via Ethernet"

Key steps from the sample (clock_synchronization_logo_hmi.zip):

  1. Open the LOGO! Web Server (HTTP port 80). Authenticate with the Web Server password configured in LSC > Tools > Ethernet Connections.
  2. Issue GET /logo.cgi?VM990&VM991&VM992&VM993&VM994&VM995&VM996&VM997.
  3. Parse the JSON response. Sample payload (truncated):
    {
      "VM990": 1,
      "VM991": 3,
      "VM992": 47,
      "VM993": 12,
      "VM994": 9,
      "VM995": 18,
      "VM996": 6,
      "VM997": 25
    }
  4. Forward the parsed values to a Siemens HMI Comfort/ Unified tag database through a SIMATIC S7-1200 gateway, or to WinCC via OPC after republishing them on a S7-1200 DB.
Authentication: The LOGO! 0BA8 Web Server is OFF by default. Enable it in LSC under Tools > Ethernet Connections > Web Server Access > Enable. Set a strong password. Without this, the HTTP GET above returns 401 Unauthorized and the OPC client sees no data.

Solution Path C — Direct Modbus TCP Poll from WinCC

If the user's third-party OPC server does not support S7 PUT/GET, fall back to Modbus TCP:

  1. Enable Modbus TCP server on LOGO! 0BA8 (LSC > Tools > Ethernet Connections > Modbus TCP = Enabled).
  2. Add the Modbus TCP driver in the OPC server; target IP = LOGO!, port = 502.
  3. Create tags with offset 990 (holding register 400991 maps to VM990). Function code 0x03 (Read Holding Registers).
  4. For the entire 8-byte RTC block, request holding registers 400991–400998 in a single transaction to avoid inter-second skew.

Polling rate should not exceed 1 Hz — the RTC changes once per second and excessive polling wastes the LOGO!'s single-threaded Ethernet stack.

Verification Procedure

  1. Loopback test: In LSC online mode, navigate to View > VM Mapping. Confirm VM990 changes from 0 to 1 after a power cycle (validity bit), and VM992 increments every second.
  2. OPC client quick-check: Install Matrikon OPC Explorer or OPC Quick Client. Connect to the OPC server and add the seven RTC tags. They must return Good quality with values incrementing each second.
  3. WinCC tag diagnosis: Open WinCC Tag Management > RTC_Second > Properties > Diagnostics. Quality code must be "Good (0xC0)". If it shows "Bad (0x00)", the OPC subscription failed — check DCOM permissions on the OPC server host (Windows component services).
  4. Power-cycle stress test: Disconnect LOGO! main power for 5 minutes, restore. RTC must resume within ±60 s (LOGO! internal capacitor backup is rated for ~80 h; coin cell if fitted extends to ~2 years). If values reset to default (00:00:00 01-01-2000), replace the CR2032 backup cell — part number for OBA8 battery holder: 6ED1057-1BA00-0AA0.
  5. Visualization test: Add a WinCC I/O field bound to the computed timestamp tag. Force a WinCC picture change. The displayed string must update in real time.

Troubleshooting Matrix

Symptom Likely Cause Action
OPC tag VM990 returns quality BAD S7 PUT/GET disabled on LOGO! 0BA8 Enable in LSC > Ethernet Connections; reload program
OPC tag returns 0xFF for all RTC cells RTC not initialized / battery dead Set LOGO! clock from LSC menu; replace CR2032 backup cell
OPC tag returns stale data, no updates OPC subscription polled at <1000 ms on a busy CPU Increase update rate to 1000 ms; reduce tag count
WinCC shows year 2032 instead of 2023 Byte-swap mismatch in driver Disable byte swap in OPC tag properties
HTTP GET returns 401 Unauthorized Web Server not enabled or wrong password Enable Web Server in LSC; configure user/password
Modbus TCP connection refused on port 502 Modbus server disabled or firewall blocked Enable Modbus TCP in LSC; open TCP 502 inbound on Windows firewall
DCOM error 0x80070005 in WinCC diagnostics OPC server DCOM not configured for anonymous access Add the WinCC service user to OPC server's Launch/Access permissions
VM990+ values change but WinCC tag shows constant WinCC tag datatype mismatch (BOOL vs BYTE) Change WinCC tag datatype to Unsigned 8-bit
Tags work in OPC Quick Client but fail in WinCC WinCC runtime not a member of "Distributed COM Users" group Add account via Component Services > Computers > My Computer > DCOM Config

Field-Proven Caveats

  • The LOGO! 0BA8 firmware before v1.16.00 does not allow external clients to read system VM (851+). Update firmware via the LOGO! Soft Comfort update tool before commissioning the OPC RTC link.
  • Do not attempt to write VM990–VM997 from the OPC client. The OS owns these cells; an OPC write returns quality GOOD momentarily but the OS overwrites the value within one scan. Use the LOGO!'s dedicated clock-setting path (LSC menu or Web Server > Set Clock) instead.
  • The LOGO! does not support SNTP/NTP time synchronization out of the box on 0BA8 firmware. Use the LOGO! as the master clock, or implement NTP on an upstream S7-1200 and write the corrected time to VM990–VM997 via S7 PUT/GET (the OS accepts the writes).
  • The user's third-party OPC server (mentioned as "ibh software") is a valid S7/LOGO! driver but only exposes user VM by default. Toggle the address-range setting in its INI configuration to enable access to VM851+.

FAQ

Why does the LOGO! Soft Comfort VM mapping table stop at VM850 if the LOGO! actually has more memory?

VM851 through VM1023 are reserved by the LOGO! 8 OBA8 operating system for the real-time clock, astronomical clock, run-time meters, and I/O status. The LSC editor hides them from the user because the user program cannot read or write them — they are OS-owned. Only external communication clients (OPC, HMI, S7 PUT/GET, Modbus TCP, HTTP/JSON) can access them.

Which VM address holds the LOGO! 0BA8 real-time clock seconds, minutes, hours?

For firmware 0BA8 (FS4, v1.16.x and later), VM992 holds seconds, VM993 holds minutes, and VM994 holds hours (24-hour integer 0–23). VM995, VM996, and VM997 hold day, month, and two-digit year respectively. VM991 holds day-of-week (1 = Monday). All values are unsigned 8-bit integers.

Can I read VM990+ directly from WinCC 7.2 without an OPC server?

No. WinCC 7.2 does not include a native Siemens TCP/IP Ethernet driver for LOGO! 8. You must use either the SIMATIC NET OPC server (installed with WinCC) or a third-party OPC server that supports S7 PUT/GET or Modbus TCP. The IBH, Kepware, and Softing drivers are all field-proven for this exact use case.

The RTC values return 0xFF or 0 — is the LOGO! battery dead?

Probably. The LOGO! 0BA8 uses a CR2032 coin cell in the battery compartment on the CPU module (article 6ED1057-1BA00-0AA0). After a power loss with a dead/missing cell, the RTC falls back to 00:00:00 on 01-01-2000 and the validity bit (VM990) reads 0. Replace the cell and re-set the clock via LOGO! Soft Comfort > Tools > Set Clock.

How fast should I poll the RTC tags to avoid loading the LOGO! Ethernet stack?

Poll no faster than once per second (1000 ms). The RTC changes only once per second and the LOGO! 0BA8 CPU is single-threaded for Ethernet — aggressive polling (e.g. 100 ms) wastes CPU cycles and can starve the Web Server. Configure the OPC server's subscription dead-band to 0 and rely on the driver's natural scan rate.

Back to blog