Fixing WinCC V6 TagLogging PLC Disconnection at 500ms Cycles

David Krause19 min read
SiemensTroubleshootingWinCC
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 Statement: WinCC V6 SP3 TagLogging Drops One PLC After Approximately 30 Minutes

A WinCC V6.0 SP3 runtime station is connected to four SIMATIC PLCs (S7-300/S7-400 class) over Industrial Ethernet / TCP/IP using the SIMATIC S7 Protocol Suite channel. The project registers 70 process tags in TagLogging with the following configuration that is critical to the failure mode:

Parameter Configured Value Effect on Runtime
Acquisition type Cyclic continuous Triggers unsolicited polling at fixed interval
Acquisition cycle 500 ms 2 polls per tag per second
Archiving cycle 500 ms Switches archive segment every 500 ms
Display cycle 500 ms Forces OnlineTrendControl redraw at 2 Hz
Logged tags 70 Aggregate polling load = 140 tag requests/s baseline
RAM (server) 1 GB Below recommended 2 GB+ for V6 SP3 with TagLogging

Observed runtime behavior:

  1. WinCC runtime starts cleanly; all four PLC connections report OK in WinCC Explorer > Channel Diagnostics.
  2. After approximately 30 minutes of continuous operation, exactly one of the four PLC connections transitions to Disconnected.
  3. The disconnected partner does not recover without an operator action (server restart, channel re-init, or manual reconnect).
  4. Deactivating TagLogging entirely eliminates the disconnection. All four PLCs remain connected indefinitely with the same channel configuration and the same PLC program.

The pattern is consistent with a polling-overload or runtime-resource saturation in the WinCC V6 communication layer, triggered when TagLogging pushes the acquisition cycle down to 500 ms across 70 tags on a server that has only 1 GB of physical RAM and an unspecified number of C-Scripts attached to the same HMI process.

Scope of this article. The corrective actions below were verified on WinCC V6.0 + SP3 (release line circa 2006) on Windows XP Professional / Windows Server 2003 with the SIMATIC S7 Protocol Suite. The same pattern has been observed on V6.2 SP2 and on early WinCC V7.0 builds. WinCC Unified (V18/V19/V20) uses a fundamentally different runtime and is not covered here; consult the TIA Portal cloud reference for the current Unified object model, e.g. TagLogging.LoggedTags() (RT Unified).

Root Cause Analysis: Why 500 ms TagLogging Starves the S7 Channel

Three independent factors compound in the failure case. Each one is recoverable on its own; the combination reliably breaks the connection after 25-40 minutes of runtime.

Factor 1 - Polling-Overload From Cyclic Continuous Acquisition

With acquisition type = cyclic continuous and acquisition cycle = 500 ms, the Data Manager schedules a read request for every logged tag every 500 ms. The theoretical load is:

L_polled = N_tags / T_acq = 70 / 0.5 = 140 tag-reads/s

On Industrial Ethernet / TCP-IP using the SIMATIC S7 Protocol Suite, the S7 communication driver multiplexes these reads onto a smaller number of PDU (Protocol Data Unit) requests. The default maximum PDU size is 480 bytes, and the S7-300/400 driver typically packs 8-12 tag reads into a single PDU. The effective request rate to the channel is therefore:

R_eff = ceil(140 / 10) = 14 PDU/s minimum, plus handshakes

Each PDU also requires an application-level acknowledge. If any of those PDUs is lost (TCP retransmit, switch port flap, broadcast storm), the driver must retransmit and may time out on the partner that was momentarily slow. With a saturated 1 GB server, GC pauses and Data Manager thread starvation cause periodic read-queue backlogs that exceed the 5-second S7 partner timeout. The result: one of the four PLCs is the slowest responder on the segment and is declared disconnected first.

Factor 2 - 1 GB RAM Is Below the V6 SP3 TagLogging Envelope

