The standardized communication protocol CANopen is a higher-layer protocol based on the CAN protocol, used for industrial embedded networking. Before going into the basics of CANopen, an overview of the CAN protocol is helpful in order to have a better understanding of the CANopen communication protocol.
CAN bus
CAN is a serial communication bus protocol that uses a unique bus access control method called ‘Nondestructive Bitwise Arbitration’. “It supports distributed real-time control with a very high level of security” as mentioned by Sunit K . Sen (2014a). CAN was officially introduced by Bosch in 1986 and was intended to satisfy the high demand for electronic control systems in the automotive industry (Sunit K . Sen, 2014a).
CAN only implements the two lower levels of the Open System Interconnection (OSI) sevenlayer model, the ‘Data link layer’ and the ‘Physical Layer ‘out of 7 layers . The ‘data link layer’ is responsible for packaging the received data (from the physical layer) in ‘frames’. The physical layer provide the connection of the data link layer (the CAN controller) to the physical medium (transmission medium), as it contains the CAN transceiver. The CAN transceiver has a double role, as it also converts the received signals (from the CAN controller) to a differential signal between the two wires of the network cable, are refereed as CAN_L and CAN_H (Ayre et Keydel, 2003).
A typical CAN bus consists of a twisted pair cabling with termination resistors (120 Ohm) on each side, and nodes that are connected through CAN_H and CAN_L signals(Ayre et Keydel, 2003). The use of differential signal bus makes the CAN bus very robust to external noise, thus any electromagnetic interference (EMI) is avoided. CAN bus speed can achieve 1 Mbit/s for a bus length less than 45 meters, however the bit rate decreases with the bus length(Ayre et Keydel, 2003).
A variety of higher layer protocols were developed based on CAN, such as CANopen and DeviceNet. The basics of the CANopen application layer are presented next.
CANopen communication protocol
CANopen is a standardized communication higher-layer protocol, implemented through the higher layers of the OSI seven-layer model. Many communication/networking technologies lack a dominant higher layer protocol standard; they only offer data transmission and reception functionalities without any specification regarding the data type or the number of messages streaming over the network (a sort of layer 2 (Data link layer) interface) (Ayre et Keydel, 2003).
In the CANopen protocol, the following parts of the higher layers (Figure 1.5) are implemented (Ayre et Keydel, 2003):
• network layer: destination addressing and routing via Service Data Object (SDO) channels, interaction functionality between a host and the network (configuration via SDO objects, etc.);
• transport layer: provides communication reliability between source and destination (provided by Network Management (NMT) services);
• session layer: defines functions, such as ‘write access’ to a shared database record (SDO channel management) and synchronization; and
• Presentation layer: involves data representations in a standardized way (Object dictionary, etc.).
A typical CANopen device model . The device has three function units (CAN in automation, 2011):
• Communication function unit : provides the link between the object dictionary and the data transportation support, which is the network;
• Object dictionary; and
• Application function unit: ”the application comprises the functionality of the device with respect to the interaction with the process environment” (CAN in automation, 2011). The terms SDO, NMT, and Object Dictionary are related to the CANopen protocol and will be defined in the following subsections.
Object Dictionary
The object dictionary is the core of any CANopen device. It is a table of objects with a 16- bit index and an 8-bit sub-index. Node information and configuration is stored in the object dictionary. All the processes and data used by the application will also be stored as entries ith predefined addresses. Within the object dictionary it is possible to define the data types for each assigned variable, and to configure a node and modify its parameters by writing to the object dictionary related to that node (CAN in automation, 2011).
Service Data Object (SDO)
Since each node can implement its own object dictionary (OD), it can also implement a server for reading and writing access to that object dictionary. SDO is a direct method to access an OD using the ‘Client and server’ communication type (Ayre et Keydel, 2003). This method is especially useful during the initialization phase of a CANopen-based communication session, as it allows the network master to initializeand configure other nodes. There are two types of SDO objects, ‘SDO read’ which implement a read access and ‘SDO write’ which implements a write access. While it is possible to build an entire communication system by only using SDOs, for real-world real time implementation, the Process Data Object (PDO) method is preferable.
INTRODUCTION |
