Troubleshooting Beckhoff CX9020 PLC Disconnection with VISU

Stefan Weidner10 min read
BeckhoffPLC HardwareTroubleshooting
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 Overview

The Beckhoff CX9020 embedded PC is a compact, fanless ARM-based controller running Windows Embedded Compact 7 (WEC7/CE 7) with the TwinCAT 2 or TwinCAT 3 automation suite. Under the combined load of TwinCAT PLC + TwinCAT VISU (HMI/WebVisualization) + TwinCAT CNC/Motion tasks, the controller periodically drops the programming connection, the HMI connection, and any active ADS routes. Operators observe the engineering environment reporting an "Internal Error" or a "Comm Error Station 1" message (e.g. from a connected SCADA/HMI driver such as Beijer iX) followed by a full route teardown. The fault recovers after several seconds, but the recurring cycle makes stable commissioning and runtime operation impossible.

This article documents the root cause as confirmed by Beckhoff technical support, the parameter changes that mitigate the fault on the existing firmware, and the verification steps required to confirm a stable runtime.

Affected Hardware and Software

Component Specification / Version
Controller Beckhoff CX9020-0110 / CX9020-0120 (ARM Cortex-A8, 1 GHz)
Operating system Windows Embedded Compact 7 (WEC7)
Runtime TwinCAT 2 (Build 4024.x) or TwinCAT 3 (1.x)
Engineering TwinCAT 2 PLC Control / TwinCAT 3 XAE (Visual Studio shell)
Concurrent tasks PLC task, TwinCAT VISU, TwinCAT CNC or Motion (PTP/NCI)
Symptoms Programming port drops, ADS route removed, "Comm Error Station 1"

Refer to the official CX9020 Embedded PC documentation for the full hardware datasheet, environmental limits, and TwinCAT tasking model. The CX9020 system manual explicitly states that embedded controllers must call time-critical function blocks from the fastest PLC task and that non-critical services should be executed on a slower or idle-priority task to avoid real-time starvation.

Observed Symptoms

  1. Programming connection to the CX9020 drops spontaneously after 2–10 minutes of operation.
  2. The TwinCAT System Manager reports an "Internal Error" on the AMS router or an "ADS error: Device not found (1792)" / "Port disabled" message.
  3. SCADA / HMI clients (for example Beijer iX referencing the CX9020) raise a "Comm Error Station 1" alarm at the same instant.
  4. The PLC program continues to execute for a short time after the link drops, then the entire runtime halts once the watchdog or TwinCAT safety shutdown completes.
  5. After the controller restarts (manually or via TwinCAT reload), the fault repeats within minutes.

Root Cause Analysis

The root cause is a real-time scheduler starvation on the CX9020. The controller is a single-core ARM Cortex-A8 with 1 GB of DDR3 RAM and the WEC7 kernel. The TwinCAT real-time kernel pre-empts all Windows CE processes, but when TwinCAT PLC + TwinCAT VISU + TwinCAT CNC/Motion are active, the following pressure points are hit simultaneously:

1. VISU cycle binding

TwinCAT 2/3 WebVisualization and the CE-based HMI process re-render pages on every PLC task cycle. When the PLC task is set to Freewheeling (cycle time = 0), the visualization can request a refresh every 100 µs – 1 ms, flooding the CE7 graphics subsystem and starving the AMS router thread. This is the leading cause of ADS route drops.

2. Motion / CNC task priority conflict

TwinCAT CNC (TF5050) and the Motion libraries (TF5100) install a high-priority real-time task for interpolator setpoint generation. If the PLC task is also configured at the same base priority or at a higher priority than the NC task, the NC interpolator misses setpoint windows, the NC watchdog opens, and TwinCAT initiates a global stop that also removes the ADS route.

3. CE7 process starvation

The Windows CE 7 scheduler suspends non-real-time threads when the real-time load exceeds roughly 70 % of CPU time. The AMS router and the TCP/IP stack (used by the engineering connection) both run in the Windows process domain. When CE7 throttles them, the engineering client times out, the AMS port becomes unresponsive, and TwinCAT reports an internal error.

4. Confirmed by Beckhoff support

According to Beckhoff technical support, the CX9020 on WEC7 has known scheduler behavior when PLC + VISU + Motion are running together. The vendor has stated that improvements are scheduled for future TwinCAT builds; the workaround on existing firmware is to decouple the task configuration so the PLC and the HMI/NC workloads do not compete for the same scheduler slot.