WinCC V6.0 SP3 documentation specifies a minimum of 1 GB RAM and recommends 2 GB or more for any project that uses TagLogging with sub-second acquisition cycles. The Data Manager caches tag values in shared memory, and the TagLogging runtime buffers uncompressed process values in RAM before they are flushed to the segment file. The memory footprint of 70 tags at 500 ms continuous acquisition is dominated by the segment buffer:

Component Approx. RAM (70 tags @ 500 ms)
Data Manager tag cache ~ 12 MB
TagLogging segment buffer (in-memory) ~ 40-80 MB
OnlineTrendControl historical buffer ~ 30-60 MB
Alarm Logging runtime buffer ~ 8-15 MB
C-Script global heap ~ 5-20 MB (project dependent)
Windows XP / Server 2003 kernel + GDI ~ 350-450 MB baseline
Total typical ~ 450-640 MB working set

On a 1 GB server this leaves ~ 360-550 MB free, which is enough at startup. After 25-40 minutes the Windows working set manager begins trimming the Data Manager pages. Trimming the Data Manager starves the channel threads, which causes PDU timeouts, which causes the S7 driver to tear down the slowest connection. The fact that exactly one PLC drops is the signature: the four PLCs are not equally loaded, and the partner that is the busiest on the S7 partner list is the first to time out.

Factor 3 - C-Scripts and Global Scripts Add Unpredictable CPU Spikes

WinCC V6 executes C-Scripts on a single-threaded scheduler by default. A 10 ms C-Script triggered every second on a saturated CPU is invisible. The same script on a server that is paging or under Data Manager pressure can take 200-400 ms, during which the Data Manager thread is blocked and the read queue backs up. This is the dominant secondary cause observed in this failure class.

WinCC V6 TagLogging Architecture You Need to Understand

Before changing configuration, it is essential to understand the runtime topology. The following inline diagram shows the WinCC V6 data flow for a logged tag:

SIMATIC PLCS7-300 / S7-400 S7 Channel UnitSIMATIC S7 Protocol Suite Data ManagerTag cache + queue TagLogging RTArchive segment OnlineTrendControlDisplay 500 ms C-Script EngineSame thread as DM

The key insight: the Data Manager, the TagLogging runtime, and the C-Script engine share one process (CCEs.exe / WinCC.exe). If any of them stalls, all three stall. The S7 channel unit runs in the same process and shares its read-queue with the Data Manager, so a slow Data Manager manifests as channel timeouts.

Channel Unit Cycle Management: The "By PLC" Checkbox Explained

Inside the SIMATIC S7 Protocol Suite, every connection (logical connection to one PLC) has a System Parameters > Cycle Management tab. The default state is:

Checkbox Default Behavior when ENABLED Behavior when DISABLED
By PLC Enabled (checked) WinCC only reads a tag when the PLC sends a spontaneous update (PUT/BSEND or OPC-UA subscription). Cyclic polling is suppressed. WinCC polls each tag cyclically at the configured acquisition cycle (500 ms here). Polling load is high but predictable.

When By PLC is enabled, the S7 driver only requests a value when the PLC reports that the value changed. The PLC must therefore be programmed to send spontaneous updates for the 70 logged tags. In a typical S7-300/S7-400 program, this is rarely done for 70 tags. What actually happens in the field is that By PLC is enabled, the PLC never sends a spontaneous update, the read queue stays empty, and the runtime appears to work - but if any tag is referenced by a C-Script or by a WinCC picture, the driver falls back to cyclic polling on a per-tag basis, and the read queue becomes unpredictable.

When By PLC is disabled, the S7 driver is told: do not wait for the PLC. Poll the tag on the configured cycle. This produces a higher but fully predictable load on the channel. The benefit is that the partner watchdog never fires, because each read PDU is acknowledged on schedule. The drawback is that the cycle time must be set such that the channel can complete all polls within the cycle window - which is exactly the resource constraint in this project.

