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”

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).

CANopen Bootup Message

The CANopen Bootup Message is sent by a CANopen device when it starts. This is done to indicate to all other devices in the network that it is ready to communicate by other CANopen services. Although it may sound simple, there are preconditions that need to be met before a bootup message can be sent. The CAN-ID of the bootup messages depends on the CANopen node-ID of the device. That is why the device must have a valid node-ID between 1 and 127 in order to transmit a bootup message. Therefore, devices without a defined node-ID or without any switches to set the node-ID must use a dynamic Node-ID configuration by Layer Setting Services (LSS).

CAN-ID and CAN data

Anyway, we only discuss the case with a valid node-ID for now.
The CAN-ID of a bootup message is 0x700 + node-ID. That means that the CAN-IDs are located in the range between 0x701 and 0x77f. Each CANopen bootup message has a length of 1 byte. The value of this one byte is always 0x00. The same CAN-ID but different data are used by CANopen Heartbeat or Node Guarding messages.
Continue reading “CANopen Bootup Message”