Solution 1 – Decouple the PLC task from freewheeling

Change the main PLC task from freewheeling to a fixed cycle time. A 10–20 ms cycle is the typical starting point for PLC + HMI combinations; a 50–100 ms cycle is recommended when CNC or motion is also present.

  1. Open the PLC project in TwinCAT PLC Control (TwinCAT 2) or in the TwinCAT 3 XAE project tree.
  2. Select Resources → Task Configuration (TwinCAT 2) or PLC → Task Configuration (TwinCAT 3).
  3. Set the main PLC task cycle time to t#20ms for PLC-only systems, or t#100ms when VISU + CNC/Motion are running in parallel. Use the IEC syntax shown:
// TwinCAT 2 task configuration
MAIN_TASK  :  TASK  PERSISTENT  PRIORITY := 1, INTERVAL := T#20ms;

The PRIORITY field controls scheduling; keep it at 1 (default) so the NC task at priority 0 can pre-empt it. The INTERVAL value of 20 ms (or 100 ms for VISU+CNC) is the mandatory decoupling step.

Solution 2 – Bind visualization to a slower refresh

TwinCAT VISU has its own update task. When running on CE7, force the visualization to read the PLC variables at the new 20–100 ms interval rather than at every PLC cycle.

  1. Open the visualization editor.
  2. Select TargetVisualization → Properties → Update.
  3. Set the polling rate to match the PLC task interval, e.g. 100 ms for a 100 ms PLC task. Disable the "Trigger by variable change" option for non-critical screens.
  4. Reduce the number of simultaneously animated elements per page. Beckhoff's CE7 HMI can drop the route when more than ~250 dynamic elements are bound on a single page.

Solution 3 – Re-prioritize the NC / Motion task

Ensure the TwinCAT NC task has a strictly higher priority than the PLC task so the interpolator is never delayed by PLC logic.

// TwinCAT NC task configuration (System Manager)
SAFEDATA  :  TASK  PRIORITY := 0, INTERVAL := T#2ms;

Priority 0 is the highest in TwinCAT. The PLC task at priority 1 (default) will be pre-empted by the NC task, eliminating the NC watchdog trips.

Solution 4 – Reduce ADS route load

  1. In TwinCAT System Manager → Routes, add a static route from the engineering PC to the CX9020 with the controller's MAC address, not just its IP. This prevents route re-resolution storms when the CE7 TCP/IP stack is throttled.
  2. Disable the TwinCAT broadcast scanner if multiple CX9020 are on the same subnet: Add Route → Add Route dialog → uncheck "Perform broadcast search".
  3. Lower the engineering PC's ADS router poll interval from the default 1 s to 5 s if the project is read-only during commissioning:
// Engineering PC registry
[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCATSystemManager\Router]
"PollIntervalMs"=dword:00005000

Solution 5 – Re-license and runtime checks

Confirm the TwinCAT licenses for PLC, VISU, and CNC are all installed and matched to the CX9020's system ID. A missing or mismatched license on the CE7 image will fall back to demo mode and forcibly stop the runtime every 10 minutes. Verify with:

tclicense -list

Run this from the CX9020 CE7 command shell (started via telnet on port 23 or via the Beckhoff FTP service). The output must list the PLC, OPC, and CNC/Motion license IDs that match the dongle or the OEM license file.

Configuration Matrix

Scenario PLC Interval NC Priority VISU Refresh Route Behavior
PLC only 10–20 ms — 20 ms Stable
PLC + VISU 20–50 ms — 50 ms Stable
PLC + VISU + Motion 50–100 ms 0 (NC) 100 ms Stable after fix
PLC + VISU + CNC 100 ms 0 (NC) 100 ms Recommended baseline
Freewheeling + VISU + Motion 0 (freewheeling) 1 (default) cycle-locked Route drops (FAULT)

Verification Procedure

  1. Boot the CX9020, log in, and confirm the new task configuration is loaded by checking PLC → Task Configuration → Active Interval in the online view.
  2. Open TwinCAT System Manager on the engineering PC and add the static route.
  3. Connect the programming environment. Verify that the AMS state stays at RUN for at least 30 minutes under full VISU + Motion load.
  4. Watch the CE7 performance monitor: right-click on the desktop → Task Manager → Performance. CPU usage must remain under 75 % on the real-time side; above that, the AMS router will start dropping packets again.
  5. From the engineering PC, ping the controller every 5 s for 30 minutes. All pings must succeed, and ADS routes must remain green.
  6. Run the on-board diagnostic: tcstat -cpu -rt in the CE7 shell. Real-time utilization must stay below 70 % at the chosen cycle time.