Why this fixes the 30-minute drop. With By PLC = enabled, the driver mixes spontaneous reads and fallback cyclic reads, and the S7 partner watchdog for the slowest PLC fires when the Data Manager thread is starved by GC. With By PLC = disabled, the load is uniform, the S7 partner watchdog is satisfied on schedule, and the connection does not time out. This is the single highest-leverage change in the project.

Solution Step-by-Step: Restore Stable Communication With TagLogging Enabled

Apply the changes in the order shown. Each step is independently useful; together they remove the 30-minute failure.

Step 1 - Disable "By PLC" on Every S7 Channel Connection

  1. Open WinCC Explorer on the engineering station and open the server project that is online.
  2. Right-click the channel unit (e.g. SIMATIC S7 Protocol Suite > MPI/Industrial Ethernet > S7 Connection_1) and choose System Parameters.
  3. Open the Cycle Management tab.
  4. Uncheck the By PLC checkbox.
  5. Click OK and confirm the prompt that the change is applied to the runtime project.
  6. Repeat for every S7 connection (Connection_1 through Connection_4 in this project).
  7. Recompile the OS and download the modified project to the runtime server.

Step 2 - Reduce the Acquisition Cycle to a Value the Channel Can Sustain

For four S7-300/400 partners and 70 logged tags, the sustained polling rate on a healthy 1 GB server is approximately 60-80 tag-reads/s. That corresponds to a 1 s acquisition cycle:

Acquisition cycle Theoretical load (70 tags) Verdict on 1 GB / V6 SP3
250 ms 280 reads/s Not sustainable, expect partner drops
500 ms (current) 140 reads/s Marginal, drops after ~30 min on 1 GB
1000 ms 70 reads/s Sustainable, recommended starting point
2000 ms 35 reads/s Comfortable

Set the acquisition cycle to 1000 ms in the TagLogging configuration of the WinCC Explorer. Increase the archiving cycle to 1000 ms at the same time. The display cycle can stay at 500 ms - the OnlineTrendControl interpolates between archived values without forcing a second read from the PLC.

Step 3 - Verify RAM, CPU, and OS Tuning

  1. Confirm physical RAM: wmic memorychip get capacity on the server. If less than 2 GB, schedule a hardware upgrade as the second-priority action.
  2. Open System Properties > Advanced > Performance Settings > Advanced > Virtual Memory. Set the page file to a fixed size equal to 1.5x physical RAM on a dedicated partition.
  3. Disable screen savers and the Windows XP theme engine on the runtime server. Each one can re-introduce GDI pressure that throttles the Data Manager.
  4. In Computer Properties > Start > Auto-start, confirm that only WinCC Runtime is in the auto-start tray. Disable antivirus real-time scanning on the WinCC project directory and on the archive path.

Hardware and RAM Optimization for WinCC V6 SP3

WinCC V6.0 SP3 is a 32-bit process and is therefore limited to a 2 GB user-mode virtual address space on Windows XP / Server 2003 (3 GB with the /3GB boot switch, but this is not officially supported for V6). The usable working set per process is typically 1.2-1.6 GB even on a 4 GB physical server because of the 32-bit address space limit.

Project profile Recommended RAM Recommended CPU Archive disk
≤ 500 tags, 1 s TagLogging, no C-Scripts 2 GB Pentium 4 2.4 GHz / Core 2 Duo 1.6 GHz 10k RPM HDD
≤ 1500 tags, 500 ms TagLogging, light scripts 4 GB Core 2 Duo 2.0 GHz 10k RPM HDD or SSD
≤ 5000 tags, 500 ms TagLogging, heavy scripts 8 GB (with /3GB) Xeon E3 / Core i5 SSD, separate from OS
Redundant WinCC server pair + 2 GB per server vs. single Identical hardware RAID-1 mirror for archives

For the project described here (4 PLCs, 70 tags, 500 ms, 1 GB), the immediate hardware action is to upgrade to 2 GB. This single change is usually enough to stop the 30-minute drops even without any software changes, but Step 1 (disable By PLC) is still required because it removes a class of partner-watchdog failures that can occur on 2 GB as well when the network is loaded.

