Fixing Slow OPC DA Communication with Simotion C230 and Simatic Net 6.4
1. Problem Statement and Field Symptom
A motion cell built around a SIMOTION C230-2 controller, four SIMODRIVE 611U servo axes, and one distributed I/O node (6FC5611-0CA01-0AA0) over PROFIBUS DP shows the following degradation when supervised from an industrial PC:
- OPC DA
WriteSyncof three Boolean items plus one Integer item takes noticeably longer than the expected millisecond range, with visible jitter. - HMI position values update slowly even though the servo axes themselves are tracking the setpoint correctly.
- Switching the SIMATIC NET server from version 6.4 to 6.3 immediately reduces the perceived latency without any other change to hardware or project data.
The industrial PC hosts a Delphi application that uses the Kassl dOPC component as the OPC DA automation wrapper. The PC is connected to the SIMOTION C230-2 Ethernet port directly (no CP 5611 / CP 1616 communication processor on the PC side). PROFIBUS DP runs only between the controller and its drives / I/O.
2. Data Path and Where the Latency Accumulates
The end-to-end path that one write request has to traverse is:
- dOPC client (Delphi) → COM/DCOM marshalling →
- SIMATIC NET OPC server (PC side) → internal SOFTNET-DP / S7 channel →
- Ethernet TCP/IP → SIMOTION C230-2 onboard PROFINET/Industrial Ethernet interface →
- SIMOTION runtime (interface to user program / system functions) →
- PROFIBUS DP slave update to the 611U drives and I/O node.
Each of those stages has its own cycle budget:
| Stage | Typical budget | Configurable via |
|---|---|---|
| DCOM call setup (RPC, security) | 1–15 ms first call, < 1 ms after | DCOM security, authentication level |
| SIMATIC NET OPC DA wrapper | 1–10 ms per call | Update rate, group mode |
| S7 / SOFTNET channel | 1 cycle | PDU size, connection resources |
| Ethernet TCP/IP | < 1 ms on local LAN | Switch QoS, VLAN |
| SIMOTION command processing | 1–2 servo clocks | Background task, IPO/IPO2 |
| PROFIBUS DP cycle | 1.75 ms (configured) | DP constant bus cycle |
Individually each stage is small. Stacked together with the overhead of synchronous writes (one round-trip per item group), a 3-Boolean + 1-Integer WriteSync call routinely lands in the 20–60 ms envelope, especially when the OPC group is configured with a slow subscription rate or when DCOM falls back to NT LM authentication.
3. Root Cause Analysis
There are five independent root-cause families that all behave like the symptom described. In a real field case they almost always stack on top of each other.
3.1 SIMATIC NET 6.4 server regression versus 6.3
SIMATIC NET 6.4 introduced changes to the S7 channel buffering and to OPC DA group handling that, on some SIMOTION firmware combinations, cause additional latency on synchronous writes and on subscription refresh. A purely OPC server-side symptom of this kind is the one case where rolling back to SIMATIC NET 6.3 + the matching Service Packs / Hotfixes has been observed to restore the original response. This is the single most diagnostic action for the symptom at hand: if performance changes by simply reinstalling the OPC server with an older binary, the problem is on the PC side, not on the controller.
3.2 PROFIBUS DP constant bus cycle time
The "Activate constant bus cycle time" checkbox in HW Config (PROFIBUS DP → Properties → Network Settings) freezes the DP master cycle to the configured value. For a SIMOTION C230-2 driving four 611U drives and one I/O node, a value of 1.75 ms is reasonable, but it must satisfy:
T_DP ≥ n_slaves × T_slave_ack + T_idle
where T_slave_ack includes the worst-case telegram round-trip for a SIMODRIVE 611U (setpoint + actual value, typically 4–6 byte objects on the drive object). If the configured constant cycle is too small, the master will report DP bus errors, retries, and effective cycle stretching, which in turn blocks the SIMOTION command task from completing on time.
Increasing the DP cycle (e.g. to 3 ms or 4 ms) does not improve OPC DA throughput, but it does remove one source of jitter that compounds with DCOM round-trips and makes the OPC layer look "slow".
3.3 SIMOTION background task and servo clock allocation
SIMOTION differentiates the motion-relevant IPO / Servo tasks from the BackgroundTask. The BackgroundTask runs at a lower priority and is given a share of the servo cycle clocks. In the project described, the BackgroundTask is set to 5 servo cycle clocks. Bumping it to 16 clocks has been reported to improve OPC-DA-visible response time slightly because the server-side buffer flush has more CPU time on the SIMOTION side.
Counter-intuitively, increasing the BackgroundTask allocation can hurt real-time motion if the background is doing heavy work; the rule of thumb is:
| Workload character | BackgroundTask level |
|---|---|
| Only OPC mirror / diagnostic variables | 2–4 servo clocks |
| Mixed OPC + small scripts | 5–8 servo clocks |
| Heavy logging or scripting in background | 16+ servo clocks |
3.4 Slave synchronisation on PROFIBUS
Slave-to-slave synchronisation with the DP master clock forces the SIMOTION PROFIBUS interface to align the slave update phase with a global clock. For a SIMOTION C230-2 this is normally deselected unless you are synchronising multiple drives to within a microsecond. Enabling it when not needed costs you one to two DP cycle times of jitter on every write that lands on a synchronised slave. For an HMI position read of a 611U drive, this manifests as 3–10 ms additional visible lag.
3.5 OPC DA group / subscription rate
The dOPC client typically reads at the group update rate. If the Delphi application creates the group with a default rate (often 1000 ms or even longer for legacy dOPC defaults), the position values shown on the HMI cannot update faster than that rate regardless of how fast the underlying server can deliver them. Configure the OPC group to 100–250 ms for position display, and switch to async-advise reads for any item that is only displayed.
4. Step-by-Step Diagnostic Procedure
- Capture a baseline. Use the OPC DA client performance counter of the SIMATIC NET server: in Windows Performance Monitor, add the counter SIMATIC NET OPC Server → Avg. time per write. Record the value before any change.
-
Verify the transport. From the industrial PC,
ping -t <SIMOTION IP>and check thatwinsta.exeorpnconfigshows the S7 connection Established, not Trying to connect. A flapping S7 connection masquerades as "slow writes" because each write triggers a reconnect attempt. - Isolate PROFIBUS from Ethernet. Temporarily disable the "Activate constant bus cycle time" checkbox and observe if the OPC DA write time changes. If it does not, PROFIBUS is not the dominant contributor on the write path; if it does, re-tune the DP cycle.
- Test the SIMATIC NET version. On a non-production image, install SIMATIC NET 6.3 SPx with the same PC Station HW Config, re-test, then 6.4 SPx. Quantify the difference.
-
Profile the Delphi client. In the dOPC wrapper, log the timestamp before and after each
WriteSynccall. If individual items take ~1–2 ms but a group of 4 items takes 30 ms, the issue is per-call overhead, not bandwidth — focus on DCOM and group structure. - Profile the SIMOTION side. In SCOUT / SIMOTION Scout, open the trace viewer and trigger on the relevant user-function calls. Confirm whether the controller actually receives the write request and how many servo cycles elapse before the next IPO/IPO2.
-
DCOM verification. Run
dcomcnfg, ensure the OPC enum entries are reachable, and that Default Authentication Level is Connect (not None or Packet Privacy). Default to Packet Integrity for production.
5. PROFIBUS DP Configuration Reference
For a SIMOTION C230-2 with four 611U drives and one I/O node, the following HW Config parameters are typical and avoid stretching the DP cycle:
| Parameter | Recommended value | Note |
|---|---|---|
| DP constant bus cycle time | 2.0 – 4.0 ms | 1.75 ms is feasible but tight |
| Slave-to-slave communication | Disabled | Unless explicitly required |
| Bus profile | Standard | DP-only monomaster |
| Tslot | Auto / per slave manual | Verify with BT200 scope |
| Max retry limit | 1–3 | Higher values mask cable faults |
| Diagnostic interrupt OB82 | Loaded | Surfaced to SIMOTION HMI |
6. SIMATIC NET Version Behaviour Matrix
| SIMATIC NET version | Behaviour with SIMOTION C230-2 | Recommended for |
|---|---|---|
| 6.2 SP1 | Mature, small footprint | Legacy single-axis cells |
| 6.3 + latest HF | Best balance for classic OPC DA on C230-2 | Recommended for this fault pattern |
| 6.4 + latest SP/HF | Improved diagnostics but slower WriteSync on some firmwares | Only when 6.4-specific feature required |
| 2008 / V8 | OPC DA deprecation begins; OPC UA introduced | New projects |
Refer to the latest SIMATIC NET release notes and Service Pack index on the Siemens Industry Online Support portal for the exact build compatibility matrix. Always install the latest Service Pack and Hotfix level documented for the chosen major version.
7. SIMOTION Background Task Tuning
The BackgroundTask time slice is set in the SIMOTION project under Execution system → Tasks → BackgroundTask → Properties. The parameter of interest is the Task runtime in servo cycle clocks and the monitor time.
- Raise the runtime from 5 to 8–16 clocks if the background hosts OPC mirror variables that are read frequently by the PC.
- Keep the monitor time (the watch-dog) at the SIMOTION default; do not raise it as a "fix".
- Avoid calling heavy FB calls from BackgroundTask that are also called from IPO — the round-robin can stall the OPC update.
8. dOPC Client Configuration Checklist
The Kassl dOPC component is a thin COM wrapper around the OPC DA automation interfaces. Misconfiguration of the wrapper is a common source of "slow write" complaints:
| dOPC parameter | Recommended value | Rationale |
|---|---|---|
Group.UpdateRate |
100–250 ms | Above this, position display lags visibly |
Group.IsActive |
True after AddItems | Required for async-advise to fire |
Group.IsSubscribed |
True for read-only items | Use False for write-only items to halve traffic |
WriteSync |
Only on critical writes | Use WriteAsync for HMI display updates |
ItemDef.CanonicalDataType |
Match server type | Mismatch forces type coercion on every read |
| Local Server | Prefer to remote | Avoids DCOM for in-process cases |
8.1 Replace WriteSync with batched WriteAsync where possible
For HMI position display, prefer WriteAsync for non-critical setpoints. WriteSync blocks the Delphi thread until the OPC server returns an acknowledgment; on a slow channel this is the dominant contributor to perceived latency. The OPC DA IOPCSyncIO::Write call always incurs a server round-trip.
9. DCOM and Windows Security Layer
OPC DA Classic is built on top of COM/DCOM. On Windows 7 and later with default DCOM settings, an OPC call from a Delphi process to the SIMATIC NET server incurs an RPC over TCP/IP. If the Windows firewall is active, the dynamic port range must be opened or dcomcnfg restricted to a fixed port range. Three settings that fix 80% of "first call slow / steady state slow" issues:
- In
dcomcnfg→ My Computer → Default Properties → Default Authentication Level → Connect. - Default Impersonation Level → Identify for read, Impersonate for write.
- SIMATIC NET OPC Enum CLSID added to Windows Defender firewall exception.
10. Verification Procedure
- With the SIMATIC NET 6.3 server active and the dOPC group set to 250 ms, measure the steady-state write latency in a loop of 1000 calls. Expected: < 10 ms per WriteSync for a 4-item group on a healthy LAN.
- Subscribe to the same 4 axis position items at 250 ms update rate and confirm the screen redraw is smooth. Expected: visible refresh every 250 ms ± 50 ms.
- Open SCOUT → Trace → record the OPC-relevant variables at the same time as the client timestamp log; the two traces must align within one servo clock.
- Pull a 30-second Wireshark capture of the S7 connection between the PC and the SIMOTION C230-2; confirm no retransmissions on TCP and no diagnostic interruption frames on the underlying ISO-on-TCP / TPKT layer.
11. Troubleshooting Matrix
| Observed | Likely cause | Action |
|---|---|---|
| First call slow, subsequent fast | DCOM authentication / firewall | Lower Default Authentication Level, open firewall |
| All calls equally slow, version swap fixes it | SIMATIC NET server regression | Roll to known-good version + SP/HF |
| Writes slow, screen refresh smooth | WriteSync or per-item overhead | Batch writes, raise group update rate |
| Screen refresh slow, writes fine | Subscription rate or DP slave sync | Lower group rate, disable slave sync |
| Position values oscillate in trace but lag on HMI | BackgroundTask starved | Raise background time slice |
| DP bus errors in SIMOTION diagnostic buffer | Constant DP cycle too tight | Raise constant bus cycle to 3–4 ms |
12. Long-Term Recommendation
OPC DA Classic on top of DCOM is not a real-time protocol. For new cells based on SIMOTION C230-2 (or successors), prefer:
- OPC UA directly on the SIMOTION controller (SIMOTION supports OPC UA server in firmware ≥ V4.4 on the C230-2), removing the SIMATIC NET hop entirely.
- PROFINET instead of PROFIBUS DP if the drive line-up is replaced by SINAMICS S120 with PROFINET IRT.
- When OPC DA must stay, ensure both ends are pinned to a known-good SIMATIC NET version + the highest available Service Pack / Hotfix combination for that major version, and the PC Station HW Config matches.
FAQ
Does the PROFIBUS DP cycle time directly affect OPC DA speed?
Only indirectly. The DP constant bus cycle time governs the master-to-slave update phase; if it is too small it generates retries and bus errors, which back-pressure the SIMOTION command task and add jitter to OPC-visible writes. The OPC DA write path itself goes through Ethernet and the S7 channel, not through PROFIBUS.
Should I enable slave-to-slave synchronisation on the SIMOTION C230-2?
No, unless you specifically need sub-millisecond synchronisation between the 611U drives. Enabling slave synchronisation when not required adds 3–10 ms of jitter per write that lands on a synchronised slave and is a common source of "slow OPC" reports.
Why is SIMATIC NET 6.4 slower than 6.3 on SIMOTION C230-2?
SIMATIC NET 6.4 changed the S7 channel buffering and the OPC DA group scheduler. On some SIMOTION firmware combinations these changes interact poorly and add latency to synchronous writes and subscription refresh. Rolling back to 6.3 with the matching Service Pack and Hotfix restores the older behaviour. Always install the latest documented SP/HF for the major version chosen.
How do I measure OPC DA write latency accurately?
Take a high-resolution timestamp (QueryPerformanceCounter) immediately before and after the dOPC WriteSync call in the Delphi application, average over at least 1000 calls, and compare to the SIMATIC NET performance counter SIMATIC NET OPC Server → Avg. time per write. The two numbers should agree within ± 1 ms on a healthy channel.
What update rate should the dOPC group use for axis position display?
100–250 ms is the sweet spot for HMI display. Below 100 ms you get diminishing visual return and increased server load; above 500 ms the position movement looks visibly stuttered. For control-relevant writes keep them synchronous, for display-only items prefer WriteAsync or subscribed reads.