Troubleshooting Matrix

Observed Fault Likely Cause Corrective Action
"Internal Error" on the AMS router Freewheeling task overloading CE7 Set PLC task to T#20ms or T#100ms
"Comm Error Station 1" on HMI/SCADA ADS route removed by scheduler Add static route, raise VISU refresh to 100 ms
NC watchdog trip (F-0087) NC task delayed by PLC task Set NC task priority to 0, PLC to 1
Runtime stops every 10 minutes Demo license countdown Install OEM/USB license; verify with tclicense
Route drops only when a specific HMI page is open > 250 dynamic elements on that page Split the page, reduce variable bindings
Connection drops after TwinCAT reload only Route not persisted Add static AMS route in System Manager
ADS error 1792 (Port disabled) CE7 throttling AMS thread Increase PLC interval; check CPU load

Firmware and Hardware Notes

Power and ESD safety: Always disconnect the CX9020 from the power supply before opening the housing or connecting/disconnecting field wiring. ESD precautions must be observed. Reference: CX9020 Embedded PC manual, chapter "Mounting and Wiring".

The CX9020 ships with TwinCAT 2 Build 4024 by default. The Beckhoff TwinCAT 3 (TC3) build 4024.x line is compatible when the controller's CE7 image includes the TC3 supplement. Beckhoff has stated that improvements to the PLC + VISU + Motion coexistence on CE7 are scheduled for future TwinCAT releases. Until those are available, the task configuration changes documented above are the supported workaround.

If the controller still drops the connection after applying all five solutions, escalate to Beckhoff support with the following data packet: TwinCAT build number, task configuration export (.tcm), CE7 event log (ceeventlog.evt), the output of tcstat -cpu -rt -net, and a network capture of the ADS/AMS traffic at the time of the drop (Wireshark with the Beckhoff AMS dissector).

FAQ

Why does my Beckhoff CX9020 disconnect when I run PLC + VISU + Motion together?

The single-core ARM Cortex-A8 CPU in the CX9020 cannot sustain a freewheeling PLC task while also serving the CE7 graphics subsystem for VISU and the NC interpolator for Motion. The Windows CE 7 kernel throttles the AMS router thread, which removes the active ADS routes and drops the programming connection. Beckhoff has confirmed this as a known internal scheduler behavior on this controller.

What PLC cycle time should I use for PLC + VISU + Motion on the CX9020?

Set the main PLC task to a fixed interval of T#100ms (or T#50ms minimum) instead of freewheeling. Keep the TwinCAT NC task at the highest priority (priority 0) and the PLC task at priority 1. This decouples the visualization refresh from the PLC scan and prevents the NC watchdog from tripping.

How do I fix the "Comm Error Station 1" message on a Beijer HMI talking to a CX9020?

The error is raised by the HMI driver when the ADS route to the CX9020 is removed, which on the CX9020 is almost always a scheduler-starvation symptom. Apply Solutions 1–4 above: set a fixed PLC cycle, raise the VISU refresh, keep NC at priority 0, and add a static AMS route from the engineering PC. The error will clear once the route stays active for 30+ minutes under full load.

Can I migrate from Windows CE 7 to a newer Beckhoff controller to solve this?

Yes. Newer Beckhoff embedded controllers (CX5200, CX8200, CX9240) run TwinCAT 3 on Windows 10 IoT Enterprise or TwinCAT/BSD and use multi-core x86 CPUs. The PLC + VISU + Motion coexistence is significantly more stable on these platforms, and the task configuration workarounds documented here are not required. The CX9020 remains in production for cost-sensitive single-axis applications where VISU load is light.

How do I confirm the TwinCAT licenses are not the cause of the disconnection?

Open a telnet/FTP shell on the CX9020 and run tclicense -list. All required license IDs (PLC, OPC, CNC/Motion) must appear with the correct status. A missing or mismatched license puts the runtime into a 10-minute demo mode that looks identical to the scheduler fault described in this article. Re-license the controller and re-test before changing any task configuration.

Back to blog