Diagnose Folder Analysis: Read the Logs Before You Change the Project

Before applying any change, copy the entire ..\wincc\diagnose\ folder from the server. The relevant files are:

File pattern What it tells you Key string to search for
WinCC_SStart_*.log Project start, DLL load order, channel init DM error, channel init failed
WinCC_Server_*.log Runtime events: connection state, partner loss, archive flush connection broken, partner , archive full
ProjectDebug.log C-Script debug output, Global Script traces printf from your C-Scripts
CCES_*.log CCEs.exe (WinCC runtime) start/stop and crashes exception, access violation
ODBC*.log TagLogging archive database layer errors archive segment, DB error
SCS*.* System Console (SCS) trace for the SIMATIC S7 driver S7 driver, timeout, partner disconnected

To analyze the failure timestamp (the moment one PLC drops), use findstr /s /i "disconnect" *.log from the diagnose folder. Cross-reference the line with the WinCC internal event log (WinCC Explorer > Computer > Properties > Events). The first 10 lines after the disconnect timestamp are the highest-value evidence: they tell you whether the driver ran out of resources, whether the partner watchdog fired, or whether a C-Script raised an access violation that took the runtime down.

Do not delete the diagnose folder. Siemens Technical Support uses it as the first evidence when you open a support request. The folder is also useful for post-incident root cause analysis on your own site. The default location is C:\Program Files\Siemens\WinCC\WinCCProject\<project>\diagnose\.

C-Script and Global Script Optimization

Every C-Script in the project competes with the Data Manager for the same WinCC process scheduler. The performance budget on a 1 GB V6 SP3 server is small. Audit the project as follows:

  1. Open WinCC Explorer > Computer > Properties > C-Scripts. List every project function and every action.
  2. For each function that is called from a picture (button, mouse action, value change), measure its worst-case execution time using GetTickCount() at start and end. Print to ProjectDebug.log only when the script exceeds 50 ms:
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
DWORD t0 = GetTickCount();
/* ... your logic ... */
DWORD dt = GetTickCount() - t0;
if (dt > 50)
{
  printf("OnClick slow: %lu ms on %s\r\n", dt, lpszObjectName);
}
}
  1. Move any C-Script that runs faster than 1 Hz to a Global Script scheduled timer at 1 s or 2 s. C-Scripts on a 500 ms trigger should be eliminated unless they are strictly required for the displayed value.
  2. Eliminate SetTagWord / SetTagFloat calls from inside frequently triggered C-Scripts. Each Set* call enqueues a write into the Data Manager and can stall a thread. Use the internal tag direct write API only if you have profiled the call and confirmed the cost.
  3. Avoid MScriptMsg and printf in hot paths. Each call to printf flushes a buffered I/O stream and can take 1-5 ms.

After the audit, the typical finding is that 80 percent of the runtime cost is concentrated in 20 percent of the scripts. Those are the ones to optimize or to reschedule.

TagLogging Configuration Tuning Beyond the Acquisition Cycle

Three additional knobs in TagLogging reduce runtime cost without losing data:

Knob 1 - Switch "Cyclic Continuous" to "Cyclic On Command" or "On Change"

For 70 tags that include 30-40 slow-changing values (setpoints, mode flags, status words), acquisition type = On Change with a tolerance of 0.5 percent of the engineering range reduces the effective read rate to 5-20 reads/s while still capturing every significant transition. The 500 ms cycle is reserved for the 20-30 fast-changing values that genuinely need it.

Knob 2 - Increase the Archiving Cycle Independently of the Acquisition Cycle

The acquisition cycle and the archiving cycle are independent. The recommended split for this project is:

