Troubleshooting
Fix PROFINET device ID read errors in CODESYS scans
Short answer
A device that answers DCP discovery can still fail the later RPC-based identity read, so the scan reports it cannot read the ID number. Capture one failed scan with the controller diagnostic log and let the trace pick the fix: adapter binding, a filter on the path, a rule for the returning process, or a runtime mismatch.
On this page
A scan that stops at "not able to read the ID number" is telling you the device passed one PROFINET exchange and failed the next. Discovery runs over DCP at the data link layer; reading the device identity is a separate, IP-based RPC exchange, and a firewall, a wrong adapter or a runtime fault can kill the second while the first still works. Replace nothing. Capture one failed scan beside the controller diagnostic log, and the trace puts the fault in exactly one of four places — adapter binding, the outbound path, a filter on the reply, or the controller runtime — and each has one correction.
Two exchanges, not one #
The PROFINET specifications in the IEC 61158 and IEC 61784 family split what a commissioning scan does. DCP is a data link layer protocol: it discovers devices and carries the basic settings, including device name and IP assignment. Passing discovery establishes nothing else by itself; application relationships and communication relationships come later, and acyclic services such as record reads and identity reads run over additional, RPC-based mechanisms. A device that appears in the scan list can therefore fail the identity read that follows.
The asymmetry matters for diagnosis. DCP is a raw Layer 2 broadcast that cannot cross a router, so a device reachable only by IP never shows in discovery at all, while the IP-based identification exchange can traverse a routed path — which is also why an IP filter can block the identity read without touching discovery. When the diagnostic text says a telegram is blocked, copy the exact string before searching: diagnostic texts in the wild have printed the service as "RCP telegram is blocked", and the service meant is RPC.
What not to change first #
- Replacing the device. A reader that runs on a second controller proves the device communicates; the two sides differ in adapter, network path, host filtering and runtime stack. The swap costs a day and proves nothing.
- Re-importing the GSDML file. The device description supplies configuration and the identity the controller matches against. It cannot unblock traffic. It becomes relevant only when the controller receives an identity and fails to match it.
- Stacking inbound firewall rules. Rules added without a trace can sit on the wrong host, the wrong interface or the wrong process, which is why they change nothing.
- Upgrading the runtime first. Without the recorded failing exchange you lose the baseline that separates a network fault from a stack fault.
Record one failed scan #
- Write down the versions before touching anything: controller runtime release, installed PROFINET controller component version, device firmware, GSDML filename and the network adapter selected for the scan.
- Confirm that adapter is the one physically cabled to the device network, and record link state, device MAC address, station name and IP settings.
- Start a packet capture on that adapter. Where the switch allows it, mirror the device-facing port as well, so you hold both ends of the exchange.
- Run one scan attempt and note the wall-clock time of the failure.
- Stop the capture and pull the runtime diagnostic entries with the same timestamp; the CODESYS PROFINET controller component exposes runtime functions and diagnostics that the application can read.
- If a second controller arrangement works, capture one successful scan there with identical device settings and keep both files.
Read the trace and pick the one correction #
| What the capture shows | Where the exchange dies | The correction |
|---|---|---|
| No identify request on the controller interface at all | The request never leaves the host | Fix the adapter binding, read the controller component's startup diagnostics, and check host filtering on that same machine |
| Request visible on the controller side, absent on the device side | The outbound path drops it | Compare the two captures and fix the VLAN, ACL or filter between the two capture points |
| Response visible on the device side, absent on the controller side | The reply is blocked | Write one narrow rule for the host, interface and service the decode shows, scoped to the process that actually originates the request |
| Response arrives at the controller interface, scan still fails | The runtime rejects or cannot match it | Read the runtime diagnostic: a logged rejection and a silent timeout take different paths; once identity returns, compare it to the configured GSDML entry and selected modules |
A timeout on its own never means "device broken". It means the request was lost, the reply was lost, or the reply was discarded, and the capture says which.
What one decode looks like #
The numbers below are illustrative; the method is not. In a sample decode, the controller sent the identify request at 14.202 s, retransmitted at 14.702 s and again at 15.202 s — spacing 14.702 − 14.202 = 0.500 s and 15.202 − 14.702 = 0.500 s — and the scan aborted at 15.452 s, 0.250 s after the third attempt.
Three requests out, zero responses back, and the device-side mirror recorded zero arrivals: the loss sits on the outbound path, so the decision is the filter or VLAN between the two capture points, not the device and not the GSDML. The opposite decode decides the opposite way: had each response returned in 3 ms (14.205 s against the 14.202 s request) while the error still appeared, the exchange reaches the runtime, and the answer lives in the controller diagnostic and the GSDML match, not the network. Retry spacing and count belong to the stack that sent them; counting requests, counting responses and subtracting timestamps does not.
Change one thing, under control #
Make any filtering change under the site's approved diagnostic process: one variable per test, before-and-after captures kept, and the security policy restored afterwards so only the rule the working exchange demonstrably needs survives. A wide-open rule left behind from a troubleshooting session is a vulnerability with a story attached.
What a fixed scan still has to prove #
The scan is the first milestone, not acceptance. Work down this list:
- The identity reads back without the reported error, on repeated attempts.
- The detected identity matches the configured GSDML entry and the selected modules.
- The connection establishes — its own exchange, with its own parameter failures; see PROFINET connect parameter errors on an S7-1200 for that fault's path.
- Acyclic record reads work over the same RPC-based path; reading IO-Link ISDU parameters over PROFINET acyclic record data shows the pattern once identity is stable.
- Cyclic I/O data flows and the diagnostics stay clear through a device power cycle.
Stop when all five hold. Anything less is an unfinished fix, and the fault will return with the same message.
Questions asked
The device answers ping, so why does the ID read still fail?
A ping reply proves the IP path between the two addresses is up, and nothing more. The scan depends on DCP discovery and on the RPC identity read, and a ping exercises neither of them. A device that answers ping while the scan fails is therefore not a contradiction: it means the network layer path works and the identify exchange does not, so capture the identify traffic itself.
What ports should the firewall rule cover?
Do not take port numbers from memory or from a forum post. Decode the blocked exchange in your own capture and write the rule for the host, interface and service the decode shows, scoped to the process that actually originates the request. Also note that discovery carries no IP ports at all, so no port-based rule can ever make an invisible device appear in the scan.
The same device works on another controller. Does that rule out the device?
It rules out the device, not the installation. The two controllers differ in adapter, network path, host filtering and runtime stack, and any of those can pass one arrangement and block the other. Capture one successful scan and one failed scan with the same device name and IP settings, then diff the two decodes: the missing or rejected frame is the fault.
Can discovery find devices across a router?
No. DCP discovery is a raw Layer 2 broadcast and stops at the first router, so a device that sits beyond a router never appears in a scan even though its IP path works. The identification exchange is IP-based and can traverse the routed path, which is why some PROFINET tools offer an RPC-only mode that skips discovery for exactly that topology.