Troubleshooting
Why CANopen PDOs visible on CAN do not reach CODESYS
Short answer
A CAN frame on the bus proves only that the sensor transmitted it. The value reaches the CODESYS application when the controller's receive COB-ID, payload mapping, NMT operational state and variable binding all match the frame the sensor sends. Compare the identifier on the bus with the configured receive identifier first; a node address changed on the sensor but not in the project is the fastest fault to find.

On this page
A CAN analyzer that shows the pressure sensor's PDOs on the bus has proven exactly one thing: the sensor is transmitting. It has not proven that your CODESYS controller accepts those frames, decodes them, or hands a value to your program. Reception breaks at one of four places: the receive COB-ID the project listens on, the payload mapping the project expects, the NMT state the CANopen manager runs in, or the binding between the received field and an application variable. Check them in that order, because each one is cheaper to test than the next. The worked example below takes the commissioning case where the sensor's node address was changed but the project kept the old entry — the fastest fault in this family to find, and one subtraction to prove.
What a frame on the bus proves #
Every node's CAN controller sees every frame; what differs is what each stack does next. Your controller's CANopen manager compares the frame's 11-bit identifier against its configured receive objects, decodes the payload according to each object's mapping, writes the values into the process image, and only then can your program read a variable. The analyzer sits before the filter, so a clean, changing frame clears the wiring, the bit rate and the sensor itself — and verifies nothing from the filter onward.
A frame gets through only when the receive object is enabled and its mapping is valid; the guide to CANopen PDO reception, filters and valid mapping sets out that requirement. If the mapped variable stays frozen while the analyzer bytes move with pressure, the break lies between the filter and your program: identifier, mapping or binding. If the analyzer bytes themselves never move, stop blaming reception — either you are watching a frame that does not carry the pressure value, or the sensor is not updating it. Apply a controlled pressure change inside the sensor's permitted range and note which identifier and which bytes respond before you touch the controller at all.
| What you see | Where the fault sits |
|---|---|
| A tilt sensor reads normally, the pressure sensor does not | Bus, bit rate and manager are alive; the fault is inside the pressure sensor's own receive configuration |
| Analyzer bytes move with pressure, the program variable stays frozen | Identifier filter, payload mapping or variable binding on the controller |
| Analyzer bytes never move during a pressure change | Wrong frame under watch, or the sensor is not updating that PDO |
| The variable updates but the magnitude is wrong | Data width, signedness, byte order or scaling |
The checks, in order #
- Record the frame. Identifier in hex and decimal, data length, all payload bytes and the arrival interval, captured while a controlled pressure change runs.
- Compare identifiers. The frame's CAN identifier against the receive PDO's COB-ID in the project. The node-ID arithmetic is worked below.
- Compare payload mapping. The sensor's active mapping against the receive object's mapped objects, their order, byte positions and lengths. A valid frame decoded with the wrong layout gives a frozen or meaningless value.
- Check the NMT state. CANopen carries process data only in the operational state, while SDO parameter access works earlier, so a sensor you can read is not automatically a sensor whose PDOs arrive. Capture the trace and the controller diagnostics in the same test window; a state change between the two hides the fault.
- Check the binding. The received field must be mapped to an application variable of matching width and signedness, and no later line of code may overwrite it.
- Verify raw before scaled. Watch the raw mapped value, in hex, against the analyzer bytes, and add engineering-unit conversion only after the raw value is right.
If you want the layer-by-layer background behind these six checks, the CANopen troubleshooting reference for frames, NMT, SDO, PDO and the object dictionary collects it on one page.
Matching the receive COB-ID #
A COB-ID ties a CANopen communication object to its CAN identifier and its configuration attributes; the receive entry in your project must carry the identifier the sensor actually transmits. Naming gets in the way here: a device's transmit PDO appears in the controller as a receive PDO, and configuration screens label entries from either perspective, so follow the direction of the data, not the label.
The default identifier for each PDO comes from the CANopen pre-defined connection set in CiA 301, the standard's fixed allocation of PDO number, node address and CAN identifier; the CANopen PDO mapping and node addressing COB-ID reference guide tabulates every pairing so you can read the expected identifier straight off. Then give the pressure sensor its own node ID and put that same ID in the project: a duplicate address makes the manager talk to the wrong device, and no amount of mapping work recovers it.
NMT state and transmission type #
NMT moves a node through pre-operational, operational and stopped, and CANopen allows PDO exchange only in the operational state. Frames already appearing on the bus tell you the sensor's transmit side runs; the open question is your manager. A node that completes boot-up but is then rejected by the manager can end up where process data stays blocked — why a CANopen coupler boots up but the PLC rejects it covers how to read that out of the diagnostics.
Transmission type decides when a PDO is sent, not whether you receive it: event-driven PDOs go out when mapped data changes, synchronous ones follow SYNC objects. Because your frames already arrive, do not start here; a steady interval on the analyzer says the transmit side is already configured. What can bite you is a mapping or COB-ID change written during pre-operational that only takes effect after the manager restarts the node — so after any edit, restart the node and look again.
Checking a sensor at node ID 5 against a project left at node ID 2 #
Inputs. The frame is the sensor's TPDO1, the one the analyzer shows changing with pressure (step 1 confirms which frame carries the value; some devices put it in TPDO2 instead). The TPDO1 base identifier is 0x180, or 384 decimal, the default the CiA 301 pre-defined connection set assigns. The sensor's node ID is 5 — an example value, read from its address switches or node-ID parameter after the address was changed during commissioning. The project's node entry is 2 — an example value, the entry the device was added with before that change.
Rule. Within the pre-defined connection set, a PDO's default CAN identifier is its base number plus the node ID, and the controller's receive object must carry the identifier the sensor actually transmits.
Arithmetic.
- Sensor transmits TPDO1: 0x180 + 0x05 = 0x185, that is 384 + 5 = 389 decimal.
- Project listens for node 2: 0x180 + 0x02 = 0x182, that is 384 + 2 = 386 decimal.
- Both are legal 11-bit identifiers, below 0x7FF (2047), so nothing is malformed — the values simply differ.
- Signature: 389 - 386 = 3, exactly the node-address gap 5 - 2 = 3.
Result. The bus carries identifier 0x185 (389) while the controller accepts only 0x182 (386). The filter discards every pressure frame, the mapped variable never updates, and the analyzer keeps showing flawless traffic while the program sits empty-handed.
Decision. When the analyzer's identifier minus the configured identifier equals the node-address gap, the fault is addressing: set the project's node entry to the sensor's real address — 5 here — or put the sensor back at 2, then confirm both sides read 0x185 (389). When the two identifiers are already equal, leave addressing alone; the fault is mapping or binding, and this arithmetic has done its job.
Binding the received value to a variable #
Do this work in a maintenance window with a saved copy of the project: a download or node restart touches every device on that bus, and a state change can move outputs on a machine that is running.
Bind the received field to an application variable through the project's device I/O mapping, choosing a data type that matches the field's width and signedness. Watch the raw variable in hex against the analyzer bytes before any scaling, then search the program for a second assignment that overwrites it. Keep engineering-unit conversion downstream of that confirmation; a scale factor pasted over a broken reception hides one fault inside a second one.
The decision for each symptom #
- The identifiers differ by exactly the node-address gap: fix the addressing as the worked example shows.
- Identifiers match and the raw variable stays frozen: align the payload mapping — same objects, order, byte positions and lengths as the sensor's active mapping.
- Mapping matches and the variable still never moves: bind the field to a variable of matching width and signedness, and remove any later write to it.
- The variable moves with the wrong magnitude: fix interpretation — width, signedness, byte order — then scale.
- The trace shows traffic but the program sees it intermittently: compare the trace and the controller diagnostics from the same window, and confirm both nodes sit in operational.
- The receive object shows a zero COB-ID after an import: the PDO is disabled and every frame is ignored — why an imported CANopen PDO loads a zero COB-ID explains how that happens.
Worked end to end, this sequence turns frames on the bus with nothing in the program into one of six concrete fixes, and in the commissioning case above it ends at a single node-entry edit.
Questions asked
Does adding the sensor's EDS file make the PDO data start flowing?
No. An EDS describes the device's object dictionary and communication capabilities to the configuration tool; it carries none of the device's live settings. The sensor's active transmit configuration and the controller's receive configuration still have to agree on identifier, payload and enabled state, and a project variable still has to be bound to the received field before any value appears in the program.
Why can I read and write parameters over SDO while the PDOs stay empty?
SDO uses the fixed identifiers 0x600 plus the node ID for requests and 0x580 plus the node ID for responses, so it needs no mapping, and CANopen allows SDO traffic in the pre-operational state where PDO exchange is blocked. A working SDO path therefore proves wiring, bit rate and node addressing, and nothing about whether a receive PDO is enabled and correctly mapped.
What does transmission type 255 on the sensor's PDO mean?
Type 255 is event-driven: the sensor transmits when its mapped process data changes, subject to its inhibit and event-time settings, rather than on a sync message. Types 1 through 240 transmit the PDO after every n-th SYNC object, and type 0 transmits on every SYNC. Frames arriving at a steady interval already show the transmit side working; reception is governed by the controller's configuration instead.
The frames now reach the program, but the value looks wrong. What next?
The reception chain is fixed and the remaining fault is interpretation. Compare the mapped variable's raw value, viewed in hex, with the payload bytes in the analyzer, then check the field's width, signedness and byte order: a signed 16-bit value read as unsigned goes wrong above 32767. Correct those first and apply any engineering-unit scaling only after the raw value matches the wire.


