Beckhoff TwinCAT 3 (XAR/XAE) with EtherCAT troubleshooting
A TwinCAT 3 system reports problems in several layers. Communication with the runtime (engineering PC, HMI, SCADA, other PLCs) fails with ADS return codes such as 1861 (0x745, timeout) or 7 (target machine not found). The EtherCAT master reports each slave’s state (INIT, PREOP, SAFEOP, OP), a working counter state (WcState) per slave and a DevState for the whole bus; a slave that refuses a state change returns an AL status code such as 0x001B (sync manager watchdog). NC axes stop with NC error codes in the 0x4000–0x4FFF range, for example 0x4550 (position lag monitoring). Reading the right layer first saves most of the time.
Upload a photo of the alarm screen, the fault history or a data export. InduQT compares the evidence and suggests the next useful checks.
How it reports faults
- ADS return codes: every ADS call (from XAE, an HMI, ADSREAD/ADSWRITE in the PLC or the ADS DLL) returns a code. Beckhoff groups them as global errors 0x0000…, router errors 0x0500…, general ADS errors 0x0700… and RTime errors 0x1000…; the same code also appears as an HRESULT 0x9811_0xxx.
- XAE Error List / logger: TwinCAT runtime events and logger output appear in the XAE message window (Error List); EventLogger events are shown there when the EventLogger option "Output as Task Item" is set.
- EtherCAT master online view: per slave the State (0x__1 INIT, 0x__2 PREOP, 0x__4 SAFEOP, 0x__8 OP; 0x0010 slave signals error, 0x0100 slave not present, 0x0200/0x0400/0x0800 link errors), CRC counters, and the master’s LostFrames counters. The master input DevState should be 0 and each FrmXWcState should be 0; bits 8–11 of DevState show slaves in INIT, PREOP, SAFEOP or error, bit 12 "DC not in sync".
- WcState per slave: 0 = valid real-time communication in the last cycle, 1 = invalid. Because one datagram serves several slaves, WcState = 1 marks every slave in that datagram/SyncUnit; the slave State variable shows which one has the problem.
- AL status codes: when a slave refuses or drops a state, it reports an AL status code (e.g. 0x001B sync manager watchdog, 0x0024 invalid input mapping) and the resulting state carries an error flag (e.g. SAFEOP + E).
- Terminal LEDs: the green RUN LED shows the EtherCAT state of a terminal: off = INIT, flashing = PREOP, single flash = SAFEOP (outputs held in safe state), on = OP, flickering = BOOTSTRAP. Error LEDs are device specific; check the terminal documentation.
- PLC exceptions: an exception in the PLC (e.g. invalid pointer access) stops the PLC task at that point. From TC3.1 build 4026.9 the runtime automatically stores a core dump archive in the boot folder, which XAE can open to show the call stack and variable values at the exception.
- Task overruns: when a task exceeds its cycle time the exceed counter of that task is incremented and cycles may be lost; it can be reset and read from the PLC (Tc2_System FB_ResetTaskExceedCounter).
- NC axis errors: NC errors use 0x4000–0x4FFF (0x42nn group, 0x43nn axis, 0x44nn encoder, 0x45nn controller, 0x46nn drive) and are shown in the axis online tab and returned as ErrorID by the motion function blocks.
Fault codes
| Code | Name |
|---|---|
| ADS 6 | Target port not found (0x6, ERR_TARGETPORTNOTFOUND) |
| ADS 7 | Target machine not found (0x7, ERR_TARGETMACHINENOTFOUND) |
| ADS 18 | Port disabled (0x12, ERR_PORTDISABLED) |
| ADS 1793 | Service not supported by the server (0x701, ADSERR_DEVICE_SRVNOTSUPP) |
| ADS 1797 | Parameter size not correct (0x705, ADSERR_DEVICE_INVALIDSIZE) |
| ADS 1798 | Invalid data values (0x706, ADSERR_DEVICE_INVALIDDATA) |
| ADS 1808 | Symbol not found (0x710, ADSERR_DEVICE_SYMBOLNOTFOUND) |
| ADS 1861 | Timeout, remote terminal not responding (0x745, ADSERR_CLIENT_SYNCTIMEOUT) |
| AL 0x0011 | Invalid requested state change |
| AL 0x001A | Synchronization error |
| AL 0x001B | Sync manager watchdog |
| AL 0x001D | Invalid output configuration |
| AL 0x001E | Invalid input configuration |
| AL 0x0024 | Invalid input mapping |
| AL 0x0030 | Invalid DC SYNC configuration |
| WcState | Working counter error (WcState = 1, FrmXWcState ≠ 0) |
| Slave not in OP | EtherCAT slave stuck in INIT, PREOP or SAFEOP |
| NC 0x4260 | Controller enable missing (16992) |
| NC 0x4550 | Position lag monitoring (following error) (17744) |
| NC 0x4650 | Drive hardware not ready to operate (18000) |
Evidence to collect
- TwinCAT logger / Error List export covering the minutes before the fault
- EtherCAT master online tab screenshot (State of every slave, CRC counters, LostFrames)
- Values of DevState, FrmXWcState and the affected slaves’ WcState and State at the fault
- Scope View trace of WcState, DevState and the task exceed counter around the event
- TwinCAT and XAE build, AMS NetId of target and client, and the configured ADS routes
- For NC errors: axis online tab (error code, set/actual position, lag), axis parameter export
- Core dump archive (Port_<port>.<timestamp>) for PLC exceptions
- Photo of the terminal and coupler LEDs on the affected segment