Cycle Recommended value Reason
Acquisition cycle 500 ms (kept for fast values) or 1000 ms Defines how often WinCC reads from the PLC
Archiving cycle 2000 ms Defines how often the in-memory buffer is written to the segment file; 2 s is usually the highest sample rate a human operator can read from a trend
Display cycle 500 ms - 1000 ms OnlineTrendControl interpolates between archived values

The compression effect is significant: a 70-tag archive at 2 s holds 8 hours of data in a single segment of ~ 100 MB, whereas a 500 ms archive holds only 2 hours. The disk I/O cost is therefore 4x lower.

Knob 3 - Use the Single-User Project Mode Only If the Project Is a Standalone Server

WinCC V6 can run in multi-user (client-server) mode or single-user (standalone) mode. Multi-user mode adds the WinCC server-client data exchange to the process and consumes additional RAM. If the project runs on one server that is the only HMI, switch the project type to Single-User Project in WinCC Explorer > Project Properties. This removes the entire client-server data layer from the runtime and frees 30-80 MB of working set.

Network and Switch Configuration for Industrial Ethernet

Even with the WinCC-side optimizations above, a misconfigured switch can re-introduce partner timeouts. Apply the following on the Industrial Ethernet switches that connect the four PLCs to the server:

  1. Use a managed switch (SCALANCE XB-000 / XC-100 / XR-100 class) for the HMI segment. Unmanaged switches drop S7 PDUs under load.
  2. Disable Energy Efficient Ethernet (EEE, IEEE 802.3az) on the HMI ports. EEE introduces a 1-2 ms wake-up latency that can exceed the S7 partner watchdog.
  3. Enable flow control (802.3x) on the server port only, and configure a small ingress buffer on the switch ports that face the PLCs.
  4. Place the four PLCs and the WinCC server in a dedicated VLAN. Broadcast traffic from the office VLAN is the most common source of PDU delay on shared segments.
  5. Enable port statistics / RMON on the switch and check for late collisions, CRC errors, and runts. A single bad cable on one PLC port is enough to make that partner the slowest responder and therefore the first to be dropped.

Verification and Commissioning Checklist

After applying the changes, perform the following verification sequence. The runtime is considered stable only when all six checks pass for at least 8 hours of continuous operation.

  1. Channel diagnostics clean. In WinCC Explorer > Channel Diagnostics, all four connections show green. No "partner lost" entries in the last 8 hours.
  2. TagLogging archive integrity. In WinCC Explorer > TagLogging, the segment is closed cleanly at the configured size. No gaps in the archive timeline.
  3. Diagnose log clean. findstr /s /i "disconnect" *.log from the diagnose folder returns no new entries since startup.
  4. RAM headroom. In Task Manager > Performance, the WinCC process (CCEs.exe) commits less than 800 MB. The system commit charge is less than 1.4x physical RAM.
  5. CPU headroom. In Task Manager > Performance, kernel time + user time averages less than 60 percent of one core over any 5-minute window.
  6. Trend display responsive. Switching the trend display between fast and slow archives returns within 1 second. No "trend not loaded" overlay appears.

If any of the six checks fails, return to the diagnose folder and capture the relevant log lines for the failure window. The two most common residual failures are: (a) insufficient RAM (Step 3 not done) and (b) a slow C-Script on a hot path (Knob 1 not applied).

Troubleshooting Matrix for Recurring Partner Drops

Symptom Likely cause First action Reference
One of four PLCs drops after ~30 min, recovers after server restart Data Manager starvation from 500 ms TagLogging on 1 GB Disable By PLC, increase cycle to 1 s, upgrade RAM to 2 GB This article Steps 1-3
All four PLCs drop simultaneously Network switch / cable / VLAN issue Check switch port stats, disable EEE Network and Switch Configuration section
PLCs drop in pairs (e.g. 1+3, then 2+4) Two physical NICs / two switches - one of them misconfigured Compare ping latency between the two subnets Network and Switch Configuration section
PLCs drop only when a specific picture is open Hot-path C-Script in the picture blocks the Data Manager thread Profile the picture's C-Scripts with the timing pattern in this article C-Script Optimization section
PLCs drop only on the first day of the month TagLogging segment roll-over starves the disk Move the archive path to a separate HDD, exclude from antivirus Diagnose Folder Analysis section
PLCs drop after a specific WinCC picture loads Picture contains a heavy ActiveX control Replace the ActiveX with a WinCC native control, or load the picture on demand C-Script and Global Script Optimization section
Connection drops during a backup of the project directory Antivirus is locking the archive files Exclude the WinCC project and archive directories from real-time AV scanning Step 3 of the Solution section

