Troubleshooting
Why an EtherCAT I/O slave fails the PREOP to SAFEOP transition
Short answer
Discovery and a generated ENI prove the slave answered identification, nothing more. A PREOP to SAFEOP failure is the slave rejecting the configured process data, and the slave's AL status code names the refused side: 0x001D for the output configuration, 0x001E for the input. Fix identity first, then PDO and sync manager lengths, then sync mode, one layer at a time.
On this page
A PREOP to SAFEOP failure is the slave refusing the process-data configuration the master asked it to run. The scan that found the box and the generated ENI prove only that the slave answered identification; they say nothing about whether the layout is one the slave accepts. At the PREOP to SAFEOP boundary the slave checks the sync managers that carry process data and, where the device is synchronized, the clock settings, and it refuses the transition when they do not match. Read the slave's AL status code first, then work the layers in order: device identity, the PDO and sync manager entries in the ENI, and the synchronization mode.
What the slave checks at this transition #
An EtherCAT slave walks a fixed state machine: INIT, PREOP, SAFEOP, OP. Mailbox communication, including the SDO writes that download configuration, already works in PREOP, which is why a wrong layout can be delivered cleanly and still be refused at the next boundary.
SAFEOP adds cyclic exchange of the slave's input process data while outputs hold their defined safe values; outputs only go live in OP. Before accepting the transition, the slave verifies that the sync managers for process data are configured as it expects and, if the device is synchronized, that the clock settings are acceptable. A refusal here is a configuration verdict from the slave itself, and the slave reports the reason as an AL status code. The principle is not EtherCAT-specific: an imported EDS does not prove Ethernet/IP cyclic I/O on that network family, and a resolved scan does not prove a process-data layout here either.
Read the AL status code before editing anything #
The master's line names the transition, not the reason. Open the failing slave in the master's diagnostics and read its AL status code, the value the slave wrote when it refused. Two codes decide most of these cases:
- 0x001D — invalid output configuration: the output process image the ENI describes is not one the slave accepts.
- 0x001E — invalid input configuration: the same refusal on the input side.
Decode before you edit. The output code sends you to the output PDO assignment and the output sync manager entries, the input code to the input entries, and any other code to its documented meaning in the slave vendor's documentation. Guessing the layer costs more time than the read does.
The checks, in order #
- Identity and description. Confirm the scan resolves the live device — vendor ID, product code, revision number — to the intended ESI. A near-identical description can win the match; the GSDML install route that decides CODESYS device repository entries is the same trap on PROFINET.
- The file the master runs. Regenerate the ENI after every change and confirm the master loads the newly generated file. Editing a file the master no longer reads reproduces the failure indefinitely.
- Output process data. Compare the ENI's output PDO assignment against the mappings the ESI declares; every entry must belong to a supported mapping.
- Input process data. Run the same comparison on the input assignment.
- Sync managers. Check each sync manager's direction and length in the ENI; the length must equal the summed size of the entries assigned to it.
- Synchronization mode. Request a mode the ESI lists as supported — free run, SM synchronous or DC synchronous — with cycle settings inside the device's range.
Change one layer per attempt; stacked changes hide which one cleared the rejection.
Decoding the failure on the fourth node of a four-slave line #
The inputs, each as the case reports them:
- Three servo drives in series, then an I/O module with digital and analog channels as the fourth physical node.
- The startup log:
'Box 3 (Moons-IO)' (1004): 'PREOP to SAFEOP' failed! - The identity read at the scan: vendor ID 0x168, product code 0x18, revision number 0x1.
- The AL status from the slave view after the refusal: 0x001D in this example, since the master's line stopped at the generic message.
The rule: locate the failing node by box index and decode the AL status. On this bus the master numbers boxes from zero, so the box index is the physical position minus one, and the code names the refused check.
The arithmetic: 3 drives + 1 I/O module = 4 physical nodes, and 4 − 1 = 3, which matches Box 3 in the log, so the message points at the I/O module and not at a drive. Then 0x001D = 16 + 13 = 29 decimal, the output-configuration rejection. The identity values are the module's own report, so before touching process data, make the installed ESI describe exactly that device.
The result: the refusal is localized to the fourth node, output side. The decision: align the ENI's output PDO assignment and output sync manager length with a mapping the ESI supports, regenerate, and reload. Had the code read 0x001E, 30 decimal, the input assignment would be the target; had the log shown a timeout instead of a code, the fault would be startup timing, not this layout.
Fix the process data the code points at #
Save the files you are about to change — the ESI, the description patch, the generated ENI. Work against the ESI, not against the master's generic message: every PDO entry configured in the ENI must sit inside one of the mappings the ESI declares, at the bit length the ESI gives, and each sync manager's length in the ENI must equal the total size of the entries assigned to it.
Where the module supports configurable PDO assignment, read the assignment the slave currently holds through the objects its description lists. The startup writes must produce the assignment the ENI expects; a slave holding a different live assignment refuses the requested layout. When sizes look close, remember that tools do not all display mapping the same way — some show bits instead of byte-sized nodes, as why ctrlX I/O Engineering shows bits instead of byte mapping nodes describes — so compare lengths in one unit before calling a mismatch.
Regenerate the ENI, load it, restart the network, and read the slave state and AL status again. One coherent change per attempt.
While you test, keep the loads that read the analog outputs disconnected or overridden: when the module reaches OP, those channels go live with whatever the process image holds.
Synchronization mode and distributed clocks #
When the PDO and sync manager entries match the ESI and the transition still fails, the synchronization mode is the remaining layer at this boundary. The ESI lists the modes the device supports — free run, SM synchronous, DC synchronous — and the slave checks the synchronization settings here too, so a requested mode the device cannot run is refused just as a wrong PDO is. Select a listed mode, match the cycle time to the device's range, regenerate the ENI, and load it. From the master's generic message, a mode refusal looks identical to a PDO refusal, which is why the AL status code and the layer order matter more than the log's wording.
The decision for each case #
- Identity resolved to the wrong description: correct the ESI or the custom description entry so the scan resolves vendor ID, product code and revision to the connected device, rescan, and proceed only from a clean match.
- AL status 0x001D: the output side. Align the output PDO assignment and the output sync manager length with a supported ESI mapping, regenerate the ENI, and confirm the master loads it.
- AL status 0x001E: the input side — the same comparison on the input assignment and the input sync manager.
- Any other code: the slave named its layer; read that code's documented meaning and fix that layer, not the nearest guess.
- A timeout instead of a code: startup timing, not layout. Let the slave finish its own initialization — long parameter loads on drives are a known cause — and retry the state request.
- SAFEOP reached: inputs are live and outputs still hold their safe values; OP is the step that brings the outputs out.
Questions asked
Is a timeout message the same fault as a rejected transition?
No. A timeout while setting the state means the slave did not complete the transition inside the master's window; that is a timing fault, not a configuration rejection. A refusal comes back with an AL status code that names the rejected configuration. With a timeout, look at what the slave is still doing after power-up, because drives that load long parameter sets are a known cause, and give the state request more time instead of editing the ENI.
Why does the slave show PREOP plus an error flag?
The slave refused a requested transition and latched an error flag next to its current state, so the display reads PREOP plus an error instead of the clean PREOP you saw at discovery. The AL status code beside that flag is the refusal reason. The flag clears when the master requests a transition the slave accepts, not when the bus is rescanned, so correct the configuration the code names and request the state again.
The log shows 0x0012 - is that an AL status code?
Check the source before decoding it. Master stacks sometimes print their own error or message numbers, and those are not always AL status codes; decoding a master number as if the slave had written it sends you to the wrong layer. Read the code from the slave's own status in the master's slave diagnostics, and decode that value against the AL status code list in the specification or the slave vendor's documentation.
How do I keep the files straight while I iterate?
Keep a copy of every ESI, description patch and generated ENI together with the startup log that goes with it, and put the change you made into the file name. When a combination finally passes, you know exactly which files produced it, and after a future firmware or tool update you can return to the last working pair instead of rebuilding the network description from memory.