CANopen SYNC

SYNC is a special service, which is available both in CANopen and CANopen FD.

The SYNC producer (usually a controller or another device with a precise clock) cyclically transmits a SYNC message, which can be received by other devices (SYNC consumers). These SYNC messages can be used to synchronize anything, but are mostly used to synchronize the PDO transmissions or to synchronize actions.

SYNC configuration objects

The SYNC producer has 2 or 3 objects in its object dictionary to configure the SYNC message:

  • 0x1005 – COB-ID Sync: Definition of CAN-ID and if a device is producer or consumer
  • 0x1006 – Communication Cycle Period: Time between 2 SYNC messages
  • 0x1019 – Synchronous Counter Value: optional object to configure SYNC messages with a SYNC counter

Continue reading “CANopen SYNC”

ISO-TP addressing formats

ISO-TP is a transport protocol defined in the ISO-Standard ISO15765-2. It defines a transport layer protocol on top of CAN or CAN FD to transfer payload larger than 8 resp. 64 bytes which is the maximum frame length of CAN resp. CAN FD frames.

Normal addressing

Normal addressing use the CAN identifier only to address a device. Both 11-bit CAN identifiers and 29-bit CAN identifiers may be used.
The definition which CAN identifiers shall be used is not in the scope of the ISO-TP standard, but defined by higher layers using ISO-TP.

Normal fixed addressing

Normal fixed addressing requires the use of 29-bit CAN identifier only. It basically follows the J1939 addressing scheme using the J1939 PGNs 0xDA00 and 0xDB00 and a J1939 priority of 6. The source address is encoded in the lower 8 bit of the CAN ID and the target address is encoded in the bits 8-15 of the CAN-ID.

Extended addressing

Extended addressing extends the normal addressing format by an additional byte. The first byte of the CAN frame is part of the address.
Illustration of UDS payload embedded into ISO-TP in CAN frames
The definition which CAN identifiers and data byte shall be used is not in the scope of the ISO-TP standard, but defined by higher layers using ISO-TP.

Mixed addressing

Mixed addressing is used for remote diagnotics and can be used with both 11-bit CAN IDs and 29-bit CAN-IDs. When using 29-bit CAN-IDs it basically follows the J1939 addressing scheme using the J1939 PGNs 0xCE00 and 0xCD00 and a J1939 priority of 6. The source address is encoded in the lower 8 bit of the CAN ID and the target address is encoded in the bits 8-15 of the CAN-ID.

Additionally, the 1st byte of the CAN frame is used as an address extension.

Known implementations

emotas’ ISO-TP stack supports Normal addressing, Normal fixed addressing and Extended Addressing.

CANopen Object Code

To answer the constant question whether Array or Record is 8 or 9, this article provides an explanation of CANopen object codes.

All data of a CANopen device, which are accessible via CANopen, are stored in objects in the object dictionary. The objects have different object codes based on the their internal structure.

Variable

An object with the object code ‘variable’ is a single variable like e.g. a variable in the programming language C. It has a data type and various attributes.

Array

An object with the object code ‘array’ is a structured data set like e.g. an array in the programming language C. All elements of this array (sub-index 0 not included) have the same data type.

Record

An object with the object code ‘record’ is a structured data set like e.g. a struct in the programming language C. All elements of this record (sub-index 0 not included) may have different data type.

CANopen Object Code definitions

  • 7 – Variable
  • 8 – Array
  • 9 – Record

A few additional values are listed in the CANopen specification CiA 301.
The object code definitions are called object type in EDS files (CiA 306) and XDD files (CiA 1311).