Long-Term Migration Considerations

WinCC V6.0 SP3 reached end of active support from Siemens years ago. The patterns described in this article (saturation of 32-bit process, partner watchdog fires, Data Manager thread starvation) are intrinsic to the V6 architecture and reappear in different forms on V7.0 and V7.4 when the same project size is forced onto undersized hardware. If the project is being maintained rather than replaced, the right hardware floor is:

  • 2 GB RAM minimum, 4 GB recommended for 4 PLCs and 70 logged tags at 500 ms
  • Industrial-grade managed switch (SCALANCE) on the HMI segment
  • Windows XP Professional x64 or Windows Server 2003 x64, with the V6 service packs that support x64

For new projects, evaluate WinCC Unified (V18 / V19 / V20) on TIA Portal. The Unified runtime is 64-bit, runs the Data Manager in a separate process from the script engine, and exposes the tag logging layer through a documented JavaScript object model, e.g. TagLogging.LoggedTags(). The architectural separation in Unified removes the single-process scheduler contention that is the root cause of the V6 failure pattern.

Frequently Asked Questions

Why does the WinCC V6 SP3 TagLogging cause one of four PLCs to drop after exactly 30 minutes?

With 70 tags at 500 ms cyclic continuous acquisition on a 1 GB server, the Data Manager working set grows until the Windows memory manager trims it. The trim starves the S7 channel unit read queue; the slowest PLC on the segment then exceeds the partner watchdog timeout (default 5 s) and is declared disconnected. The 30-minute figure is the typical time-to-saturation for this project size on 1 GB of RAM.

What does the "By PLC" checkbox in the S7 channel unit actually do?

When By PLC is enabled, the S7 driver waits for the PLC to send a spontaneous update (PUT/BSEND or a subscription-style notification) before reading a tag. When By PLC is disabled, the driver polls every tag on the configured acquisition cycle. The fix for the partner drop is to disable By PLC so that polling is uniform and the partner watchdog is satisfied on schedule.

Can I keep the 500 ms acquisition cycle if I upgrade the server RAM to 2 GB?

Usually yes, but you must also disable By PLC on every S7 connection and audit the C-Scripts. 2 GB is the minimum that supports 70 tags at 500 ms; the next size down (1 GB) is not sufficient for this project profile. If the 500 ms cycle is not strictly required, set the acquisition cycle to 1000 ms and the archiving cycle to 2000 ms for a much larger safety margin.

Where are the WinCC V6 diagnose files located and which ones should I read first?

The default path is C:\Program Files\Siemens\WinCC\WinCCProject\<project>\diagnose\. The highest-value files are WinCC_Server_*.log for connection events, SCS*.* for S7 driver traces, and CCES_*.log for runtime crashes. Search for disconnect, timeout, and partner across the folder to localize the failure timestamp.

Does the same fix apply to WinCC V7.0, V7.4, and WinCC Unified?

The By PLC checkbox and the SIMATIC S7 Protocol Suite exist in V7.0 and V7.4 with the same semantics, so the Step 1 change is directly applicable. WinCC Unified (TIA Portal V18/V19/V20) uses a different runtime architecture; the partner watchdog and the channel unit configuration are exposed through the Unified channel editor and through the runtime object model documented in the TIA Portal cloud, e.g. TagLogging.LoggedTags().

Back to blog