当前位置:首页 >> 信息与通信 >>

CiA 301 – CANopen application layer and communication profile(IGCO


? CAN in Automation e. V.

CANopen
Application Layer and Communication Profile

CiA Draft Standard 301

Version 4.02 Date: 13 February 2002

HISTORY

CANopen

CiA

HISTORY
Date June 1999 Changes Document completely revised; Summary of major changes: ? ? ? ? ? ? ? ? ? ? ? ? June 2000 ? ? ? Object Dictionary structure reviewed Object services and NMT services included (former in CiA DS-201 .. CiA DS-207 specified) Data type definitions included (former in CiA DS-201 .. CiA DS-207 specified) and extended Boot Up Message specified Optional Heartbeat specified Additional Emergency error codes specified Additional SDO abort codes specified Timer-driven PDO transmission specified PDO Communication parameter enhanced PDO Mapping procedure clarified SDO Block transfer specified Pre-defined Identifier set extended correction of some typing errors clarification of some descriptions Appendix: ? ? ? ? ? February 2002 ? ? ? ? ? ? ? ? ? ? Device configuration OS command and prompt Multiplexed PDOs Modular CANopen devices Error behaviour

errata sheet included chapter '11.6.2. Error behaviour object' – wrong reference changed default value changed from 'No' to '(device profile dependent)' for inhibit time and event timer at definition of TPDO chapter '9.4.4. Restricted COB-Ids' added default value changed from 'No' to 'disabled' for COB-ID Client -> Server and COBID Server -> Client at definition of Server SDO Parameter for Index 1201h – 127Fh default value changed from 'No' to 'disabled' for COB-ID Client -> Server and COBID Server -> Client at definition of Client SDO Parameter 'All client SDOs are invalid by default (invalid bit – see …)' added 'A000h – BFFFh – Standardised Interface Profile Area' added at table 1 figure 49 changed – structure of the Initialisation state. annex A edited

General information on licensing and patents CAN in AUTOMATION (CiA) calls attention to the possibility that some of the elements of this CiA specification may be subject of patent rights. CiA shall not be responsible for identifying any or all such patent rights.

? CiA 2005-01-01 All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from CiA at the address below. CAN in Automation e. V. Kontumazgarten 3 DE – 90429 Nuremberg, Germany Tel.: +49-911-928819-0 Fax: +49-911-928819-79 Url: www.can-cia.org Email: headquarters@can-cia.org

2

CONTENTS

CANopen

CiA

CONTENTS
1 2 3 4 TABLES .................................................................................................................................. 6 FIGURES................................................................................................................................. 8 SCOPE .................................................................................................................................. 10 REFERENCES...................................................................................................................... 11 4.1 4.2 5 Normative references ................................................................................................... 11 Informative references ................................................................................................. 11

DEFINITIONS AND ABBREVIATIONS.......................................................................... 12 5.1 Abbreviations ................................................................................................................ 12

6

MODELING ........................................................................................................................... 14 6.1 6.2 Reference Model .......................................................................................................... 14 Device Model ............................................................................................................... 15 6.2.1 6.2.2 6.3 General ................................................................................................................. 15 The Object Dictionary .......................................................................................... 16

Communication Model ................................................................................................ 17 6.3.1 6.3.2 6.3.3 Master/Slave relationship .................................................................................... 18 Client/Server relationship .................................................................................... 19 Producer/Consumer relationship - Pull/Push model ......................................... 19

7

PHYSICAL LAYER ............................................................................................................ 20 7.1 7.2 Transceiver ................................................................................................................... 20 Bit rates and timing....................................................................................................... 20

8

DATA LINK LAYER ......................................................................................................... 22 8.1 CAN Frame Type.......................................................................................................... 22

9

APPLICATION LAYER ...................................................................................................... 23 9.1 Data Types and Encoding Rules................................................................................. 23 9.1.1 9.1.2 9.1.3 General Description of Data Types and Encoding Rules ................................. 23 Data Type Definitions .......................................................................................... 23 Bit Sequences ...................................................................................................... 24 3

CONTENTS 9.1.4 9.1.5 9.1.6 9.2

CANopen Basic Data Types ................................................................................................. 25 Compound Data Types........................................................................................ 28 Extended Data Types .......................................................................................... 28

CiA

Communication Objects ............................................................................................... 29 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 Process Data Object (PDO) ................................................................................ 29 Service Data Object (SDO) ................................................................................. 33 Synchronisation Object (SYNC).......................................................................... 58 Time Stamp Object (TIME).................................................................................. 59 Emergency Object (EMCY) ................................................................................. 60 Network Management Objects............................................................................ 63

9.3

Synchronisation of the SYNC Consumer.................................................................... 71 9.3.1 9.3.2 Transmission of Synchronous PDO Messages ................................................. 71 Optional High Resolution Synchronisation Protocol.......................................... 72

9.4

Network Initialisation and System Boot-Up ................................................................ 74 9.4.1 9.4.2 9.4.3 Initialisation Procedure ........................................................................................ 74 NMT State Machine ............................................................................................. 74 Pre-Defined Connection Set ............................................................................... 77

9.5

Object Dictionary .......................................................................................................... 79 9.5.1 9.5.2 9.5.3 9.5.4 General Structure of the Object Dictionary ........................................................ 79 Dictionary Components ....................................................................................... 80 Data Type Entry Specification............................................................................. 80 Specification of Predefined Complex Data Types ............................................. 82

9.6

Communication Profile Specification .......................................................................... 84 9.6.1 9.6.2 9.6.3 Detailed Object Specification .............................................................................. 84 Overview Object Dictionary Entries for Communication ................................... 84 Detailed Specification of Communication Profile specific Objects ................... 86

10 11

IMPLEMENTATION RECOMMENDATIONS............................................................... 114 ANNEX A (NORMATIVE) ................................................................................................ 115 11.1 11.2 Additional object dictionary entries.......................................................................... 116 Device configuration................................................................................................. 117 Boot-up configuration process ........................................................................ 117 4

11.2.1

CONTENTS 11.2.2 11.3

CANopen EDS storage ..................................................................................................... 118

CiA

OS command and prompt........................................................................................ 120 OS command ................................................................................................... 120 OS debugger interface .................................................................................... 122 OS prompt ........................................................................................................ 124

11.3.1 11.3.2 11.3.3 11.4

Multiplexed PDOs..................................................................................................... 126 MPDO Protocol ................................................................................................ 126 Object dictionary entries .................................................................................. 127 Implementing MPDOs ..................................................................................... 129 Groups, security and network configuration tools ......................................... 129 Indication of MPDO capability in the EDS...................................................... 129

11.4.1 11.4.2 11.4.3 11.4.4 11.4.5 11.5

Additional functionality for modular CANopen devices.......................................... 130 Background ...................................................................................................... 130 Modular Devices .............................................................................................. 130

11.5.1 11.5.2 11.6

Additional communication objects ........................................................................... 132 Emergency consumer object .......................................................................... 132 Error behaviour object ..................................................................................... 133

11.6.1 11.6.2 12

INDEX ................................................................................................................................ 135

5

TABLES

CANopen

CiA

1 TABLES
Table 1: Object Dictionary Structure .......................................................................................................... 16 Table 2: Recommended Bit Timing Settings ............................................................................................. 20 Table 3: Write PDO ..................................................................................................................................... 31 Table 4: Read PDO ..................................................................................................................................... 31 Table 5: SDO Download ............................................................................................................................. 35 Table 6: Initiate SDO Download ................................................................................................................. 35 Table 7: Download SDO Segment ............................................................................................................. 36 Table 8: SDO Upload .................................................................................................................................. 36 Table 9: Initiate SDO Upload ...................................................................................................................... 37 Table 10: Upload SDO Segment ................................................................................................................ 37 Table 11: Abort SDO Transfer .................................................................................................................... 37 Table 12: SDO Block Download ................................................................................................................. 38 Table 13: Initiate SDO Block Download ..................................................................................................... 38 Table 14: Download SDO Block ................................................................................................................. 39 Table 15: End SDO Block Download ......................................................................................................... 39 Table 16: SDO Block Upload ...................................................................................................................... 40 Table 17: Initiate SDO Block Upload.......................................................................................................... 40 Table 18: Upload SDO Block ...................................................................................................................... 41 Table 19: End SDO Block Upload .............................................................................................................. 41 Table 20: SDO abort codes ........................................................................................................................ 48 Table 21: Emergency Error Codes ............................................................................................................. 60 Table 22: Start Remote Node ..................................................................................................................... 63 Table 23: Stop Remote Node ..................................................................................................................... 63 Table 24: Enter Pre-Operational................................................................................................................. 63 Table 25: Reset Node ................................................................................................................................. 64 Table 26: Reset Communication ................................................................................................................ 64 Table 27: Node Guarding Event ................................................................................................................. 65 Table 28: Life Guarding Event .................................................................................................................... 65 Table 29: Heartbeat Event .......................................................................................................................... 65 Table 30: Bootup Event............................................................................................................................... 65 Table 31: Trigger for State Transition ........................................................................................................ 75 Table 32: States and Communication Objects .......................................................................................... 77 Table 33: Broadcast Objects of the Pre-defined Connection Set ............................................................ 78 Table 34: Peer-to-Peer Objects of the Pre-defined Connection Set........................................................ 78 Table 35: Restricted COB-IDs .................................................................................................................... 78 Table 36: Format of Object Dictionary Headings ...................................................................................... 79 Table 37: Object Dictionary Object Definitions .......................................................................................... 79 Table 38: Access Attributes for Data Objects............................................................................................ 80 Table 39: Object Dictionary Data Types .................................................................................................... 80 Table 40: complex data type example ....................................................................................................... 82 6

TABLES

CANopen

CiA

Table 41: PDO Communication Parameter Record .................................................................................. 83 Table 42: PDO Mapping Parameter Record.............................................................................................. 83 Table 43: SDO Parameter Record ............................................................................................................. 83 Table 44: Identity Record ............................................................................................................................ 83 Table 45: Format of an Object Description ................................................................................................ 84 Table 46: Object Value Description Format............................................................................................... 84 Table 47: Standard Objects ........................................................................................................................ 84 Table 48: Structure of the Error Register ................................................................................................... 87 Table 49: Description of SYNC COB-ID entry ........................................................................................... 89 Table 50: Structure of read access ............................................................................................................ 93 Table 51: Structure of restore read access................................................................................................ 96 Table 52: Description of TIME COB-ID entry ............................................................................................ 97 Table 53: Description of EMCY COB-ID entry .......................................................................................... 99 Table 54: Description of SDO COB-ID entry ........................................................................................... 103 Table 55: Description of PDO COB-ID entry ........................................................................................... 106 Table 56: Description of transmission type.............................................................................................. 106

7

FIGURES

CANopen

CiA

2 FIGURES
Figure 1: Reference Model ......................................................................................................................... 14 Figure 2: Service Types .............................................................................................................................. 15 Figure 3: Device Model ............................................................................................................................... 16 Figure 4: Unconfirmed Master Slave Communication .............................................................................. 18 Figure 5: Confirmed Master Slave Communication .................................................................................. 18 Figure 6: Client/Server Communication ..................................................................................................... 19 Figure 7: Push model .................................................................................................................................. 19 Figure 8: Pull model..................................................................................................................................... 19 Figure 9: Transfer Syntax for Bit Sequences............................................................................................. 25 Figure 10: Transfer syntax for data type UNSIGNEDn ............................................................................. 26 Figure 11: Transfer syntax for data type INTEGERn ................................................................................ 26 Figure 12: Transfer syntax of data type REAL32 ...................................................................................... 27 Figure 13: Synchronous and Asynchronous Transmission ...................................................................... 30 Figure 14: Write PDO Protocol ................................................................................................................... 32 Figure 15: Read PDO Protocol ................................................................................................................... 32 Figure 16: Download SDO Protocol ........................................................................................................... 42 Figure 17: Initiate SDO Download Protocol ............................................................................................... 43 Figure 18: Download SDO Segment Protocol ........................................................................................... 44 Figure 19: Upload SDO Protocol ................................................................................................................ 45 Figure 20: Initiate SDO Upload Protocol.................................................................................................... 46 Figure 21: Upload SDO Segment Protocol................................................................................................ 47 Figure 22: Abort SDO Transfer Protocol.................................................................................................... 48 Figure 23: SDO Block Download Protocol................................................................................................. 50 Figure 24: Initiate SDO Block Download Protocol..................................................................................... 51 Figure 25: Download SDO Block Segment................................................................................................ 52 Figure 26: End SDO Block Download Protocol ......................................................................................... 53 Figure 27: Upload SDO Block Protocol...................................................................................................... 54 Figure 28: Initiate SDO Block Upload Protocol ......................................................................................... 55 Figure 29: Upload SDO Block Segment Protocol ..................................................................................... 56 Figure 30: End SDO Block Upload Protocol.............................................................................................. 57 Figure 31: SYNC Protocol........................................................................................................................... 58 Figure 32: TIME Protocol ............................................................................................................................ 59 Figure 33: Emergency State Transition Diagram ...................................................................................... 61 Figure 34: Emergency Object Data ............................................................................................................ 61 Figure 35: Emergency Object Protocol ...................................................................................................... 62 Figure 36: Start Remote Node Protocol..................................................................................................... 66 Figure 37: Stop Remote Node Protocol ..................................................................................................... 66 Figure 38: Enter Pre-Operational Protocol ................................................................................................ 67 Figure 39: Reset Node Protocol ................................................................................................................. 67 Figure 40: Reset Communication Protocol ................................................................................................ 68 8

FIGURES

CANopen

CiA

Figure 41: Node Guarding Protocol............................................................................................................ 69 Figure 42: Heartbeat Protocol..................................................................................................................... 70 Figure 43: Bootup Protocol ......................................................................................................................... 71 Figure 44: Bus Synchronisation and Actuation ......................................................................................... 72 Figure 45: Bus Synchronisation and Sampling ......................................................................................... 72 Figure 46: Optional High Resolution Synchronisation Protocol ............................................................... 73 Figure 47: Flow Chart of the Network Initialisation Process..................................................................... 74 Figure 48: State Diagram of a Device ........................................................................................................ 75 Figure 49: Structure of the Initialisation state ............................................................................................ 76 Figure 50: Identifier allocation scheme for the pre-defined connection set............................................. 78 Figure 51: structure sub-index FFh ............................................................................................................ 82 Figure 52: Structure of the Device Type Parameter ................................................................................. 86 Figure 53: Structure of the pre-defined error field ..................................................................................... 88 Figure 54: Structure of SYNC COB-ID entry ............................................................................................. 89 Figure 55: Storage write access signature ................................................................................................ 93 Figure 56: Storage read access structure.................................................................................................. 93 Figure 57: Restoring write access signature ............................................................................................. 95 Figure 58: restore procedure ...................................................................................................................... 95 Figure 59: Restoring default values read access structure ...................................................................... 95 Figure 60: Structure of TIME COB-ID entry............................................................................................... 97 Figure 61: Structure of the EMCY Identifier entry ..................................................................................... 98 Figure 62: Structure of Consumer Heartbeat Time entry ....................................................................... 100 Figure 63: Structure of Revision number ................................................................................................. 101 Figure 64: Structure of SDO COB-ID entry.............................................................................................. 103 Figure 65: Structure of PDO COB-ID entry.............................................................................................. 106 Figure 66: Structure of PDO Mapping Entry ............................................................................................ 109 Figure 67: Principle of PDO mapping....................................................................................................... 110

9

SCOPE

CANopen

CiA

3 SCOPE
This Part of EN 50325 specifies the following particular requirements for CANopen: (1) Requirements for interfaces between controllers and switching elements; (2) Normal service conditions for devices; (3) Constructional and performance requirements.

10

REFERENCES

CANopen

CiA

4 REFERENCES
4.1 Normative references Industrial communications subsystem based on ISO 11898 (CAN) for controller-device interfaces Part 1: General requirements Programmable controllers Part 3: Programming languages Information technology - Open Systems Interconnection - Basic Reference Model: The Basic Model Information technology - 8-bit single-byte coded graphic character sets Road vehicles - Interchange of digital information - Controller area network (CAN) for high-speed communication Information technology - ISO 7-bit coded character set for information interchange EN 50325-1: 2002

EN 61131-3: 1993 ISO 7498-1: 1994 ISO 8859: 1998 ISO 11898: 1993 ISO 646: 1991 4.2

Informative references Standard for binary floating-point arithmetic

IEEE 754: 1985

11

DEFINITIONS AND ABBREVIATIONS

CANopen

CiA

5 DEFINITIONS AND ABBREVIATIONS
5.1 Abbreviations ARQ: Automatic Repeat Request. CAN: Controller Area Network is an internally standardized serial bus system.. COB: Communication Object. A unit of transportation in a CAN network. Data must be sent across a CAN Network inside a COB. There are 2048 different COB's in a CAN network. A COB can contain at most 8 bytes of data. COB-ID: Each COB is uniquely identified in a CAN network by a number called the COB Identifier (COB-ID). The COB-ID determines the priority of that COB for the MAC sub-layer. Remote COB: A COB whose transmission can be requested by another device. CRC: Cyclic Redundancy Check. CSDO: Client SDO. LLC: Logical Link Control. One of the sub-layers of the Data Link Layer in the CAN Reference Model that gives the user an interface that is independent from the underlying MAC layer. MAC: Medium Access Control. One of the sub-layers of the Data Link Layer in the CAN Reference Model that controls who gets access to the medium to send a message. MDI: Medium Dependent Interface. One of the sub-layers of the Physical Layer in the CAN Reference Model that specifies the mechanical and electrical interface between the medium and a module. NMT: Network Management. One of the service elements of the application layer in the CAN Reference Model. The NMT serves to configure, initialise, and handle errors in a CAN network. Node-ID: The Node-ID of the NMT Slave has to be assigned uniquely, or 0. If 0, the protocol addresses all NMT Slaves. OSI: Open Systems Interconnection. PDO: Process Data Object. PLS: Physical Layer Signalling. One of the sub-layers of the Physical Layer in the CAN Reference Model that specifies the bit representation, timing and synchronisation. PMA: Physical Medium Attachment. One of the sub-layers of the Physical Layer in the CAN Reference Model that specifies the functional circuitry for bus line transmission/reception and may provide means for failure detection.

12

DEFINITIONS AND ABBREVIATIONS RPDO: Receive PDO. SDO: Service Data Object. SSDO: Server SDO. SYNC: Synchronisation Object. TPDO: Transmit PDO.

CANopen

CiA

13

MODELING

CANopen

CiA

6 MODELING
CAN-based networks use the following reference model, device model, and communication model. 6.1 Reference Model Application Process

Application

Application (1)

Presentation Session Transport Network

Datalink

LLC MAC PLS PMA MDI (2)

Physical

(2)

? ?

specified in this document specified in ISO 11898

Figure 1: Reference Model The communication concept can be described similar to the ISO-OSI Reference Model (left side of figure). Application Layer: The Application Layer comprises a concept to configure and communicate real-time-data as well as the mechanisms for synchronization between devices. The functionality the application layer offers to an application is logically divided over different service objects in the application layer. A service object offers a specific functionality and all the related services. These services are described in the Service Specification of that service object. Applications interact by invoking services of a service object in the application layer. To realize these services, this object exchanges data via the CAN Network with (a) peer service object(s) via a protocol. This protocol is described in the Protocol Specification of that service object. Service Primitives: Service primitives are the means by which the application and the application layer interact. There are four different primitives: ? a request is issued by the application to the application layer to request a service ? an indication is issued by the application layer to the application to report an internal event detected by the application layer or indicate that a service is requested

14

MODELING ? ?

CANopen

CiA

a response is issued by the application to the application layer to respond to a previous received indication a confirmation is issued by the application layer to the application to report the result of a previously issued request.

Application Layer Service Types

Application X
request

Application X
indication

Local Service

Provider Initiated Service

Application X

Application Y, Z, ..
indication indication indication

Application X
request

Application Y
indication

confirmation

response

Unconfirmed Service
Figure 2: Service Types

Confirmed Service

A service type defines the primitives that are exchanged between the application layer and the cooperating applications for a particular service of a service object. ? A local service involves only the local service object. The application issues a request to its local service object that executes the requested service without communicating with (a) peer service object(s). ? An unconfirmed service involves one or more peer service objects. The application issues a request to its local service object. This request is transferred to the peer service object(s) that each pass it to their application as an indication. The result is not confirmed back. A confirmed service can involve only one peer service object. The application issues a request to its local service object. This request is transferred to the peer service object that passes it to the other application as an indication. The other application issues a response that is transferred to the originating service object that passes it as a confirmation to the requesting application. A provider initiated service involves only the local service object. The service object (being the service provider) detects an event not solicited by a requested service. This event is then indicated to the application. Device Model General

?

?

Unconfirmed and confirmed services are collectively called remote services. 6.2 6.2.1

A device is structured like the following (see Figure 3): ? Communication – This function unit provides the communication objects and the appropriate functionality to transport data items via the underlying network structure. ? Object Dictionary – The Object Dictionary is a collection of all the data items which have an influence on the behavior of the application objects, the communication objects and the state machine used on this device. ? Application – The application comprises the functionality of the device with respect to the interaction with the process environment. 15

MODELING

CANopen

CiA

Thus the Object Dictionary serves as an interface between the communication and the application. The complete description of a device’s application with respect to the data items in the Object Dictionary is named device profile. Object Dictionary Application

Communication

State machine

Application object Entry 1 Entry 2 : Application object

Comm. object Comm. object

Comm. object Entry n Comm. object

Application object

Application object

Bus system

Process

Figure 3: Device Model 6.2.2 The Object Dictionary

The most important part of a device profile is the Object Dictionary description. The Object Dictionary is essentially a grouping of objects accessible via the network in an ordered pre-defined fashion. Each object within the dictionary is addressed using a 16-bit index. The overall layout of the standard Object Dictionary is shown below. This layout closely conforms with other industrial serial bus system concepts: Table 1: Object Dictionary Structure Index (hex) 0000 0001-001F 0020-003F 0040-005F 0060-007F 0080-009F 00A0-0FFF 1000-1FFF 2000-5FFF 6000-9FFF A000-BFFF C000-FFFF Object not used Static Data Types Complex Data Types Manufacturer Specific Complex Data Types Device Profile Specific Static Data Types Device Profile Specific Complex Data Types Reserved for further use Communication Profile Area Manufacturer Specific Profile Area Standardised Device Profile Area Standardised Interface Profile Area Reserved for further use

The Object Dictionary may contain a maximum of 65536 entries which are addressed through a 16-bit index. 16

MODELING

CANopen

CiA

The Static Data Types at indices 0001h through 001Fh contain type definitions for standard data types like BOOLEAN, INTEGER, floating point, string, etc. These entries are included for reference only, they cannot be read or written. Complex Data Types at indices 0020h through 003Fh are pre-defined structures that are composed of standard data types and are common to all devices. Manufacturer Specific Complex Data Types at indices 0040h through 005Fh are structures composed of standard data types but are specific to a particular device. Device Profiles may define additional data types specific to their device type. The static data types defined by the device profile are listed at indices 0060h - 007Fh, the complex ones at indices 0080h 009Fh. A device may optionally provide the structure of the supported complex data types (indices 0020h 005Fh and 0080h - 009Fh) at read access to the corresponding index. Sub-index 0 then provides the number of entries at this index, and the following sub-indices contain the data type encoded as UNSIGNED16 according to Table 39. The Communication Profile Area at indices 1000h through 1FFFh contains the communication specific parameters for the CAN network. These entries are common to all devices. The standardised device profile area at indices 6000h through 9FFFh contains all data objects common to a class of devices that can be read or written via the network. The device profiles may use entries from 6000h to 9FFFh to describe the device parameters and the device functionality. Within this range up to 8 different devices can be described. In such a case the devices are denominated Multiple Device Modules. Multiple Device Modules are composed of up to 8 device profile segments. By this feature it is possible to build devices with multiple functionality. The different device profile entries are shifted with 800h. For Multiple Device Modules the object range 6000h to 67FFh is shifted as follows: 6000h to 67FFh device 0 6800h to 6FFFh 7000h to 77FFh 7800h to 7FFFh 8000h to 87FFh 8800h to 8FFFh device 1 device 2 device 3 device 4 device 5

9000h to 97FFh device 6 9800h to 9FFFh device 7 The PDO distribution shall be used for every segment of a Multiple Device Module with an offset of 64, e.g. the first PDO of the second segment gets the number 65. In this way a system with a maximum of 8 segments is supported. The Object Dictionary concept caters for optional device features which means a manufacturer does not have to provide certain extended functionality on his devices but if he wishes to do so he must do it in a pre-defined fashion. Space is left in the Object Dictionary at indices 2000h through 5FFFh for truly manufacturer-specific functionality. 6.2.2.1 Index and Sub-Index Usage A 16-bit index is used to address all entries within the Object Dictionary. In case of a simple variable the index references the value of this variable directly. In case of records and arrays however, the index addresses the whole data structure. To allow individual elements of structures of data to be accessed via the network a sub-index is defined. For single Object Dictionary entries such as an UNSIGNED8, BOOLEAN, INTEGER32 etc. the value for the sub-index is always zero. For complex Object Dictionary entries such as arrays or records with multiple data fields the sub-index references fields within a data-structure pointed to by the main index. The fields accessed by the sub-index can be of differing data types. 6.3 Communication Model

The communication model specifies the different communication objects and services and the available modes of message transmission triggering. The communication model supports the transmission of synchronous and asynchronous messages. By means of synchronous message transmission a network wide coordinated data acquisition and actuation is possible. The synchronous transmission of messages is supported by pre-defined communication objects (Sync message, time stamp message). Synchronous messages are transmitted with respect to a pre-defined synchronization message, asynchronous message may be transmitted at any time. 17

MODELING

CANopen

CiA

Due to the event character of the underlying communication mechanism it is possible to define inhibit times for the communication. To guarantee that no starvation on the network occurs for data objects with low priorities, data objects can be assigned an inhibit time. The inhibit-time of a data object defines the minimum time that has to elapse between two consecutive invocations of a transmission service for that data object. Inhibit-times can be assigned by the application. With respect to their functionality, three types of communication relationships are distinguished ? Master/Slave relationship (Figure 4 and Figure 5) ? Client/Server relationship (Figure 6) ? Producer/Consumer relationship (Figure 7 and Figure 8) 6.3.1 Master/Slave relationship

At any time there is exactly one device in the network serving as a master for a specific functionality. All other devices in the network are considered as slaves. The master issues a request and the addressed slave(s) respond(s) if the protocol requires this behavior.

Master

Slaves
indication

request

indication

data

indication

Figure 4: Unconfirmed Master Slave Communication

Master
request Remote Transmit Request

Slave
indication

confirmation

data

response

Figure 5: Confirmed Master Slave Communication

18

MODELING 6.3.2 Client/Server relationship

CANopen

CiA

This is a relationship between a single client and a single server. A client issues a request (upload/download) thus triggering the server to perform a certain task. After finishing the task the server answers the request.

Client
request

Server
indication

data

confirmation

data

response

Figure 6: Client/Server Communication 6.3.3 Producer/Consumer relationship - Pull/Push model

The producer/consumer relationship model involves a producer and zero or more consumer(s). The push model is characterized by an unconfirmed service requested by the producer. The pull model is characterized by a confirmed service requested by the consumer.

Producer

Consumers
indication

request

indication

data

indication

Figure 7: Push model

Producer
indication Remote Transmit Request

Consumers
request request request

response

data

confirmation indication indication

Figure 8: Pull model

19

PHYSICAL LAYER

CANopen

CiA

7 PHYSICAL LAYER
The physical medium for devices is a differentially driven two-wire bus line with common return according to high-speed transmission specification in ISO 11898. 7.1 Transceiver Using the high-speed transceiver according to ISO 11898 the maximum rating for VCAN_H and VCAN_L shall be +16V. Galvanic isolation between bus nodes is optional. It is recommended to use a transceiver that is capable of sustaining mis-connection of any of the wires of the connector including the optional V+ voltages of up to 30V. 7.2 Bit rates and timing
(4)

The recommended bit rates and corresponding bit timing recommendations One of these bit rates has to be supported. Table 2: Recommended Bit Timing Settings Bit rate Bus length 1 Mbit/s 25 m 800 kbit/s 50 m 500 kbit/s 100 m 250 kbit/s (2) 250 m 125 kbit/s (2) 500 m 50 kbit/s (3) 1000 m 20 kbit/s (3) 2500 m 10 kbit/s (3) 5000 m
(1)

are listed in Table 2.

Nominal bit time tb 1 ?s 1,25 ?s 2 ?s 4 ?s 8 ?s 20 ?s 50 ?s 100 ?s

Number of time quanta per bit 8 10 16 16 16 16 16 16

Length of time quantum tq 125 ns 125 ns 125 ns 250 ns 500 ns 1,25 ?s 3,125 ?s 6,25 ?s

Location of sample point 6 tq
(750 ns) (1 ?s) (1,75 ?s) (3,5 ?s)

8 tq

14 tq 14 tq 14 tq 14 tq 14 tq 14 tq

(7 ?s) (17,5 ?s) (43,75 ?s) (87,5 ?s)

The table entries are an example based on the follow acceptance: Oscillator frequency 16 MHz +/-0.1% (1000 ppm) Sampling mode Single sampling Synchronisation mode Recessive to dominant edges only Synchronisation jump width 1 * tq Phase Segment 2 2 * tq Note 1:

SAM = 0 SYNC = 0 SJW = 0 TSEG2 = 1

Note 2:

Note 3: Note 4

Rounded bus length estimation (worst case) on basis 5 ns/m propagation delay and a total effective device internal in-out delay as follows: 1M - 800 kbit/s: 210 ns 500 - 250 kbit/s: 300 ns (includes 2 * 40 ns for optocouplers) 125 kbit/s: 450 ns (includes 2 * 100 ns for optocouplers) 50 - 10 kbit/s: 1,5 tq; Effective delay = delay recessive to dominant plus dominant to recessive divided by two. For bus length greater than about 200 m the use of optocouplers is recommended. If optocouplers are placed between CAN controller and transceiver this affects the maximum bus length depending upon the propagation delay of the optocouplers i.e. -4m per 10 ns propagation delay of employed optocoupler type. For bus length greater than about 1 km bridge or repeater devices may be needed. The bit timings in the table are calculated for an oscillator frequency of 16 MHz. If another oscillator is used the number of time quanta may be different. Nevertheless the location of the sample point shall be as near as possible at the 20

PHYSICAL LAYER recommended sample point.

CANopen

CiA

21

DATA LINK LAYER

CANopen

CiA

8 DATA LINK LAYER
The described networks are based on a data link layer and its sub-layers according to ISO 11898. 8.1 CAN Frame Type This specification is based on the CAN Standard Frames with 11-bit Identifier Field. It is not required to support the CAN Extended Frame with 29-bit Identifier Field. However, as certain applications may require the usage of the extended frame with 29-bit Identifier Field the network can be operated in this mode as well if it is supported by all nodes.

22

APPLICATION LAYER

CANopen

CiA

9 APPLICATION LAYER
9.1 9.1.1 Data Types and Encoding Rules General Description of Data Types and Encoding Rules

To be able to exchange meaningful data across the CAN network, the format of this data and its meaning have to be known by the producer and consumer(s). This specification models this by the concept of data types. The encoding rules define the representation of values of data types and the CAN network transfer syntax for the representations. Values are represented as bit sequences. Bit sequences are transferred in sequences of octets (bytes). For numerical data types the encoding is little endian style as shown in Figure 9. Applications often require data types beyond the basic data types. Using the compound data type mechanism the list of available data types can be extended. Some general extended data types are defined as “Visible String” or “Time of Day” for example (see 9.1.6.2 and 9.1.6.4). The compound data types are a means to implement user defined “DEFTYPES” in the terminology of this specification and not “DEFSTRUCTS” (see Table 37: Object Dictionary Object Definitions). 9.1.2 Data Type Definitions

A data type determines a relation between values and encoding for data of that type. Names are assigned to data types in their type definitions. The syntax of data and data type definitions is as follows (see EN 61131-3). data_definition type_definition constructor compound_constructor array_constructor structure_constructor component_list component basic_constructor ::= type_name data_name ::= constructor type_name ::= compound_constructor | basic_constructor ::= array_constructor | structure_constructor ::= ‘ARRAY’ ‘[‘ length ‘]’ ‘OF’ type_name ::= ‘STRUCT’ ‘OF’ component_list ::= component { ‘,’ component } ::= type_name component_name ::= ‘BOOLEAN’ | ‘VOID’ bit_size | ‘INTEGER’ bit_size | ‘UNSIGNED’ bit_size | ‘REAL32’ | ‘REAL64’ | ‘NIL’ ::= ‘1’ | ‘2’ | <...> | ‘64’ ::= positive_integer ::= symbolic_name ::= symbolic_name ::= symbolic_name ::= letter { [ ‘_’ ] ( letter | digit ) } ::= ( ‘1’ | ‘2’ | <...> | ‘9’ ) { digit } ::= ‘A’ | ‘B’ | <...> | ‘Z’ | ‘a’ | ‘b’ | <...> | ‘z’ ::= ‘0’ | ‘1’ | <...> | ‘9’ 23

bit_size length data_name type_name component_name symbolic_name positive_integer letter digit

APPLICATION LAYER

CANopen

CiA

Recursive definitions are not allowed. The data type defined by type_definition is called basic (res.~compound) when the constructor is basic_constructor (res. compound_constructor). 9.1.3 9.1.3.1 Bit Sequences Definition of Bit Sequences

A bit can take the values 0 or 1. A bit sequence b is an ordered set of 0 or more bits. If a bit sequence b contains more than 0 bits, they are denoted as bj, j > 0. Let b0, ..., bn-1 be bits, n a positive integer. Then b = b0 b1 ... bn-1 is called a bit sequence of length |b| = n. The empty bit sequence of length 0 is denoted ε. Examples: 10110100, 1, 101, etc. are bit sequences. The inversion operator (?) on bit sequences assigns to a bit sequence b = b0 b1 ... bn-1 the bit sequence ?b = ?b0 ?b1 ... ?bn-1 Here ?0 = 1 and ?1 = 0 on bits. The basic operation on bit sequences is concatenation. Let a = a0 ... am-1 and b = b0 ... bn-1 be bit sequences. Then the concatenation of a and b, denoted ab, is ab = a0 ... am-1 b0 ... bn-1 Example: (10)(111) = 10111 is the concatenation of 10 and 111. The following holds for arbitrary bit sequences a and b: |ab| = |a| + |b| and εa = a ε = a 9.1.3.2 Transfer Syntax for Bit Sequences For transmission across a CAN network a bit sequence is reordered into a sequence of octets. Here and in the following hexadecimal notation is used for octets. Let b = b0...bn-1 be a bit sequence with n<64. Denote k a non-negative integer such that 8(k - 1) < n < 8k. Then b is transferred in k octets assembled as shown in Figure 9. The bits bi, i > n of the highest numbered octet are do not care bits. Octet 1 is transmitted first and octet k is transmitted last. Hence the bit sequence is transferred as follows across the CAN network: b7, b6, ..., b0, b15, ..., b8, ...

24

APPLICATION LAYER
octet number 1. b7 .. b0

CANopen
2. b15 .. b8 k. b8k –1 .. b8k -8

CiA

Figure 9: Transfer Syntax for Bit Sequences Example: Bit 9 10 2h ... 0001 1h Ch = 21Ch The bit sequence b = b0 .. b9 = 0011 1000 01 represents an UNSIGNED10 with the value 21Ch and is transferred in two octets: First 1Ch and then 02h. 9.1.4 Basic Data Types Bit 0 1100

For basic data types “type_name” equals the literal string of the associated constructor (aka symbolic_name), e.g., BOOLEAN BOOLEAN is the type definition for the BOOLEAN data type. 9.1.4.1 NIL Data of basic data type NIL is represented by ε. 9.1.4.2 Boolean Data of basic data type BOOLEAN attains the values TRUE or FALSE. The values are represented as bit sequences of length 1. The value TRUE (res. FALSE) is represented by the bit sequence 1 (res. 0). 9.1.4.3 Void Data of basic data type VOIDn is represented as bit sequences of length n bit. The value of data of type VOIDn is undefined. The bits in the sequence of data of type VOIDn must either be specified explicitly or else marked "do not care". Data of type VOIDn is useful for reserved fields and for aligning components of compound values on octet boundaries. 9.1.4.4 Unsigned Integer Data of basic data type UNSIGNEDn has values in the non-negative integers. The value range is 0, ..., 2n-1. The data is represented as bit sequences of length n. The bit sequence b = b0 ...bn-1 is assigned the value UNSIGNEDn(b) = bn-1 2n-1+ ...+ b1 21 + b0 20 Note that the bit sequence starts on the left with the least significant byte. Example: The value 266 = 10Ah with data type UNSIGNED16 is transferred in two octets across the bus, first 0Ah and then 01h.

25

APPLICATION LAYER

CANopen

CiA

The following UNSIGNEDn data types are transferred as shown below:
octet number UNSIGNED8 UNSIGNED16 UNSIGNED24 UNSIGNED32 UNSIGNED40 UNSIGNED48 UNSIGNED56 UNSIGNED64 1. b7..b0 b7..b0 b7..b0 b7..b0 b7..b0 b7..b0 b7..b0 b7..b0 b15..b8 b15..b8 b15..b8 b15..b8 b15..b8 b15..b8 b15..b8 b23..b16 b23..b16 b23..b16 b23..b16 b23..b16 b23..b16 b31..b24 b31..b24 b31..b24 b31..b24 b31..b24 b39..b32 b39..b32 b39..b32 b39..b32 b47..b40 b47..b40 b47..b40 b55..b48 b55..b48 b63..b56 2. 3. 4. 5. 6. 7. 8.

Figure 10: Transfer syntax for data type UNSIGNEDn 9.1.4.5 Signed Integer

Data of basic data type INTEGERn has values in the integers. The value range is -2n-1, ..., 2n-1-1. The data is represented as bit sequences of length n. The bit sequence b = b0 .. bn-1 is assigned the value INTEGERn(b) = bn-2 2n-2 + ...+ b1 21 + b0 20 if bn-1 = 0 and, performing two's complement arithmetic, INTEGERn(b) = - INTEGERn(^b) - 1 if bn-1 = 1 Note that the bit sequence starts on the left with the least significant bit. Example: The value –266 = FEF6h with data type INTEGER16 is transfered in two octets across the bus, first F6h and then FEh. The following INTEGERn data types are transfered as shown below:
octet number INTEGER8 INTEGER16 INTEGER24 INTEGER32 INTEGER40 INTEGER48 INTEGER56 INTEGER64 1. b7..b0 b7..b0 b7..b0 b7..b0 b7..b0 b7..b0 b7..b0 b7..b0 b15..b8 b15..b8 b15..b8 b15..b8 b15..b8 b15..b8 b15..b8 b23..b16 b23..b16 b23..b16 b23..b16 b23..b16 b23..b16 b31..b24 b31..b24 b31..b24 b31..b24 b31..b24 b39..b32 b39..b32 b39..b32 b39..b32 b47..b40 b47..b40 b47..b40 b55..b48 b55..b48 b63..b56 2. 3. 4. 5. 6. 7. 8.

Figure 11: Transfer syntax for data type INTEGERn

26

APPLICATION LAYER 9.1.4.6 Floating-Point Numbers

CANopen

CiA

Data of basic data types REAL32 and REAL64 have values in the real numbers. The data type REAL32 is represented as bit sequence of length 32. The encoding of values follows the IEEE 754-1985 Standard for single precision floating-point. The data type REAL64 is represented as bit sequence of length 64. The encoding of values follows the IEEE 754-1985 Standard for double precision floating-point numbers. A bit sequence of length 32 either has a value (finite non-zero real number, +0, + _) or is NaN (not-anumber). The bit sequence b = b0 … b31 is assigned the value (finite non-zero number) REAL32(b) = (-1)S 2E - 127 (1 + F) Here S = b31 is the sign. E = b30 27 + …+ b23 20, 0 < E < 255, is the un-biased exponent. F = 2-23 (b22 222 + …+ b1 21 + b0 20) is the fractional part of the number. E = 0 is used to represent + 0. E = 255 is used to represent infinities and NaN's. Note that the bit sequence starts on the left with the least significant bit. Example: 6.25 = 2E -127 (1 + F) with E =129 =27 +20 and F = 2-1 +2-4 = 2 -23(222+219) hence the number is represented as: S b31 0 E b30 .. b23 100 0000 1 F b22 .. b0 100 1000 0000 0000 0000 0000

6.25 = b0 .. b31 = 0000 0000 0000 0000 0001 0011 0000 0010 It is transferred in the following order:
octet number REAL32 1. 00h b7..b0 2. 00h b15..b8 3. C8h b23..b16 4. 40h b31..b24

Figure 12: Transfer syntax of data type REAL32

27

APPLICATION LAYER 9.1.5 Compound Data Types

CANopen

CiA

Type definitions of compound data types expand to a unique list of type definitions involving only basic data types. Correspondingly, data of compound type ?type_name? are ordered lists of component data named ?component_name_i? of basic type ?basic_type_i?. Compound data types constructors are ARRAY and STRUCT OF. STRUCT OF basic_type_1 basic_type_2 … basic_type_N type_name component_name_1, component_name_2, … component_name_N

ARRAY [ length ] OF basic_type type_name The bit sequence representing data of compound type is obtained by concatenating the bit sequences representing the component data. Assume that the components ?component_name_i? are represented by their bit sequences b(i), for i = 1,…,N Then the compound data is represented by the concatenated sequence b0(1) .. bn-1(1) .. bn-1(N). Example: Consider the data type STRUCT OF INTEGER10 x, UNSIGNED5 u NewData Assume x = - 423 = 259h and u = 30 = 1Eh. Let b(x) and b(u) denote the bit sequences representing the values of x and u, respectively. Then: b(x) = b0(x) .. b9(x) = 1001101001 b(u) = b0(u) .. b4(u) = 01111 b(xu) = b(x) b(u) = b0(xu) .. b14(xu) = 1001101001 01111 The value of the structure is transferred with two octets, first 59h and then 7Ah. 9.1.6 Extended Data Types

The extended data types consist of the basic data types and the compound data types defined in the following subsections. 9.1.6.1 Octet String The data type OCTET_STRINGlength is defined below; length is the length of the octet string. ARRAY [ length ] OF UNSIGNED8 OCTET_STRINGlength 9.1.6.2 Visible String

The data type VISIBLE_STRINGlength is defined below. The admissible values of data of type VISIBLE_CHAR are 0h and the range from 20h to 7Eh. The data are interpreted as ISO 646-1973(E) 7-bit coded characters. length is the length of the visible string. UNSIGNED8 VISIBLE_CHAR ARRAY [ length ] OF VISIBLE_CHAR There is no 0h necessary to terminate the string. 9.1.6.3 Unicode String VISIBLE_STRINGlength

The data type UNICODE_STRINGlength is defined below; length is the length of the unicode string. ARRAY [ length ] OF UNSIGNED16 UNICODE_STRINGlength 9.1.6.4 Time of Day The data type TIME_OF_DAY represents absolute time. It follows from the definition and the encoding rules that TIME_OF_DAY is represented as bit sequence of length 48.

28

APPLICATION LAYER

CANopen

CiA

Component ms is the time in milliseconds after midnight. Component days is the number of days since January 1, 1984. STRUCT OF UNSIGNED28 VOID4 UNSIGNED16 TIME_OF_DAY 9.1.6.5 Time Difference ms, reserved, days

The data type TIME_DIFFERENCE represents a time difference. It follows from the definition and the encoding rules that TIME_DIFFERENCE is represented as bit sequence of length 48. Time differences are sums of numbers of days and milliseconds. Component ms is the number milliseconds. Component days is the number of days. STRUCT OF UNSIGNED28 VOID4 UNSIGNED16 TIME_DIFFERENCE 9.1.6.6 Domain ms, reserved, days

Domains can be used to transfer an arbitrary large block of data from a client to a server and vv. The contents of a data block is application specific and does not fall within the scope of this document. 9.2 Communication Objects The communication objects are described by the services and protocols. All services are described in a tabular form that contains the parameters of each service primitive that is defined for that service. The primitives that are defined for a particular service determine the service type (e.g. unconfirmed, confirmed, etc.). How to interpret the tabular form and what service types exist is defined in 6.3 (Communication Model). All services assume that no failures occur in the Data Link and Physical Layer of the CAN network. These failures are resolved by the application and fall not in the scope of this document. 9.2.1 Process Data Object (PDO)

The real-time data transfer is performed by means of "Process Data Objects (PDO)". The transfer of PDOs is performed with no protocol overhead. The PDOs correspond to entries in the device Object Dictionary and provide the interface to the application objects. Data type and mapping of application objects into a PDO is determined by a corresponding default PDO mapping structure within the Device Object Dictionary. If variable PDOmapping is supported the number of PDOs and the mapping of application objects into a PDO may be transmitted to a device during the device configuration process (see Initialisation Procedure) by applying the SDO services to the corresponding entries of the Object Dictionary. Number and length of PDOs of a device is application specific and have to be specified within the device profile. There are two kinds of use for PDOs. The first is data transmission and the second data reception. It is distinguished in Transmit-PDOs (TPDOs) and Receive-PDOs (RPDOs). Devices supporting TPDOs are PDO producer and devices which are able to receive PDOs are called PDO consumer. PDOs are described by the PDO communication parameter (20h) and the PDO mapping parameter (21h). The structure of these data types are explained in 9.5.4. The PDO communication parameter describes the communication capabilities of the PDO. The PDO mapping parameter contains information about the contents of the PDOs (device variables). The indices of the corresponding Object Dictionary entries are computed by the following formulas: ? ? ? RPDO communication parameter index = 1400h + RPDO-number -1 TPDO communication parameter index = 1800h + TPDO-number -1 RPDO mapping parameter index = 1600h + RPDO-number -1 29

APPLICATION LAYER ?

CANopen

CiA

TPDO mapping parameter index = 1A00h + TPDO-number -1

For each PDO the pair of communication and mapping parameter is mandatory. The entries mentioned above are described in 9.5 (Object Dictionary). 9.2.1.1 Transmission Modes The following PDO transmission modes are distinguished: ? Synchronous Transmission ? Asynchronous Transmission In order to synchronise devices a synchronisation object (SYNC object) is transmitted periodically by a synchronisation application. The SYNC object is represented by a pre-defined communication object (see 9.2.3). In Figure 13 the principle of synchronous and asynchronous transmission is shown. Synchronous PDOs are transmitted within a pre-defined time-window immediately after the SYNC object. The principle of synchronous transmission is described in more detail in 9.3.

SYNC Object

Synchronous Window Length

SYNC Object

SYNC Object

time Synchronous PDOs Asynchronous PDOs

Figure 13: Synchronous and Asynchronous Transmission The transmission type parameter of a PDO specifies the transmission mode as well as the triggering mode. For synchronous TPDOs the transmission type also specifies the transmission rate in form of a factor based on the basic SYNC-object transmission period. A transmission type of 0 means that the message shall be transmitted after occurrence of the SYNC but acyclic (not periodically), only if an event occurred before the SYNC. A transmission type of 1 means that the message is transmitted with every SYNC object. A transmission type of n means that the message is transmitted with every n-th SYNC object. Asynchronous TPDOs are transmitted without any relation to a SYNC. The data of synchronous RPDOs received after the occurrence of a SYNC is passed to the application with the occurrence of the following SYNC, independent of the transmission rate specified by the transmission type. The data of asynchronous RPDOs is passed directly to the application. 9.2.1.2 Triggering Modes

Three message triggering modes are distinguished: ? Event Driven Message transmission is triggered by the occurrence of an object specific event. For synchronous PDOs this is the expiration of the specified transmission period, synchronised by the reception of the SYNC object. For acyclically transmitted synchronous PDOs and asynchronous PDOs the triggering of a message transmission is a device-specific event specified in the device profile. ? Timer Driven Message transmission is either triggered by the occurrence of a device-specific event or if a specified time has elapsed without occurrence of an event.

30

APPLICATION LAYER

CANopen

CiA

? Remotely requested The transmission of an asynchronous PDO is initiated on receipt of a remote request initiated by any other device (PDO consumer).

9.2.1.3

PDO Services

PDO transmission follows the producer/consumer relationship as described in 6.3.3. Attributes: - PDO number: - user type: - data type: - inhibit-time: 9.2.1.3.1 Write PDO PDO number [1..512] for every user type on the local device one of the values {consumer, producer} according to the PDO mapping n*100 ?s, n >> 0

For the Write PDO service the push model is valid. There are zero or more consumers of a PDO. A PDO has exactly one producer. Through this service the producer of a PDO sends the data of the mapped application objects to the consumer(s). Table 3: Write PDO Parameter Argument PDO Number Data Request / Indication Mandatory mandatory mandatory

9.2.1.3.2

Read PDO

For the Read PDO service the pull model is valid. There are one or more consumers of a PDO. A PDO has exactly one producer. Through this service the consumer of a PDO requests the producer to supply the data of the mapped application objects. The service is confirmed. The remote result parameter will confirm the value. Table 4: Read PDO Parameter Argument PDO Number Remote Result Data Request / Indication Mandatory mandatory Mandatory mandatory Response / Confirm

31

APPLICATION LAYER 9.2.1.4 9.2.1.4.1 PDO Protocol Write PDO Protocol

CANopen

CiA

The service for a PDO write request is unconfirmed. The PDO producer sends the process data within a PDO to the network. There can be 0..n PDO consumers. At the PDO consumer(s) the reception of a valid PDO is indicated. Figure 14 shows the Write PDO Protocol.

PDO Producer
0 Request

Write PDO
L (0 ≤ L ≤ 8)

PDO Consumers
Indication Indication Indication

Process Data

Figure 14: Write PDO Protocol Process-Data: up to L bytes of application data according to the PDO mapping If L exceeds the number of bytes ‘n’ defined by the actual PDO mapping length only the first ‘n’ bytes are used by the consumer. If L is less than ‘n’ the data of the received PDO is not processed and an Emergency message with error code 8210h has to be produced if Emergency is supported. 9.2.1.4.2 Read PDO Protocol The service for a PDO read request is confirmed. One or more PDO consumer transmit a remote transmission request frame (RTR) to the network. At the reception of the RTR frame the PDO producer for the requested PDO transmits the PDO. At all PDO consumers for this PDO the reception is indicated. There can be 0..n PDO consumers. The read service is optional and depends on the hardware capabilities. Figure 15 shows the Read PDO Protocol.

PDO Producer
Indication

Read PDO
Remote Transmit Request

PDO Consumers
request

0 response

L (0 ≤ L ≤ 8)

Process Data

confirmation

Figure 15: Read PDO Protocol Process-Data: up to L bytes of application data according to the PDO mapping If L exceeds the number of bytes ‘n’ defined by the actual PDO mapping length only the first ‘n’ bytes are used by the consumer. If L is less than ‘n’ the data of the received PDO is not processed and an Emergency message with error code 8210h has to be produced if Emergency is supported.

32

APPLICATION LAYER 9.2.2 Service Data Object (SDO)

CANopen

CiA

With Service Data Objects (SDOs) the access to entries of a device Object Dictionary is provided. As these entries may contain data of arbitrary size and data type SDOs can be used to transfer multiple data sets (each containing an arbitrary large block of data) from a client to a server and vice versa. The client can control via a multiplexor (index and sub-index of the Object Dictionary) which data set is to be transferred. The contents of the data set are defined within the Object Dictionary. Basically a SDO is transferred as a sequence of segments. Prior to transferring the segments there is an initialisation phase where client and server prepare themselves for transferring the segments. For SDOs, it is also possible to transfer a data set of up to four bytes during the initialisation phase. This mechanism is called an expedited transfer. Optionally a SDO can be transferred as a sequence of blocks where each block is a sequence of up to 127 segments containing a sequence number and the data. Prior to transferring the blocks there is an initialisation phase where client and server can prepare themselves for transferring the blocks and negotiating the number of segments in one block. After transferring the blocks there is a finalisation phase where client and server can optionally verify the correctness of the previous data transfer by comparing checksums derived from the data set. This transfer type mentioned above is called a block transfer which is faster than the segmented transfer for a large set of data. In SDO Block Upload it is possible that the size of the data set does not justify the use of a block transfer because of the implied protocol overhead. In these cases a support for a fallback to the segmented or expedited transfer in initialisation phase can be implemented. As the assumption of the minimal data set size for which a block transfer outperforms the other transfer types depends on various parameters the client indicates this threshold value in bytes to the server in initialisation phase. For the block transfer a Go-Back-n ARQ (Automatic Repeat Request) scheme is used to confirm each block. After block download the server indicates the client the last successfully received segment of this block transfer by acknowledging this segment sequence number. Doing this the server implicitly acknowledges all segments preceding this segment. The client has to start the following block transfer with the retransmission of all not acknowledged data. Additionally the server has to indicate the number of segments per block for the next block transfer. After block upload the client indicates the server the last successfully received segment of this block transfer by acknowledging this segment sequence number. Doing this the client implicitly acknowledges all segments preceding this segment. The server has to start the following block transfer with the retransmission of all not acknowledged data. Additionally the client has to indicate the number of segments per block for the next block transfer. For all transfer types it is the client that takes the initiative for a transfer. The owner of the accessed Object Dictionary is the server of the SDO. Both the client or the server can take the initiative to abort the transfer of a SDO. By means of a SDO a peer-to-peer communication channel between two devices is established. A device may support more than one SDO. One supported Server-SDO (SSDO) is the default case (Default SDO). SDOs are described by the SDO communication parameter record (22h).The structure of this data type is explained in 9.5.4. The SDO communication parameter describes the communication capabilities of the Server-SDOs and Client-SDOs (CSDO). The indices of the corresponding Object Dictionary entries are computed by the following formulas: ? ? SSDO communication parameter index = 1200h + SSDO-number -1 CSDO communication parameter index = 1280h + CSDO-number -1

For each SDO the communication parameters are mandatory. If only one SSDO exists the communication parameters can be omitted. The entries mentioned above are described in 9.5 (Object Dictionary). 9.2.2.1 SDO Services The model for the SDO communication is the Client/Server model as described in 0. Attributes: - SDO number: SDO number [1..128] for every user type on the local device - user type: one of the values {client, server} - mux data type multiplexor containing index and sub-index of type STRUCTURE OF UNSIGNED (16) , UNSIGNED (8) , with index specifying an entry of the device Object 33

APPLICATION LAYER

CANopen

CiA

Dictionary and "sub-index" specifying a component of a device object dictionary entry - transfer type: depends on the length of data to transfer: expedited for up to 4 data bytes segmented or block for more than 4 data bytes - data type: according to the referenced index and sub-index The following services can be applied onto a SDO depending on the application requirements: ? SDO Download, which can be split up into - Initiate SDO Download - Download SDO Segment ? SDO Upload, which can be split up into - Initiate SDO Upload - Upload SDO Segment ? Abort SDO Transfer When using the segmented SDO download and upload services, the communication software will be responsible for transferring the SDO as a sequence of segments. Expetited transfer has to be supported. Segmented transfer has to be supported if objects larger than 4 Bytes are supported. Optionally the following SDO services for doing a block transfer with higher bus utilisation and performance for a large data set size can be implemented: ? SDO Block Download, which can be split up into - Initiate Block Download - Download Block - End Block Download ? SDO Block Upload, which can be split up into - Initiate Block Upload - Upload Block - End Block Upload When using the SDO block download and upload services, the communication software will be responsible for transferring the data as a sequence of blocks. In SDO Block Upload Protocol a support for a switch to SDO Upload Protocol in ‘Initiate SDO Block Upload’ can be implemented to increase transfer performance for data which size does not justifies using the protocol overhead of the ‘SDO Block Upload’ protocol. For aborting a SDO block transfer the Abort SDO Transfer Service is used. 9.2.2.1.1 SDO Download Through this service the client of a SDO downloads data to the server (owner of the Object Dictionary). The data, the multiplexor (index and sub-index) of the data set that has been downloaded and its size (only optionally for segmented transfer) are indicated to the server. The service is confirmed. The remote result parameter will indicate the success or failure of the request. In case of a failure, optionally the reason is confirmed. The SDO download consists of at least the Initiate SDO Download service and optional of Download SDO Segment services (data length > 4 bytes).

34

APPLICATION LAYER

CANopen Table 5: SDO Download

CiA

Parameter Argument SDO Number Data Size Multiplexor Remote Result Success Failure Reason

Request / Indication Mandatory mandatory mandatory optional mandatory

Response / Confirm

Mandatory selection selection optional

9.2.2.1.2

Initiate SDO Download

Through this service the client of SDO requests the server to prepare for downloading data to the server. Optionally the size of the data to be downloaded is indicated to the server. The multiplexor of the data set whose download is initiated and the transfer type are indicated to the server. In case of an expedited download, the data of the data set identified by the multiplexor and size is indicated to the server. Table 6: Initiate SDO Download Parameter Argument SDO Number Size Multiplexor Transfer type Normal Expedited Data Remote Result Success Request / Indication Mandatory mandatory optional mandatory mandatory selection selection mandatory Mandatory mandatory Response / Confirm

The service is confirmed. The remote result parameter will indicate the success of the request. In case of a failure, an Abort SDO Transfer request has to be executed. In the case of a successful expedited download of a multiplexed DOMAIN, this service concludes the download of the data set identified by multiplexor. 9.2.2.1.3 Download SDO Segment Through this service the client of a SDO supplies the data of the next segment to the server. The segment data and optionally its size are indicated to the server. The continue parameter indicates the server whether there are still more segments to be downloaded or that this was the last segment to be downloaded.

35

APPLICATION LAYER

CANopen Table 7: Download SDO Segment

CiA

Parameter Argument SDO number Data Size Continue More Last Remote Result Success

Request / Indication Mandatory mandatory mandatory optional mandatory selection selection

Response / Confirm

Mandatory mandatory

The service is confirmed. The remote result parameter will indicate the success of the request. In case of a failure, an Abort SDO transfer request must be executed. In case of success, the server has accepted the segment data and is ready to accept the next segment. There can be at most one Download SDO Segment service outstanding for a SDO transfer. A successful Initiate SDO Download service with segmented transfer type must have been executed prior to this service. 9.2.2.1.4 SDO Upload Through this service the client of a SDO uploads data from the server. The multiplexor (index and subindex) of the data set that has to be uploaded is indicated to the server. The SDO upload consists of at least the Initiate SDO Upload service and optional of Upload SDO Segment services (data length > 4 bytes). Table 8: SDO Upload Parameter Argument SDO number Multiplexor Remote Result Success Data Size Failure Reason Request / Indication Mandatory mandatory mandatory Mandatory selection mandatory optional selection optional Response / Confirm

The service is confirmed. The remote result parameter will indicate the success or failure of the request. In case of a failure, optionally the reason is confirmed. In case of success, the data and its size (optionally for segmented transfer) are confirmed. 9.2.2.1.5 Initiate SDO Upload Through this service the client of a SDO requests the server to prepare for uploading data to the client. The multiplexor (index and sub-index) of the data set whose upload is initiated is indicated to the server. The service is confirmed. The remote result parameter will indicate the success of the request. In case of a failure, an Abort SDO Transfer request has to be executed. In the case of success, the size (optionally for segmented transfer) of the data to be uploaded is confirmed. In case of successful expedited upload, this service concludes the upload of the data set identified by multiplexor and the corresponding data is confirmed.

36

APPLICATION LAYER

CANopen Table 9: Initiate SDO Upload

CiA

Parameter Argument SDO number Multiplexor Remote Result Success Size Multiplexor Transfer type Normal Expedited Data

Request / Indication Mandatory mandatory mandatory

Response / Confirm

Mandatory mandatory optional mandatory mandatory selection selection mandatory

9.2.2.1.6

Upload SDO Segment

Through this service the client of a SDO requests the server to supply the data of the next segment. The continue parameter indicates the client whether there are still more segments to be uploaded or that this was the last segment to be uploaded. There can be at most one Upload SDO Segment service outstanding for a SDO. The service is confirmed. The remote result parameter will indicate the success of the request. In case of a failure, an Abort SDO Transfer request must be executed. In case of success, the segment data and optionally its size are confirmed. A successful Initiate SDO Upload service with segmented transfer type must have been executed prior to this service. Table 10: Upload SDO Segment Parameter Argument SDO number Remote Result Success Data Size Continue More Last Request / Indication Mandatory mandatory Mandatory mandatory mandatory optional mandatory selection selection Response / Confirm

9.2.2.1.7

Abort SDO Transfer

This service aborts the up- or download of a SDO referenced by is number. Optionally the reason is indicated. The service is unconfirmed. The service may be executed at any time by both the client and the server of a SDO. If the client of a SDO has a confirmed service outstanding, the indication of the abort is taken to be the confirmation of that service. Table 11: Abort SDO Transfer Parameter Argument SDO number Multiplexor Reason Request / Indication Mandatory mandatory mandatory mandatory

37

APPLICATION LAYER 9.2.2.1.8 SDO Block Download

CANopen

CiA

Through this service the client of SDO downloads data to the server of SDO (owner of the Object Dictionary) using the block download protocol. The data, the multiplexor (index and sub-index) of the data set that has been downloaded and optionally its size are indicated to the server. The service is confirmed. The remote result parameter will indicate the success or failure of the request. In case of a failure, optionally the reason is confirmed. Table 12: SDO Block Download Parameter Argument SDO Number Data Size Multiplexor Remote Result Success Failure Reason Request / Indication Mandatory mandatory mandatory optional mandatory Mandatory selection selection optional Response / Confirm

9.2.2.1.9

Initiate SDO Block Download

Through this service the client of SDO requests the server of SDO (owner of the Object Dictionary) to prepare for downloading data to the server. The multiplexor of the data set whose download is initiated and optionally the size of the downloaded data in bytes are indicated to the server. The client as well as the server indicating their ability and/or demand to verify the complete transfer with a checksum in End SDO Block Download. Table 13: Initiate SDO Block Download Parameter Argument SDO Number Size CRC ability yes no Multiplexor Remote Result Success CRC ability yes no Blksize Request / Indication Mandatory mandatory optional mandatory selection selection mandatory Mandatory mandatory mandatory selection selection mandatory Response / Confirm

The service is confirmed. The Remote Result parameter will indicate the success of the request, the number of segments per block the server of SDO is able to receive and its ability and/or demand to verify the complete transfer with a checksum. In case of a failure, an Abort SDO Transfer request must be executed. 9.2.2.1.10 Download SDO Block By this service the client of SDO supplies the data of the next block to the server of SDO. The block data is indicated to the server by a sequence of segments. Each segment consists of the data and a sequence number starting with 1 which is increased for each segment by 1 up to blksize. The parameter blksize is negotiated between server and client in the ‘Initiate Block Download’ protocol and can be changed by the server with each confirmation for a block transfer. The continue parameter 38

APPLICATION LAYER

CANopen

CiA

indicates the server whether to stay in the ‘Download Block’ phase or to change in the ‘End Download Block’ phase. Table 14: Download SDO Block Parameter Argument SDO Number Data Continue More Last Remote Result Success Ackseq Blksize Request / Indication Mandatory mandatory mandatory mandatory selection selection Mandatory mandatory mandatory mandatory Response / Confirm

The service is confirmed. The Remote Result parameter will indicate the success of the request. In case of a success the ackseq parameter indicates the sequence number of the last segment the server has received successfully. If this number does not correspond with the sequence number of the last segment sent by the client during this block transfer the client has to retransmit all segments discarded by the server with the next block transfer. In case of a fatal failure, an Abort SDO Transfer request must be executed. In case of success, the server has accepted all acknowledged segment data and is ready to accept the next block. There can be at most one Download SDO Block service outstanding for a SDO transfer. A successful 'Initiate SDO Block Download' service must have been executed prior to this service. 9.2.2.1.11 End SDO Block Download Through this service the SDO Block Download is concluded. The number of bytes not containing valid data in the last transmitted segments is indicated to the server. If the server as well as the client have indicated their ability and demand to check the complete transfer with a checksum in ‘Initiate SDO Block Download’ this checksum is indicated to the server by the client. The server also has to generate a checksum which has to be compared with the one generated by the client. Table 15: End SDO Block Download Parameter Argument SDO Number Valid_data Ckecksum Remote Result Success Request / Indication Mandatory mandatory mandatory mandatory if negotiated in initiate Mandatory mandatory Response / Confirm

The service is confirmed. The Remote Result parameter will indicate the success of the request (matching checksums between client and server if negotiated) and concludes the download of the data set . In case of a failure, an Abort SDO Transfer request must be executed. 9.2.2.1.12 SDO Block Upload Through this service the client of SDO uploads data from the server of SDO (owner of the Object Dictionary) using the SDO block upload protocol. The data, the multiplexor (index and sub-index) of the data set that has to be uploaded and optionally its size are indicated to the server. The service is confirmed. The Remote Result parameter will indicate the success or failure of the request. In case of a failure, optionally the reason is confirmed. In case of a success, the data and optionally its size is confirmed. 39

APPLICATION LAYER

CANopen Table 16: SDO Block Upload

CiA

Parameter Argument SDO Number Multiplexor Remote Result Success Data Size Failure Reason

Request / Indication Mandatory mandatory mandatory

Response / Confirm

Mandatory selection mandatory optional selection optional

9.2.2.1.13

Initiate SDO Block Upload

Through this service the client of SDO requests the server of SDO (owner of the Object Dictionary) to prepare for uploading data to the client. The multiplexor of the data set whose upload is initiated and the number of segments the client of the SDO is able to receive are indicated to the server. A protocol switch threshold value is indicated to the server. If the number of bytes that has to be uploaded is less or equal this value the server can optionally conclude this data transfer with the ‘SDO Upload Protocol’ as described in 9.2.2.1.4. The client as well as the server indicating their ability and/or demand to verify the complete transfer with a checksum in End SDO Block Upload Optionally the size of the uploaded data in bytes are indicated to the client. Table 17: Initiate SDO Block Upload Parameter Argument SDO Number Blksize CRC ability Yes No Multiplexor Threshold Remote Result Success CRC ability Yes No Size Request / Indication Mandatory mandatory mandatory mandatory selection selection mandatory mandatory Mandatory mandatory mandatory selection selection optional Response / Confirm

The service is confirmed. In case of a failure, an Abort SDO Transfer request must be executed. In case of success the size of the data in bytes to be uploaded is optionally indicated to the client. If the size of the data that has to be uploaded is less or equal threshold the server can continue with the SDO block upload protocol. In this case the Remote Result parameter and the further protocol is described in 9.2.2.2.14. 9.2.2.1.14 Upload SDO Block Through this service the client of SDO uploads the data of the next block from the server of SDO. The block data is indicated to the client by a sequence of segments. Each segment consists of the segment data and a sequence number starting with 1 which is increased for each segment by 1 up to blksize. The parameter blksize is negotiated between server and client in the ‘Initiate Block Upload’ protocol and can be changed by the client with each confirmation for a block transfer. The continue parameter indicates the client whether to stay in the ‘Upload Block’ phase or to change in the ‘End Upload Block’ phase.

40

APPLICATION LAYER

CANopen Table 18: Upload SDO Block

CiA

Parameter Argument SDO Number Data Continue More Last Remote Result Success Ackseq Blksize

Request / Indication Mandatory mandatory mandatory mandatory selection selection

Response / Confirm

Mandatory mandatory mandatory mandatory

The service is confirmed. The Remote Result parameter will indicate the success of the request. In case of a success the ackseq parameter indicates the sequence number of the last segment the client has received successfully. If this number does not correspond with the sequence number of the last segment sent by the server during this block transfer the server has to retransmit all segments discarded by the client with the next block transfer. In case of a fatal failure, an Abort SDO Transfer request must be executed. In case of success, the client has accepted all acknowledged segment data and is ready to accept the next block. There can be at most one Upload Block service outstanding for a SDO transfer. A successful 'Initiate SDO Block Upload' service must have been executed prior to this service. 9.2.2.1.15 End SDO Block Upload

Through this service the SDO Block Upload is concluded. The number of bytes not containing valid data in the last transmitted segments is indicated to the client. If the server as well as the client have indicated their ability and demand to check the complete transfer with a checksum during ‘Initiate SDO Block Upload’ this checksum is indicated to the client by the server. The client also has to generate a checksum which has to be compared with the one generated by the server. Table 19: End SDO Block Upload Parameter Argument SDO Number Valid_data Checksum Remote Result Success Request / Indication Mandatory mandatory mandatory mandatory if negotiated in initiate Mandatory mandatory Response / Confirm

The service is confirmed. The Remote Result parameter will indicate the success of the request (matching checksums between client and server if demanded) and concludes the download of the data set. In case of a failure, an Abort SDO Transfer request must be executed.

41

APPLICATION LAYER 9.2.2.2 SDO Protocols

CANopen

CiA

Six confirmed services (SDO Download, SDO Upload, Initiate SDO Upload, Initiate SDO Download, Download SDO Segment, and Upload SDO Segment) and one unconfirmed service (Abort SDO Transfer) are defined for Service Data Objects doing the standard segmented/expedited transfer. Eight confirmed services (SDO Block Download, SDO Block Upload, Initiate SDO Upload, Initiate SDO Block Download, Download SDO Segment, Upload SDO Segment, End SDO Upload and End SDO Block Download) and one unconfirmed service (Abort SDO Block Transfer) are defined for Service Data Objects doing the optional block transfer. 9.2.2.2.1 Download SDO Protocol

Client

SDO Download (normal)

Server

Client

SDO Download (expedited)

Server

Initiate SDO Download

(e=0)

Initiate SDO Download

(e=1)

Download SDO Segment (t=0, c=0)

Download SDO Segment (t=1, c=0)

Download SDO Segment (t=0, c=0)

Download SDO Segment (t=?, c=1)

Figure 16: Download SDO Protocol This protocol is used to implement the SDO Download service. SDOs are downloaded as a sequence of zero or more Download SDO Segment services preceded by an Initiate SDO Download service. The sequence is terminated by: ? an Initiate SDO Download request/indication with the e-bit set to 1 followed by an Initiate SDO Download response/confirm, indicating the successful completion of an expedited download sequence. ? a Download SDO Segment response/confirm with the c-bit set to 1, indicating the successful completion of a normal download sequence. ? an Abort SDO Transfer request/indication, indicating the unsuccessful completion of the download sequence. ? a new Initiate Domain Download request/indication, indicating the unsuccessful completion of the download sequence and the start of a new download sequence. If in the download of two consecutive segments the toggle bit does not alter, the contents of the last segment has to be ignored. If such an error is reported to the application, the application may decide to abort the download.

42

APPLICATION LAYER 9.2.2.2.2

CANopen

CiA

Initiate SDO Download Protocol

This protocol is used to implement the Initiate SDO Download service for SDOs. Initiate SDO Download
0
7..5 ccs=1 4 X 3..2 n 1 e 0 s

Client

Server
4 8
d

1
m

request

indication

confirm

0
7..5 scs=3 4..0 X

1
m

4
reserved

8

response

Figure 17: Initiate SDO Download Protocol ? ? ? ? ccs: client command specifier 1: initiate download request scs: server command specifier 3: initiate download response n: Only valid if e = 1 and s = 1, otherwise 0. If valid it indicates the number of bytes in d that do not contain data. Bytes [8-n, 7] do not contain data. e: transfer type 0: normal transfer 1: expedited transfer s: size indicator 0: data set size is not indicated 1: data set size is indicated m: multiplexor. It represents the index/sub-index of the data to be transfer by the SDO. d: data e = 0, s = 0: d is reserved for further use. e = 0, s = 1: d contains the number of bytes to be downloaded. Byte 4 contains the lsb and byte 7 contains the msb. e = 1, s = 1: d contains the data of length 4-n to be downloaded, the encoding depends on the type of the data referenced by index and sub-index e = 1, s = 0: d contains unspecified number of bytes to be downloaded X: not used, always 0 reserved: reserved for further use, always 0

? ? ?

? ?

43

APPLICATION LAYER 9.2.2.2.3

CANopen

CiA

Download SDO Segment Protocol

This protocol is used to implement the Download SDO Segment service.

Client
0
7..5 ccs=0 4 t

Download SDO Segment
1
3..1 n 0 c seg-data

Server
8

request

indication

confirm

0
7..5 scs=1 4 t 3..0 X

1
reserved

8

response

Figure 18: Download SDO Segment Protocol ? ? ? ? ? ? ccs: client command specifier 0: download segment request scs: server command specifier 1: download segment response seg-data: at most 7 bytes of segment data to be downloaded. The encoding depends on the type of the data referenced by index and sub-index n: indicates the number of bytes in seg-data that do not contain segment data. Bytes [8-n, 7] do not contain segment data. n = 0 if no segment size is indicated. c: indicates whether there are still more segments to be downloaded. 0 more segments to be downloaded 1: no more segments to be downloaded t: toggle bit. This bit must alternate for each subsequent segment that is downloaded. The first segment will have the toggle-bit set to 0. The toggle bit will be equal for the request and the response message. X: not used, always 0 reserved: reserved for further use, always 0

? ?

44

APPLICATION LAYER 9.2.2.2.4 Upload SDO Protocol

CANopen

CiA

Client

SDO Upload (normal)

Server

Client

SDO Upload (expedited)

Server

Initiate SDO Upload

(e=0)

Initiate SDO Upload

(e=1)

Upload SDO Segment (t=0, c=0)

Upload SDO Segment (t=1, c=0)

Upload SDO Segment (t=0, c=0)

Upload SDO Segment (t=?, c=1)

Figure 19: Upload SDO Protocol This protocol is used to implement the SDO Upload service. SDO are uploaded as a sequence of zero or more Upload SDO Segment services preceded by an Initiate SDO Upload service. The sequence is terminated by: an Initiate SDO Upload response/confirm with the e-bit set to 1, indicating the successful completion of an expedited upload sequence. ? an Upload SDO Segment response/confirm with the c-bit set to 1, indicating the successful completion of a normal upload sequence. ? an Abort SDO Transfer request/indication, indicating the unsuccessful completion of the upload sequence. ? a new Initiate SDO Upload request/indication, indicating the unsuccessful completion of the upload sequence and the start of a new sequence. If in the upload of two consecutive segments the toggle bit does not alter, the contents of the last segment has to be ignored. If such an error is reported to the application, the application may decide to abort the upload. ?

45

APPLICATION LAYER 9.2.2.2.5 Initiate SDO Upload Protocol

CANopen

CiA

This protocol is used to implement the Initiate SDO Upload service.

Client
0
7..5 ccs=2

Initiate SDO Upload
1
4..0 X m

Server
8
reserved

4

request

indication

confirm

0
7..5 scs=2 4 X 3..2 n 1 e 0 s

1
m

4
d

8

response

Figure 20: Initiate SDO Upload Protocol ? ? ? ? ccs: client command specifier 2: initiate upload request scs: server command specifier 2: initiate upload response n: Only valid if e = 1 and s = 1, otherwise 0. If valid it indicates the number of bytes in d that do not contain data. Bytes [8-n, 7] do not contain segment data. e: transfer type 0: normal transfer 1: expedited transfer s: size indicator 0: data set size is not indicated 1: data set size is indicated m: multiplexor. It represents the index/sub-index of the data to be transfer by the SDO. d: data e = 0, s = 0: d is reserved for further use. e = 0, s = 1: d contains the number of bytes to be uploaded. Byte 4 contains the lsb and byte 7 contains the msb. e = 1, s = 1: d contains the data of length 4-n to be uploaded, the encoding depends on the type of the data referenced by index and sub-index e = 1, s = 0: d contains unspecified number of bytes to be uploaded. X: not used, always 0 reserved: reserved for further use , always 0

?

? ?

? ?

46

APPLICATION LAYER 9.2.2.2.6

CANopen

CiA

Upload SDO Segment Protocol

This protocol is used to implement the Upload SDO Segment service. Upload SDO Segment
0
7..5 ccs=3 4 t 3..0 X

Client

Server
8

1
reserved

request

indication

confirm

0
7..5 scs=0 4 t 3..1 n 0 c

1
seg-data

8

response

Figure 21: Upload SDO Segment Protocol ? ? ? ? ccs: client command specifier 3: upload segment request scs: server command specifier 0: upload segment response t: toggle bit. This bit must alternate for each subsequent segment that is uploaded. The first segment will have the toggle-bit set to 0. The toggle bit will be equal for the request and the response message. c: indicates whether there are still more segments to be uploaded. 0: more segments to be uploaded 1: no more segments to be uploaded seg-data: at most 7 bytes of segment data to be uploaded. The encoding depends on the type of the data referenced by index and sub-index n: indicates the number of bytes in seg-data that do not contain segment data. Bytes [8-n, 7] do not contain segment data. n = 0 if no segment size is indicated. X: not used, always 0 reserved: reserved for further use, always 0

? ? ? ?

47

APPLICATION LAYER 9.2.2.2.7 Abort SDO Transfer Protocol

CANopen

CiA

This protocol is used to implement the Abort SDO Transfer Service.

Client/Server
0
7..5 cs=4

Abort SDO Transfer
1
4..0 X m

Server/Client
8
d

4

request

indication

Figure 22: Abort SDO Transfer Protocol ? ? ? ? cs: command specifier 4: abort transfer request X: not used, always 0 m: multiplexor. It represents index and sub-index of the SDO. d: contains a 4 byte abort code about the reason for the abort.

The abort code is encoded as UNSIGNED32 value. Table 20: SDO abort codes Abort code 0503 0000h 0504 0000h 0504 0001h 0504 0002h 0504 0003h 0504 0004h 0504 0005h 0601 0000h 0601 0001h 0601 0002h 0602 0000h 0604 0041h 0604 0042h 0604 0043h 0604 0047h 0606 0000h 0607 0010h 0607 0012h 0607 0013h 0609 0011h Description Toggle bit not alternated. SDO protocol timed out. Client/server command specifier not valid or unknown. Invalid block size (block mode only). Invalid sequence number (block mode only). CRC error (block mode only). Out of memory. Unsupported access to an object. Attempt to read a write only object. Attempt to write a read only object. Object does not exist in the object dictionary. Object cannot be mapped to the PDO. The number and length of the objects to be mapped would exceed PDO length. General parameter incompatibility reason. General internal incompatibility in the device. Access failed due to an hardware error. Data type does not match, length of service parameter does not match Data type does not match, length of service parameter too high Data type does not match, length of service parameter too low Sub-index does not exist. 48

APPLICATION LAYER 0609 0030h 0609 0031h 0609 0032h 0609 0036h 0800 0000h 0800 0020h 0800 0021h 0800 0022h 0800 0023h

CANopen Value range of parameter exceeded (only for write access). Value of parameter written too high. Value of parameter written too low. Maximum value is less than minimum value. general error Data cannot be transferred or stored to the application. Data cannot be transferred or stored to the application because of local control. Data cannot be transferred or stored to the application because of the present device state. Object dictionary dynamic generation fails or no object dictionary is present (e.g. object dictionary is generated from file and generation fails because of an file error).

CiA

The abort codes not listed here are reserved.

49

APPLICATION LAYER 9.2.2.2.8

CANopen

CiA

SDO Block Download Protocol

Client

SDO_Block_Download

Server

Initiate Block Download

Download Block

Download Block (normal)

Download Block (normal)

Download Block (last)

End Block Download

Download_Block (normal)

Download_Block (last)

Client

Server

Client

Server

Download segment 0 (c=0, seqno = 0) Download segment 1 (c=0, seqno = 1)

Download segment 0 (c=0, seqno = 0) Download segment 1 (c=0, seqno = 1)

Download segment n (c=0, seqno = n) Confirm block

Download segment n (c=1, seqno = n) Confirm block

Figure 23: SDO Block Download Protocol This protocol is used to implement a SDO Block Download service. SDOs are downloaded as a sequence of Download SDO Block services preceded by an Initiate SDO Block Download service. The SDO Download Block sequence is terminated by: ? a downloaded segment within a block with the c-bit set to 1, indicating the completion of the block download sequence. ? an 'Abort SDO Transfer' request/indication, indicating the unsuccessful completion of the download sequence.

The whole ‘SDO Block Download’ service is terminated with the End SDO Block Download service. If client as well as server have indicated the ability to generate a CRC during the Initiate SDO Block Download service the server has to generate the CRC on the received data. If this CRC differs from the CRC generated by the client the server has to indicate this with an ‘Abort SDO Transfer’ indication.

50

APPLICATION LAYER 9.2.2.2.9

CANopen

CiA

Initiate SDO Block Download Protocol

This protocol is used to implement the Initiate SDO Block Download service.

Client
0
7..5 ccs=6 4..3 X

Initiate Block Download
1
2 cc 1 s 0 cs=0 m

Server
4
size

8

request

indication

0 confirm
7..5 scs=5 4..3 X 2 sc 1..0 ss=0

1
m

4
blksize

5
reserved

8 response

Figure 24: Initiate SDO Block Download Protocol ? ? ? ccs: client command specifier 6: block download scs: server command specifier 5: block download s: size indicator 0: data set size is not indicated 1: data set size is indicated cs: client subcommand 0: initiate download request ss: server subcommand 0: initiate download response cc: client CRC support cc = 0: Client does not support generating CRC on data cc = 1: ? Client supports generating CRC on data sc: server CRC support sc = 0: Server does not support generating CRC on data sc = 1: ? ? Server supports generating CRC on data m: multiplexor. It represents the index/sub-index of the data to be transfer by the SDO. size: download size in bytes s = 0: size is reserved for further use, always 0 s = 1: size contains the number of bytes to be downloaded Byte 4 contains the lsb and byte 7 the msb ? ? ? blksize: Number of segments per block with 0 < blksize < 128. X: not used, always 0 reserved: reserved for further use, always 0

? ? ?

51

APPLICATION LAYER 9.2.2.2.10

CANopen

CiA

Download SDO Block Segment Protocol

This protocol is used to implement the Block Download service. Download Block Segment
0
8 c 7..1 seqno

Client

Server
8

1
seg-data

request

indication

confirm

0
7..5 scs=5 4..2 X 1..0 ss=2

1
ackseq

2
blksize

3
reserved

8

response

Figure 25: Download SDO Block Segment ? ? ? scs: server command specifier 5: block download ss: server subcommand 2: block download response c: indicates whether there are still more segments to be downloaded 0: more segments to be downloaded 1: no more segments to be downloaded, enter End SDO block download phase seqno: sequence number of segment 0 < seqno < 128. seg-data: at most 7 bytes of segment data to be downloaded. ackseq: sequence number of last segment that was received successfully during the last block download. If ackseq is set to 0 the server indicates the client that the segment with the sequence number 1 was not received correctly and all segments have to be retransmitted by the client. blksize: Number of segments per block that has to be used by client for the following block download with 0 < blksize < 128. X: not used, always 0 reserved: reserved for further use, always 0

? ? ?

? ? ?

52

APPLICATION LAYER 9.2.2.2.11

CANopen

CiA

End SDO Block Download Protocol

This protocol is used to implement the End SDO Block Download service.

Client
0
7..5 ccs=6 4..2 n 1 X

End Block Download
1
0 cs=1 crc

Server
8

3
reserved

request

indication

confirm

0
7..5 scs=5 4..2 X 1..0 ss=1

1
reserved

8

response

Figure 26: End SDO Block Download Protocol ? ? ? ? ? ? ccs: client command specifier 6: block download scs: server command specifier 5: block download cs: client subcommand 1: end block download request ss: server subcommand 1: end block download response n: indicates the number of bytes in the last segment of the last block that do not contain data. Bytes [8-n, 7] do not contain segment data. crc: 16 bit Cyclic Redundancy Checksum (CRC) for the whole data set. The algorithm for generating the CRC is described in 9.2.2.2.16. CRC is only valid if in Initiate Block Download cc and sc are set to 1 otherwise CRC has to be set to 0. X: not used, always 0 reserved: reserved for further use, always 0

? ?

53

APPLICATION LAYER 9.2.2.2.12 Upload SDO Block Protocol

CANopen

CiA

Client

SDO_Block_Upload (normal)

Server

Client SDO_Block_Upload (fallback)
Initiate Block Upload (Phase I) (pst != 0) Fallback to SDO Upload Protocol

Server

Initiate Block Upload (Phase I) Initiate Block Upload (Phase II)

Upload Block (normal)

Upload Block (normal)

Upload Block (last)

End Block Upload

Client

Upload_Block (normal) Server

Upload_Block (last) Client
Upload segment 0 (c=0, seqno = 0) Upload segment 1 (c=0, seqno = 1)

Server

Upload segment 0 (c=0, seqno = 0) Upload segment 1 (c=0, seqno = 1)

Upload segment n (c=0, seqno = n) Confirm block

Upload segment n (c=1, seqno = n) Confirm block

Figure 27: Upload SDO Block Protocol This protocol is used to implement a SDO Block Upload service which starts with the Initiate SDO Block Upload service. The client can indicate a threshold value to the server which is the minimum value in bytes to increase transfer performance using the SDO Block Upload protocol instead of the SDO Upload protocol. If the data set size is less or equal this value the server can continue with the normal or expedited transfer of the SDO Block Upload protocol. Otherwise SDOs are uploaded as a sequence of Upload SDO Block services. The SDO Upload Block sequence is terminated by: ? an uploaded segment within a block with the c-bit set to 1, indicating the completion of the block upload sequence. ? an Abort SDO Transfer request/indication, indicating the unsuccessful completion of the uploaded sequence. The whole ‘SDO Block Upload’ service is terminated with the ‘End SDO Block Upload’ service. If client as well as server have indicated the ability to generate a CRC during the Initiate SDO Block Upload service the client has to generate the CRC on the received data. If this CRC differs from the CRC generated by the server the client has to indicate this with an ‘Abort SDO Transfer’ indication.

54

APPLICATION LAYER 9.2.2.2.13

CANopen

CiA

Initiate SDO Block Upload Protocol

This protocol is used to implement the Initiate SDO Block Upload service. If the value of the Protocol Switch Threshold parameter indicated by the client in the first request is less or equal the data set size to be uploaded the server can continue with the SDO Upload Protocol as described in 9.2.2.2.4. Initiate Block Upload
0
7..5 ccs=5 4..2 X 2 cc 1..0 cs=0

Client

Server
4 5
blksize pst

1
m

6
X

8

request

indication

0 confirm
7..5 scs=6 4..3 X 2 sc 1 s

1
0 ss=0 m

4
size

8 response

0
7..5 ccs=5 4..2 X 1..0 cs=3

1
reserved

8

request

indication

Figure 28: Initiate SDO Block Upload Protocol ? ? ? ccs: client command specifier 5: block upload scs: server command specifier 6: block upload cs: client subcommand 0: initiate upload request 3: start upload ss: server subcommand 0: initiate upload response m: multiplexor. It represents the index/sub-index of the data to be transfer by the SDO. cc: client CRC support cc = 0: Client does not support generating CRC on data cc = 1: ? Client supports generating CRC on data sc: server CRC support sc = 0: Server does not support generating CRC on data sc = 1: ? Server supports generating CRC on data pst: Protocol Switch Threshold in bytes to change the SDO transfer protocol pst = 0: Change of transfer protocol not allowed. pst > 0: If the size of the data in bytes that has to be uploaded is less or equal pst the server can optionally switch to the ‘SDO Upload Protocol’ by transmitting the server response of the ‘SDO Upload Protocol’ as described in 9.2.2.2.4. s: size indicator 0: data set size is not indicated 1: data set size is indicated size: upload size in bytes s = 0: size is reserved for further use, always 0 s = 1: size contains the number of bytes to be downloaded Byte 4 contains the lsb and byte 7 the msb blksize: Number of segments per block with 0 < blksize < 128. X: not used, always 0 reserved: reserved for further use, always 0 55

? ? ?

? ?

? ? ?

APPLICATION LAYER 9.2.2.2.14

CANopen

CiA

Upload SDO Block Segment Protocol Figure 29: Upload SDO Block Segment Protocol

This protocol is used to implement the SDO Block Upload service.

Client
0
8 c 7..1 seqno

Upload Block
1
seg-data

Server
8

indication

request

response

0
7..5 ccs=5 4..2 X 1..0 cs=2

1
ackseq

2
blksize

3
reserved

8

confirm

? ? ?

ccs: client command specifier 5: block upload cs: client subcommand 2: block upload response c: indicates whether there are still more segments to be downloaded 0: more segments to be uploaded 1: no more segments to be uploaded, enter ‘End block upload’ phase seqno: sequence number of segment 0 < seqno < 128. seg-data: at most 7 bytes of segment data to be uploaded. ackseq: sequence number of last segment that was received successfully during the last block upload. If ackseq is set to 0 the client indicates the server that the segment with the sequence number 1 was not received correctly and all segments have to be retransmitted by the server. blksize: Number of segments per block that has to be used by server for the following block upload with 0 < blksize < 128. X: not used, always 0 reserved: reserved for further use, always 0

? ? ?

? ? ?

56

APPLICATION LAYER 9.2.2.2.15

CANopen

CiA

End SDO Block Upload Protocol

This protocol is used to implement the End SDO Block Upload service.

Client
0
7..5 scs=6 4..2 n

End SDO Block Upload

Server
3 8
reserved

1
1..0 ss=1 crc

indication 1
7..5 ccs=5 4..2 X 1 X 0 cs=1 reserved

request

response

0

8

confirm

Figure 30: End SDO Block Upload Protocol ? ? ? ? ? ? ccs: client command specifier 5: block upload scs: server command specifier 6: block upload cs: client subcommand 1: end block upload request ss: server subcommand 1: end block upload response n: indicates the number of bytes in the last segment of the last block that do not contain data. Bytes [8-n, 7] do not contain segment data. crc: 16 bit Cyclic Redundancy Checksum (CRC) for the whole data set. The algorithm for generating the CRC is described in 9.2.2.2.16. CRC is only valid if in Initiate Block Upload cc and sc are set to 1 otherwise crc has to be set to 0. X: not used, always 0 reserved: reserved for further use, always 0 CRC calculation algorithm to verify SDO Block Transfer

? ?

9.2.2.2.16

To verify the correctness of a SDO block upload/download client and server calculating a cyclic redundancy checksum (CRC) which is exchanged and verified during End SDO Block Download/Upload protocol. The check polynomial has the formula x^16 + x^12 + x^5 + 1. The calculation has to be made with an initial value of 0.

57

APPLICATION LAYER 9.2.3 Synchronisation Object (SYNC)

CANopen

CiA

The Synchronisation Object is broadcasted periodically by the SYNC producer. This SYNC provides the basic network clock. The time period between the SYNCs is specified by the standard parameter communication cycle period (see Object 1006h: Communication Cycle Period), which may be written by a configuration tool to the application devices during the boot-up process. There can be a time jitter in transmission by the SYNC producer corresponding approximately to the latency due to some other message being transmitted just before the SYNC. In order to guarantee timely access to the CAN bus the SYNC is given a very high priority identifier (1005h). Devices which operate synchronously may use the SYNC object to synchronise their own timing with that of the Synchronisation Object producer. The details of this synchronisation are device dependent and do not fall within the scope of this document. Devices which require a more accurate common time base may use the high resolution synchronisation mechanism described in 9.3.2. 9.2.3.1 SYNC Services The SYNC transmission follows the producer/consumer push model as described in 6.3.3. The service is unconfirmed. Attributes: - user type: one of the values {consumer, producer} - data type: nil 9.2.3.2 SYNC Protocol One unconfirmed service (Write SYNC) is defined. Write SYNC

SYNC Producer

Write SYNC

SYNC consumer(s)
Indication

request

Indication L=0 Indication

Figure 31: SYNC Protocol ? The SYNC does not carry any data (L=0). The Identifier of the SYNC object is located at Object Index 1005h.

58

APPLICATION LAYER 9.2.4 Time Stamp Object (TIME)

CANopen

CiA

By means of the Time Stamp Object a common time frame reference is provided to devices. It contains a value of the type TIME_OF_DAY. The Identifier of the TIME Object is located at Object Index 1012h. 9.2.4.1 TIME Services The Time Stamp Object transmission follows the producer/consumer push model as described in 6.3.3. The service is unconfirmed. Attributes: - user type: one of the values {consumer, producer} - data type: TIME_OF_DAY 9.2.4.2 TIME Protocol

One unconfirmed service (Write TIME) is defined. Write TIME

TIME Producer
0 request

Write TIME
L=6

TIME Consumer
Indication Indication Indication

Time Stamp

Figure 32: TIME Protocol Time Stamp: 6 bytes of the Time Stamp Object

?

59

APPLICATION LAYER 9.2.5 9.2.5.1 Emergency Object (EMCY) Emergency Object Usage

CANopen

CiA

Emergency objects are triggered by the occurrence of a device internal error situation and are transmitted from an emergency producer on the device. Emergency objects are suitable for interrupt type error alerts. An emergency object is transmitted only once per 'error event'. As long as no new errors occur on a device no further emergency objects must be transmitted. The emergency object may be received by zero or more emergency consumers. The reaction on the emergency consumer(s) is not specified and does not fall in the scope of this document. By means of this specification emergency error codes (Table 21) and the error register ( Table 48) are specified. Device specific additional information and the emergency condition do not fall into the scope of this specification. Table 21: Emergency Error Codes Error Code (hex) 00xx 10xx 20xx 21xx 22xx 23xx 30xx 31xx 32xx 33xx 40xx 41xx 42xx 50xx 60xx 61xx 62xx 63xx 70xx 80xx 81xx 8110 8120 8130 8140 8150 82xx 8210 8220 90xx F0xx FFxx Meaning Error Reset or No Error Generic Error Current Current, device input side Current inside the device Current, device output side Voltage Mains Voltage Voltage inside the device Output Voltage Temperature Ambient Temperature Device Temperature Device Hardware Device Software Internal Software User Software Data Set Additional Modules Monitoring Communication CAN Overrun (Objects lost) CAN in Error Passive Mode Life Guard Error or Heartbeat Error recovered from bus off Transmit COB-ID collision Protocol Error PDO not processed due to length error PDO length exceeded External Error Additional Functions Device specific 60

APPLICATION LAYER

CANopen

CiA

The emergency object is optional. If a device supports the emergency object, it has to support at least the two error codes 00xx and 10xx. All other error codes are optional. A device may be in one of two emergency states (Figure 33). Dependent on the transitions emergency objects will be transmitted. Links between the error state machine and the NMT state machine are defined in the device profiles. 0. After initialization the device enters the error free state if no error is detected. No error message is sent. 1. The device detects an internal error indicated in the first three bytes of the emergency message (error code and error register). The device enters the error state. An emergency object with the appropriate error code and error register is transmitted. The error code is filled in at the location of object 1003H (pre-defined error field). 2. One, but not all error reasons are gone. An emergency message containing error code 0000 (Error reset) may be transmitted together with the remaining errors in the error register and in the manufacturer specific error field. 3. A new error occurs on the device. The device remains in error state and transmits an emergency object with the appropriate error code. The new error code is filled in at the top of the array of error codes (1003H). It has to be guaranteed that the error codes are sorted in a timely manner (oldest error - highest sub-index, see Object 1003H). 4. All errors are repaired. The device enters the error free state and transmits an emergency object with the error code ‘reset error / no error'.

0

error free 4

1

2 error occurred Figure 33: Emergency State Transition Diagram 9.2.5.2 Emergency Object Data The Emergency Telegram consists of 8 bytes with the data as shown in Figure 34: Emergency Object Data. Byte Content 0 1 2 Error register (Object 1001H) 3 4 5 6 7 3

Emergency Error Code (see Table 21)

Manufacturer specific Error Field

Figure 34: Emergency Object Data

61

APPLICATION LAYER 9.2.5.3 Emergency Object Services

CANopen

CiA

Emergency object transmission follows the “producer – consumer” push model as described in 6.3.3. The following object attributes are specified for emergency objects: ? user type: notifying device: producer receiving devices: consumer ? data type: STRUCTURE OF UNSIGNED(16) emergency_error_code, UNSIGNED(8) error_register, ARRAY (5) of UNSIGNED(8) manufacturer_specific_error_field ? inhibit time: 9.2.5.4 Application specific Emergency Object Protocol

One unconfirmed service (Write EMCY) is defined. Write EMCY

EMCY Producer

Write EMCY
0 8

EMCY Consumer
Indication Indication Indication

Request

Emergency Object Data

Figure 35: Emergency Object Protocol Is is not allowed to request an Emergency Object by a remote transmission request (RTR).

62

APPLICATION LAYER 9.2.6 Network Management Objects

CANopen

CiA

The Network Management (NMT) is node oriented and follows a master-slave structure. NMT objects are used for executing NMT services. Through NMT services, nodes are initialised, started, monitored, resetted or stopped. All nodes are regarded as NMT slaves. An NMT Slave is uniquely identified in the network by its Node-ID, a value in the range of [1..127]. NMT requires that one device in the network fulfils the function of the NMT Master. 9.2.6.1 9.2.6.1.1 NMT Services Module Control Services

Through Module Control Services, the NMT master controls the state of the NMT slaves. The state attribute is one of the values {STOPPED, PRE-OPERATIONAL, OPERATIONAL, INITIALISING}. The Module Control Services can be performed with a certain node or with all nodes simultaneously. The NMT master controls its own NMT state machine via local services, which are implementation dependent. The Module Control Services except Start Remote Node can be initiated by the local application. Start Remote Node Through this service the NMT Master sets the state of the selected NMT Slaves to OPERATIONAL. Table 22: Start Remote Node Parameter Argument Node-ID All Indication/Request Mandatory selection selection

The service is unconfirmed and mandatory. After completion of the service, the state of the selected remote nodes will be OPERATIONAL. Stop Remote Node Through this service the NMT Master sets the state of the selected NMT Slaves to STOPPED. Table 23: Stop Remote Node Parameter Argument Node-ID All Request/Indication Mandatory selection selection

The service is unconfirmed and mandatory. After completion of the service, the state of the selected remote nodes will be STOPPED. Enter Pre-Operational Through this service the NMT Master sets the state of the selected NMT Slave(s) to "PREOPERATIONAL". Table 24: Enter Pre-Operational Parameter Argument Node-ID All Request/Indication Mandatory selection selection

The service is unconfirmed and mandatory for all devices. After completion of the service, the state of the selected remote nodes will be PRE-OPERATIONAL.

63

APPLICATION LAYER Reset Node

CANopen

CiA

Through this service the NMT Master sets the state of the selected NMT Slave(s) from any state to the "reset application" sub-state. Table 25: Reset Node Parameter Argument Node-ID All Request/Indication Mandatory selection selection

The service is unconfirmed and mandatory for all devices. After completion of the service, the state of the selected remote nodes will be RESET APPLICATION. Reset Communication Through this service the NMT Master sets the state of the selected NMT Slave(s) from any state to the "reset communication" sub-state. After completion of the service, the state of the selected remote nodes will be RESET COMMUNICATION. Table 26: Reset Communication Parameter Argument Node-ID All Request/Indication Mandatory selection selection

The service is unconfirmed and mandatory for all devices. 9.2.6.1.2 Error Control Services Through Error control services the NMT detects failures in a CAN-based Network. Local errors in a node may e.g. lead to a reset or change of state. The definition of these local errors does not fall into the scope of this specification. Error Control services are achieved principally through periodically transmitting of messages by a device. There exist two possibilities to perform Error Control. The guarding is achieved through transmitting guarding requests (Node guarding protocol) by the NMT Master. If a NMT Slave has not responded within a defined span of time (node life time) or if the NMT Slave’s communication status has changed, the NMT Master informs its NMT Master Application about that event. If Life guarding (NMT slave guarded NMT master) is supported, the slave uses the guard time and lifetime factor from its Object Dictionary to determine the node life time. If the NMT Slave is not guarded within its life time, the NMT Slave informs its local Application about that event. If guard time and life time factor are 0 (default values), the NMT Slave does not guard the NMT Master. Guarding starts for the slave when the first remote-transmit-request for its guarding identifier is received. This may be during the boot-up phase or later. The heartbeat mechanism for a device is established through cyclically transmitting a message by a heartbeat producer. One or more devices in the network are aware of this heartbeat message. If the heartbeat cycle fails for the heartbeat producer the local application on the heartbeat consumer will be informed about that event. The implementation of either guarding or heartbeat is mandatory. Node Guarding Event Through this service, the NMT service provider on the NMT Master indicates that a remote error occurred or has been resolved for the remote node identified by Node-ID.

64

APPLICATION LAYER

CANopen Table 27: Node Guarding Event

CiA

Parameter Argument Node-ID State Occurred Resolved The service is provider initiated and optional. Life Guarding Event

Indication Mandatory mandatory mandatory selection selection

Through this service, the NMT service provider on an NMT Slave indicates that a remote error occurred or has been resolved. Table 28: Life Guarding Event Parameter Argument State Occurred Resolved The service is provider initiated and optional. Heartbeat Event Through this service, the Heartbeat consumer indicates that a heartbeat error occurred or has been resolved for the node identified by Node-ID. Table 29: Heartbeat Event Parameter Argument Node-ID State Occurred Resolved The service is consumer initiated and optional. 9.2.6.1.3 Bootup Event Through this service, the NMT slave indicates that a local state transition occurred from the state INITIALISING to the state PRE-OPERATIONAL. Table 30: Bootup Event Parameter Argument None Indication Mandatory Bootup Service Indication Mandatory mandatory mandatory selection selection Indication Mandatory mandatory selection selection

The service is provider initiated and mandatory.

65

APPLICATION LAYER 9.2.6.2 9.2.6.2.1 NMT Protocols Module Control Protocols

CANopen

CiA

Start Remote Node Protocol

NMT Master Request request

Start Remote Node 0 CS=1 1 2 Node-ID

NMT Slave(s) Indication(s) indication indication indication

COB-ID = 0

This protocol is used to implement the 'Start Remote Node' service. Figure 36: Start Remote Node Protocol ? cs: NMT command specifier 1: start

Stop Remote Node Protocol This protocol is used to implement the 'Stop Remote Node' service. NMT Master Request request Stop Remote Node 0 CS=2 1 2 Node-ID NMT Slave(s) Indication(s) indication indication indication

COB-ID = 0

Figure 37: Stop Remote Node Protocol ? cs: NMT command specifier 2: stop

66

APPLICATION LAYER Enter Pre-Operational Protocol

CANopen

CiA

The protocol is used to implement the 'Enter_Pre-Operational' service. NMT Master Request request Enter Pre-Operational 0 1 2 CS=128 Node-ID COB-ID = 0 NMT Slave(s) Indication(s) indication indication indication

Figure 38: Enter Pre-Operational Protocol ? cs: NMT command specifier 128: enter PRE-OPERATIONAL Reset Node Protocol

NMT Master Request request

Reset Node 0 1 COB-ID = 0 2 CS=129 Node-ID

NMT Slave(s) Indication(s) indication indication indication

The protocol is used to implement the 'Reset Node' service. Figure 39: Reset Node Protocol cs: NMT command specifier 129: Reset_Node

67

APPLICATION LAYER Reset Communication Protocol

CANopen

CiA

NMT Master Request request

Reset Communication 0 1 2 CS=130 Node-ID COB-ID = 0

NMT Slave(s) Indication(s) indication indication indication

The protocol is used to implement the 'Reset Communication' service. Figure 40: Reset Communication Protocol cs: NMT command specifier 130: Reset_Communication

68

APPLICATION LAYER 9.2.6.2.2 Error Control Protocols

CANopen

CiA

Node Guarding Protocol This protocol is used to detect remote errors in the network. Each NMT Slave uses one remote COB for the Node Guarding Protocol. This protocol implements the provider initiated Error Control services. Node/Life Guarding NMT Master request 0 confirm Node Guard time Reque st Node Life Time request 0 confirm 7 t 6...0 s 1 response COB-ID = 1792 + Node-ID
Remote transmit request

COB-ID = 1792 + Node-ID
Remote transmit request

NMT Slave indication

1 7 t 6...0 s response

indication

Node Guarding Event* indication
*if guarding error

Life Guarding Event* indication

Figure 41: Node Guarding Protocol s: the state of the NMT Slave 4: STOPPED 5: OPERATIONAL 127: PRE-OPERATIONAL t: toggle bit. The value of this bit must alternate between two consecutive responses from the NMT Slave. The value of the toggle-bit of the first response after the Guarding Protocol becomes active, is 0. The Toggle Bit in the guarding protocol is only resetted to 0 when reset_communication is passed (no other change of state resets the toggle bit). If a response is received with the same value of the toggle-bit as in the preceding response then the new response is handled as if it was not received. The NMT Master polls each NMT Slave at regular time intervals. This time-interval is called the guard time and may be different for each NMT Slave. The response of the NMT Slave contains the state of that NMT Slave. The node life time is given by the guard time multiplied by the life time factor. The node life time can be different for each NMT Slave. If the NMT Slave has not been polled during its life time, a remote node error is indicated through the 'Life Guarding Event' service. A remote node error is indicated through the 'Node guarding event' service if ? The remote transmit request is not confirmed within the node life time ? The reported NMT slave state does not match the expected state If it has been indicated that a remote error has occurred and the errors in the guarding protocol have disappeared, it will be indicated that the remote error has been resolved through the 'Node Guarding Event' and 'Life Guarding Event' services. 69

APPLICATION LAYER

CANopen

CiA

For the guard time, and the life time factor there are default values specified at the appropriate Object Dictionary entries. Heartbeat Protocol The Heartbeat Protocol defines an Error Control Service without need for remote frames. A Heartbeat Producer transmits a Heartbeat message cyclically. One or more Heartbeat Consumer receive the indication. The relationship between producer and consumer is configurable via the object dictionary. The Heartbeat Consumer guards the reception of the Heartbeat within the Heartbeat Consumer Time. If the Heartbeat is not received within the Heartbeat Consumer Time a Heartbeat Event will be generated. Write Heartbeat COB-ID = 1792 + Node-ID Heartbeat Producer request Request Heartbeat Producer Time 0 request 7 r 6 .. 0 s 1 0 7 r 6 .. 0 s 1 Heartbeat Consumer indication Indication(s) indication indication Heartbeat Consumer Time indication indication indication

Heartbeat Consumer Time

Heartbeat Event Figure 42: Heartbeat Protocol r: reserved (always 0) s: the state of the Heartbeat producer 0: BOOTUP 4: STOPPED 5: OPERATIONAL 127: PRE-OPERATIONAL If the Heartbeat Producer Time is configured on a device the Heartbeat Protocol begins immediately. If a device starts with a value for the Heartbeat Producer Time unequal to 0 the Heartbeat Protocol starts on the state transition from INITIALISING to PRE-OPERATIONAL. In this case the Bootup Message is regarded as first heartbeat message. It is not allowed for one device to use both error control mechanisms Guarding Protocol and Heartbeat Protocol at the same time. If the heartbeat producer time is unequal 0 the heartbeat protocol is used.

70

APPLICATION LAYER 9.2.6.2.3 Bootup Protocol

CANopen

CiA

This protocol is used to signal that a NMT slave has entered the node state PRE-OPERATIONAL after the state INITIALISING. The protocol uses the same identifier as the error control protocols. Bootup Event

NMT Master

COB-ID = 1792 + Node-ID 0 1 0

NMT Slave

indication Heartbeat Consumer(s) indication(s)

request

Figure 43: Bootup Protocol One data byte is transmitted with value 0. 9.3 9.3.1 Synchronisation of the SYNC Consumer Transmission of Synchronous PDO Messages

Synchronous transmission of a message means that the transmission of the message is fixed in time with respect to the transmission of the SYNC message. The synchronous message is transmitted within a given time window with respect to the SYNC transmission, and at most once for every period of the SYNC. In general the fixing of the transmission time of synchronous PDO messages coupled with the periodicity of transmission of the SYNC message guarantees that devices may arrange to sample process variables from a process environment and apply their actuation in a co-ordinated fashion. A device consuming SYNC messages will provide synchronous PDO messages too. The reception of a SYNC message controls the moment when the application will interact with the process environment according to the contents of a synchronous PDO. The synchronous mechanism is intended for transferring commanded values and actual values on a fixed timely base. In general a synchronous PDO with a commanded value will be received before a SYNC. The SYNC consuming device will actuate based on this synchronous PDO at the next SYNC message. The reception of a SYNC will also prompt a device operating in the cyclic mode to sample its feedback data and transmit a synchronous PDO with an actual value as soon as possible afterwards. Depending upon its capabilities, a device may also be parameterised with the time period synchronous window length after the SYNC at which it is guaranteed that its commanded value has arrived. It may therefore perform any processing on the commanded value which is required in order to actuate at the next SYNC message.

71

APPLICATION LAYER

CANopen

CiA

communication cycle period Synchronous window length SYNC Message SYNC Message

objects mapped in Actuate on synchronous RPDO objects mapped in last received synchronous RPDO

objects mapped in Actuate on synchronous RPDO objects mapped in last received synchronous RPDO

Actuation based on objects mapped in last received synchronous RPDO at next SYNC

Figure 44: Bus Synchronisation and Actuation
communication cycle period synchronous window length SYNC Message object mapped in synchronous TPDO SYNC Message object mapped in synchronous TPDO

Samples immediately taken at SYNC for objects mapped in synchronous TPDO

Figure 45: Bus Synchronisation and Sampling 9.3.2 Optional High Resolution Synchronisation Protocol

The synchronisation message carries no data and is easy to generate. However, the jitter of this SYNC depends on the bit rate of the bus as even the very high priority SYNC has to wait for the current message on the bus to be transmitted before it gains bus access. Some time critical applications especially in large networks with reduced transmission rates require more accurate synchronisation; it may be necessary to synchronise the local clocks with an accuracy in the order of microseconds. This is achieved by using the optional high resolution synchronisation protocol which employs a special form of time stamp message (see Figure 46) to adjust the inevitable drift of the local clocks. The SYNC producer time-stamps the interrupt generated at t1 by the successful transmission of the SYNC message (this takes until t2). After that (at t4) he sends a time-stamp message containing the corrected time-stamp (t1) for the SYNC transmission success indication. The SYNC consumer that have taken local time-stamps (t3) on the reception (t1) of the SYNC can now compare their corrected time-stamp (t1) with the one received in the time-stamp message from the SYNC producer. The difference between these values determines the amount of time to adjust the local clock. With this protocol only the local latencies (t2-t1 on the SYNC producer and t3-t1 on the SYNC consumer ) are time critical. These latencies depend on local parameters (like interrupt processing times and hardware delays) on the nodes which have to be determined once. The accuracy of this determination 72

APPLICATION LAYER

CANopen

CiA

is implementation specific, it forms the limiting factor of the synchronisation (or clock adjustment) accuracy. Note that each node only has to know its own latency time as the time-stamp message contains the corrected value t1 and not t2. The time-stamp is encoded as UNSIGNED32 with a resolution of 1 microsecond which means that the time counter restarts every 72 minutes. It is configured by mapping the high resolution time-stamp into a PDO. It is reasonable to repeat the clock adjustment only when the maximum drift of the local clock exceeds the synchronisation accuracy. For most implementations this means that it is sufficient to add this time-stamp message to the standard SYNC once every second. This principle enables the best accuracy that can be achieved with bus-based synchronisation, especially when implemented on CAN controllers that support time-stamping. Note that the accuracy is widely independent of the transmission rate. Further improvement requires separate hardware (e.g. wiring).

SYNC master slave time t1 t2 t3 t4

TIMESTAMP

t5

Figure 46: Optional High Resolution Synchronisation Protocol

73

APPLICATION LAYER 9.4 9.4.1

CANopen

CiA

Network Initialisation and System Boot-Up Initialisation Procedure

In Figure 47 the general flow chart of the network initialisation process, controlled by a NMT Master Application or Configuration Application is shown. Configuration of all device parameters, including communication parameters (via Default SDO)

A

(Optional) start transmission of SYNC, wait for synchronisation of all devices

B

(Optional) Start of Node Guarding

C

Setting of all nodes to the operational state

D

Figure 47: Flow Chart of the Network Initialisation Process In step A the devices are in the node state PRE-OPERATIONAL which is entered automatically after power-on. In this state the devices are accessible via their Default-SDO using identifiers that have been assigned according to the Predefined Connection Set. In this step the configuration of device parameters takes place on all nodes which support parameter configuration. This is done from a Configuration Application or Tool which resides on the node that is the client for the default SDOs. For devices that support these features the selection and/or configuration of PDOs, the mapping of application objects (PDO mapping), the configuration of additional SDOs and optionally the setting of COB-IDs may be performed via the Default-SDO objects. In many cases a configuration is not even necessary as default values are defined for all application and communication parameters. If the application requires the synchronisation of all or some nodes in the network, the appropriate mechanisms can be initiated in the optional Step B. It can be used to ensure that all nodes are synchronised by the SYNC object before entering the node state OPERATIONAL in step D. The first transmission of SYNC object starts within 1 sync cycle after entering the PRE-OPERATIONAL state. In Step C Node guarding can be activated (if supported) using the guarding parameters configured in step A. With step D all nodes are enabled to communicate via their PDO objects. 9.4.2 9.4.2.1 NMT State Machine Overview

In Figure 48 the state diagram of a device is shown. Devices enter the PRE-OPERATIONAL state directly after finishing the device initialisation. During this state device parameterisation and IDallocation via SDO (e.g. using a configuration tool) is possible. Then the nodes can be switched directly into the OPERATIONAL state. The NMT state machine determines the behaviour of the Communication function unit (see 6.2). The coupling of the application state machine to the NMT state machine is device dependent and falls into the scope of device profiles.

74

APPLICATION LAYER

CANopen

CiA

Minimal Boot-Up consists of one CAN telegram: a broadcast Start_Remote_Node message. Figure 48: State Diagram of a Device Power on or Hardware Reset (1) Initialisation (2) (14) Pre-Operational (7) (13) (3) (12) Operational Table 31: Trigger for State Transition (1) (2) (3),(6) (4),(7) (5),(8) (9),(10),(11) At Power on the initialisation state is entered autonomously Initialisation finished - enter PRE-OPERATIONAL automatically Start_Remote_Node indication Enter_PRE-OPERATIONAL_State indication Stop_Remote_Node indication Reset_Node indication (4) (5) (6) (8) Stopped (9) (10) (11)

(12),(13),(14) Reset_Communication indication

75

APPLICATION LAYER 9.4.2.2 9.4.2.2.1 States Initialisation

CANopen

CiA

The ?initialisation“ state is divided into three sub-states (see Figure 49) in order to enable a complete or partial reset of a node. 1. Initialising: This is the first sub-state the device enters after power-on or hardware reset. After finishing the basic node initialisation the device enters autonomously into the state Reset_Application. 2. Reset_Application: In this state the parameters of the manufacturer specific profile area and of the standardised device profile area are set to their power-on values. After setting of the power-on values the state Reset_Communication is entered autonomously. 3. Reset_Communication: In this state the parameters of the communication profile area are set to their power-on values. After this the state Initialisation is finished and the device executes the write boot-up object service and enters the state PRE-OPERATIONAL. Power-on values are the last stored parameters. If storing is not supported or has not been executed or if the reset was preceded by a restore_default command (object 1011H), the power-on values are the default values according to the communication and device profile specifications.

(1)

Initialising Initialisation (15) Reset Application (16) Reset Communication

(11) (2) (14) (13) (12) (1) (2) (12),(13),(14) (9),(10), (11) (15) (16) At Power on the initialisation state is entered autonomously Initialisation finished - enter PRE-OPERATIONAL automatically Reset_Communication indication Reset_Node indication Initialising finished – Reset_Application state is entered autonomously Reset_Application is finished – Reset_Communication is entered autonomously Figure 49: Structure of the Initialisation state (10) (9)

76

APPLICATION LAYER 9.4.2.2.2 Pre-Operational

CANopen

CiA

In the PRE-OPERATIONAL state, communication via SDOs is possible. PDOs do not exist, so PDO communication is not allowed. Configuration of PDOs, device parameters and also the allocation of application objects (PDO-mapping) may be performed by a configuration application. The node may be switched into the operational state directly by sending a Start_Remote_Node request. 9.4.2.2.3 Operational In the OPERATIONAL state all communication objects are active. Transitioning to OPERATIONAL creates all PDOs; the constructor uses the parameters as described in the Object Dictionary. Object Dictionary Access via SDO is possible. Implementation aspects or the application state machine however may require to limit the access to certain objects whilst being operational, e.g. an object may contain the application program which cannot be changed during execution. 9.4.2.2.4 Stopped By switching a device into the Stopped state it is forced to stop the communication altogether (except node guarding and heartbeat, if active). Furthermore, this state can be used to achieve certain application behaviour. The definition of this behaviour falls into the scope of device profiles. 9.4.2.3 States and Communication Object Relation Table 32 shows the relation between communication states and communication objects. Services on the listed communication objects may only be executed if the devices involved in the communication are in the appropriate communication states. Table 32: States and Communication Objects INITIALISING PDO SDO Synchronisation Object Time Stamp Object Emergency Object Boot-Up Object Network Management Objects 9.4.2.4 State Transitions PRE-OPERATIONAL OPERATIONAL STOPPED

X X X X X X X X X X X X X

State transitions are caused by ? reception of an NMT object used for module control services ? hardware reset ? Module Control Services locally initiated by application events, defined by device profiles 9.4.3 Pre-Defined Connection Set

In order to reduce configuration effort for simple networks a mandatory default identifier allocation scheme is defined. These identifiers are available in the PRE-OPERATIONAL state directly after initialisation (if no modifications have been stored). The objects SYNC, TIME STAMP, EMERGENCY and PDOs may be deleted and re-created with new identifiers by means of dynamic distribution. A device has to provide the corresponding identifiers only for the supported communication objects. The default profile ID-allocation scheme (Table 33 and Table 34) consists of a functional part, which determines the object priority and a Node-ID-part, which allows to distinguish between devices of the same functionality. This allows a peer-to-peer communication between a single master device and up

77

APPLICATION LAYER

CANopen

CiA

to 127 slave devices. It also supports the broadcasting of non-confirmed NMT-objects, SYNC- and TIME-STAMP-objects. Broadcasting is indicated by a Node-ID of zero. The pre-defined connection set supports one emergency object, one SDO, at maximum 4 ReceivePDOs (RPDO) and 4 Transmit-PDOs (TPDO) and the NMT objects. Bit-No.: COB-Identifier 10 0

Function Code

Node-ID

Figure 50: Identifier allocation scheme for the pre-defined connection set Table 33 and Table 34 show the supported objects and their allocated COB-IDs. Table 33: Broadcast Objects of the Pre-defined Connection Set object NMT SYNC TIME STAMP function code (binary) 0000 0001 0010 resulting COB-ID 0 128 (80h) 256 (100h) Communication Parameters at Index 1005h, 1006h, 1007h 1012h, 1013h

Table 34: Peer-to-Peer Objects of the Pre-defined Connection Set object EMERGENCY PDO1 (tx) PDO1 (rx) PDO2 (tx) PDO2 (rx) PDO3 (tx) PDO3 (rx) PDO4 (tx) PDO4 (rx) SDO (tx) SDO (rx) NMT Error Control function code (binary) 0001 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1110 Resulting COB-IDs
129 (81h) – 255 (FFh) 385 (181h) – 511 (1FFh) 513 (201h) – 639 (27Fh) 641 (281h) – 767 (2FFh) 769 (301h) – 895 (37Fh) 897 (381h) – 1023 (3FFh) 1025 (401h) – 1151 (47Fh) 1153 (481h) – 1279 (4FFh) 1281 (501h) – 1407 (57Fh) 1409 (581h) – 1535 (5FFh) 1537 (601h) – 1663 (67Fh) 1793 (701h) – 1919 (77Fh)

Communication Parameters at Index 1014h, 1015h 1800h 1400h 1801h 1401h 1802h 1402h 1803h 1403h 1200h 1200h 1016h, 1017h

Table 34 has to be seen from the devices point of view. The pre-defined connection set always applies to the standard CAN frame with 11-bit Identifier, even if extended CAN frames are present in the network. Restricted COB-Ids Any COB-ID listed in Table 35 is of restricted use. Such an restricted COB-ID have not to be used as COB-ID by any configurable communication object, neither for SYNC, TIME-STAMP, EMCY, PDO, and SDO. Table 35: Restricted COB-IDs COB-ID 0 (000h) 1 (001h) 257 (101h) – 384 (180h) 1409 (581h) – 1535 (5FFh) 1537 (601h) – 1663 (67Fh) 1760 (6E0h) 1793 (701h) – 1919 (77Fh) 2020 (780h) – 2047 (7FFh) used by object NMT reserved reserved default SDO (tx) default SDO (rx) reserved NMT Error Control reserved

78

APPLICATION LAYER 9.5 9.5.1 Object Dictionary

CANopen

CiA

General Structure of the Object Dictionary

This section details the Object Dictionary structure and entries which are common to all devices. The format of the Object Dictionary entries is shown in Table 36 below: Table 36: Format of Object Dictionary Headings Index (hex) Object (Symbolic Name) Name Type Attrib. M/O

The complete Object Dictionary consists of the six columns shown above. The Index column denotes the objects position within the Object Dictionary. This acts as a kind of address to reference the desired data field. The sub-index is not specified here. The sub-index is used to reference data fields within a complex object such as an array or record. The Object column contains the Object Name according to Table 37 below and is used to denote what kind of object is at that particular index within the Object Dictionary. The following definitions are used: Table 37: Object Dictionary Object Definitions Object Name NULL DOMAIN DEFTYPE Comments A dictionary entry with no data fields Large variable amount of data e.g. executable program code Denotes a type definition such as a Boolean, UNSIGNED16, float and so on Defines a new record type e.g. the PDOMapping structure at 21h A single value such as an UNSIGNED8, Boolean, float, Integer16, visible string etc. A multiple data field object where each data field is a simple variable of the SAME basic data type e.g. array of UNSIGNED16 etc. Sub-index 0 is of UNSIGNED8 and therefore not part of the ARRAY data A multiple data field object where the data fields may be any combination of simple variables. Sub-index 0 is of UNSIGNED8 and therefore not part of the RECORD data Object Code 0 2 5

DEFSTRUCT VAR

6 7

ARRAY

8

RECORD

9

The name column provides a simple textual description of the function of that particular object. The type column gives information as to the type of the object. These include the following pre-defined types: BOOLEAN, floating point number, UNSIGNED Integer, Signed Integer, visible/octet string, timeof-day, time-difference and DOMAIN (see 9.1). It also includes the pre-defined complex data type PDOMapping and may also include others which are either manufacturer or device specific. It is not possible to define records of records, arrays of records or records with arrays as fields of that record. In the case where an object is an array or a record the sub-index is used to reference one data field within the object. The Attribute column defines the access rights for a particular object. The view point is from the bus into the device.

79

APPLICATION LAYER It can be of the following:

CANopen

CiA

Table 38: Access Attributes for Data Objects Attribute rw wo ro Const Description read and write access write only access read only access read only access, value is constant

Optional objects listed in the Object Dictionary with the Attribute rw may be implemented as read only. Exceptions are defined in the detailed object specification. The M/O column defines whether the object is Mandatory or Optional. A mandatory object must be implemented on a device. An optional object needs not to be implemented on a device. The support of certain objects or features however may require the implementation of related objects. In this case, the relations are described in the detailed object specification. 9.5.2 Dictionary Components

The overall layout of the Object Dictionary is shown in Table 39. Index 01h - 1Fh contain the standard data types, index 20h - 23h contain predefined complex data types. The range of indices from 24h - 3Fh is not defined yet but reserved for future standard data structures. The range of indices from 40h - 5Fh is free for manufacturers to define own complex data types. The range 60h - 7Fh contains device profile specific standard data types. From 80h – 9Fh device profile specific complex data types are defined. The range A0h – 25Fh is reserved for the data type definitions for Multiple Device Modules similar to the entries 60h – 9Fh. The entries form 360h – FFFh are reserved for possible future enhancements . The range 1000h - 1FFFh contains the communication specific Object Dictionary entries. These parameters are called communication entries, their specification is common to all device types, regardless of the device profile they use. The objects in range 1000h - 1FFFh not specified by this document are reserved for further use. The range 2000h - 5FFFh is free for manufacturer specific profile definition. The range 6000h - 9FFFh contains the standardised device profile parameters. The range A000h FFFFh is reserved for future use. 9.5.3 Data Type Entry Specification

The static data types are placed in the Object Dictionary for definition purposes only. However, indices in the range 0001h - 0007h can be mapped as well in order to define the appropriate space in the RPDO as not being used by this device (do not care). The indices 0009h - 000Bh, 000Fh can not be mapped in a PDO. The order of the data types is as follows: Table 39: Object Dictionary Data Types Index 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A Object DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE Name BOOLEAN INTEGER8 INTEGER16 INTEGER32 UNSIGNED8 UNSIGNED16 UNSIGNED32 REAL32 VISIBLE_STRING OCTET_STRING 80

APPLICATION LAYER 000B 000C 000D 000E 000F 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C-001F 0020 0021 0022 0023 0024-003F 0040-005F 0060-007F 0080-009F 00A0-00BF 00C0-00DF 00E0-00FF 0100-011F 0120-013F 0140-015F 0160-017F 0180-019F 01A0-01BF 01C0-01DF 01E0-01FF 0200-021F 0220-023F 0240-025F DEFSTRUCT DEFTYPE DEFSTRUCT DEFTYPE DEFSTRUCT DEFTYPE DEFSTRUCT DEFTYPE DEFSTRUCT DEFTYPE DEFSTRUCT DEFTYPE DEFSTRUCT DEFTYPE DEFSTRUCT DEFTYPE DEFSTRUCT DEFSTRUCT DEFSTRUCT DEFSTRUCT DEFSTRUCT DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE DEFTYPE

CANopen UNICODE_STRING TIME_OF_DAY TIME_DIFFERENCE reserved DOMAIN INTEGER24 REAL64 INTEGER40 INTEGER48 INTEGER56 INTEGER64 UNSIGNED24 reserved UNSIGNED40 UNSIGNED48 UNSIGNED56 UNSIGNED64 reserved PDO_COMMUNICATION_PARAMETER PDO_MAPPING SDO_PARAMETER IDENTITY reserved Manufacturer Specific Complex Data Types
Device Profile (0) Specific Standard Data Types Device Profile (0) Specific Complex Data Types Device Profile 1 Specific Standard Data Types Device Profile 1 Specific Complex Data Types Device Profile 2 Specific Standard Data Types Device Profile 2 Specific Complex Data Types Device Profile 3 Specific Standard Data Types Device Profile 3 Specific Complex Data Types Device Profile 4 Specific Standard Data Types Device Profile 4 Specific Complex Data Types Device Profile 5 Specific Standard Data Types Device Profile 5 Specific Complex Data Types Device Profile 6 Specific Standard Data Types Device Profile 6 Specific Complex Data Types Device Profile 7 Specific Standard Data Types Device Profile 7 Specific Complex Data Types

CiA

The data type representations used are detailed in 9.1. Every device does not need to support all the defined data types. A device only has to support the data types it uses with the objects in the range 1000h - 9FFFh. The predefined complex data-types are placed after the standard data-types. Four types are defined at present, the PDO CommPar record (PDO_COMMUNICATION_PARAMETER), the PDO Mapping 81

APPLICATION LAYER

CANopen

CiA

record (PDO_MAPPING), the SDO Parameter record (SDO_PARAMETER) and the Identity record (IDENTITY). They are placed at index 20h, 21h, 22h and 23h. For devices or device profiles that provide Multiple Device Modules like multiple axis controllers e.g. the DEFTYPE / DEFSTRUCT mechanism is enhanced for each virtual device with an offset of 40h for up to 7 additional virtual devices. A device may optionally provide the length of the standard data types encoded as UNSIGNED32 at read access to the index that refers to the data type. E.g. index 000Ch (Time of Day) contains the value 30h=48dec as the data type ?Time of Day“ is encoded using a bit sequence of 48 bit. If the length is variable (e.g. 000Fh = Domain), the entry contains 0h. For the supported complex data types a device may optionally provide the structure of that data type at read access to the corresponding data type index. Sub-index 0 then provides the number of entries at this index not counting sub-indices 0 and 255 and the following sub-indices contain the data type according to Table 39 encoded as UNSIGNED8. The entry at Index 20h describing the structure of the PDO Communication Parameter then looks as follows (see also objects 1400h – 15FFh): Table 40: complex data type example Subindex 0h 1h 2h 3h 4h Value 04h 07h 05h 06h 05h (Description) (4 sub indices follow) (UNSIGNED32) (UNSIGNED8) (UNSIGNED16) (UNSIGNED8)

Standard (simple) and complex manufacturer specific data types can be distinguished by attempting to read sub-index 1h: At a complex data type the device returns a value and sub-index 0h contains the number of sub-indices that follow, at a standard data type the device aborts the SDO transfer as no sub-index 1h available. Note that some entries of data type UNSIGNED32 have the character of a structure (e.g. PDO COBID entry, see Figure 65). 9.5.3.1 Organisation of structured Object Dictionary Entries If an Object Dictionary entry (index) contains several sub-indices, then sub-index 0 describes the highest available sub-index that follows, not considering FFh. This entry is encoded as UNSIGNED8. Sub-index FFh describes the structure of the entry by providing the data type and the object type of the entry. It is encoded as UNSIGNED32 and organised as follows: MSB Bits 31-16 Value Reserved (value: 00 00h) 15-8 Data Type (see Table 39) Encoded as UNSIGNED8 LSB 7-0 Object (see Table 37) UNSIGNED8

Figure 51: structure sub-index FFh It is optional to support sub-index FFh. If it is supported throughout the Object Dictionary and the structure of the complex data types is provided as well, it enables one to upload the entire structure of the Object Dictionary. 9.5.4 Specification of Predefined Complex Data Types

This section describes the structure of the predefined complex data types used for communication. The value range and the meaning is explained at the detailed description of the objects using these types.

82

APPLICATION LAYER 9.5.4.1

CANopen

CiA

PDO Communication Paramter Record Specification Table 41: PDO Communication Parameter Record Index 0020h Sub-Index 0h 1h 2h 3h 4h 5h
Field in PDO Communication Parameter Record

Data Type UNSIGNED8 UNSIGNED32 UNSIGNED8 UNSIGNED16 UNSIGNED8 UNSIGNED16

number of supported entries in the record COB-ID transmission type inhibit time reserved event timer

9.5.4.2

PDO Mapping Parameter Record Specification Table 42: PDO Mapping Parameter Record Index 0021h Sub-Index 0h 1h 2h ::: :: :::::: 40h
Field in PDO Parameter Mapping Record

Data Type UNSIGNED8 UNSIGNED32 UNSIGNED32 :::::: UNSIGNED32

number of mapped objects in PDO 1st object to be mapped 2
nd

object to be mapped

:::::::: 64 object to be mapped
th

9.5.4.3 9.5.4.4 SDO Parameter Record Specification Table 43: SDO Parameter Record Index 0022h Sub-Index 0h 1h 2h 3h 9.5.4.5 Field in SDO Parameter Record number of supported entries COB-ID client -> server COB-ID server -> client node ID of SDO’s client resp. server Data Type UNSIGNED8 UNSIGNED32 UNSIGNED32 UNSIGNED8

Identity Record Specification Table 44: Identity Record Index 0023h Sub-Index 0h 1h 2h 3h 4h Field in Identity Record number of supported entries Vendor-ID Product code Revision number Serial number Data Type UNSIGNED8 UNSIGNED32 UNSIGNED32 UNSIGNED32 UNSIGNED32

83

APPLICATION LAYER 9.6 9.6.1 Communication Profile Specification Detailed Object Specification

CANopen

CiA

The structure of the Object Dictionary entries is described in the following manner: All device, interface and application profiles based on this communication profile have to follow this structure. Table 45: Format of an Object Description OBJECT DESCRIPTION INDEX Name Object Code Data Type Category Profile Index Number Name of parameter Variable classification Data type classification Optional or Mandatory

The Object Code must be one of those defined in OBJECT DESCRIPTION Table 45 above. For better readability, the Object Description additionally contains the symbolic Object Name. Table 46: Object Value Description Format ENTRY DESCRIPTION Sub-Index Description Data Type Entry Category Access Number of sub-indices being described (field only used for Arrays, Records and Structures) Descriptive name of the Sub-Index (field only used for Arrays, Records and Structures) Data type classification (field only used for Records and Structures) Specifies if the Entry is Optional or Mandatory or Conditional in case the Object is present Read Only (ro) or Read/Write (rw) or Write Only (wo) or Const. In OPERATIONAL state the Access to Object Dictionary Entries may be limited, e.g set to ro. Optional/Default/No - can this object be mapped to a PDO. Description: Optional: Object may be mapped into a PDO Default: Object is part of the default mapping (see device profile) No: Value Range Default Value No: Value: Object must not be mapped into a PDO not defined by this specification default value of an object after device initialisation range of possible values, or name of data type for full range

PDO Mapping

For simple variables the value description appears once without the sub-index field and entry category. For complex data types the value description must be defined for each element (sub-index). 9.6.2 Overview Object Dictionary Entries for Communication Table 47: Standard Objects
Index (hex) 1000
1

Table 47 gives an overview over the Object Dictionary entries defined by the communication profile:

Object (Symbolic Name) VAR

Name

Type

Acc.1

M/O

device type

UNSIGNED32

ro

M

Access type listed here may vary for certain sub-indices. See detailed object specification. 84

APPLICATION LAYER
1001 1002 1003 1004 1005 1006 1007 1008 1009 100A 100B 100C 100D 100E 100F 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 ::::: 11FF 1200 1201 ::::: 127F 1280 1281 ::::: 12FF 1300 ::::: 13FF 1400 1401 ::::: 15FF 1600 1601 RECORD RECORD ::::: RECORD RECORD RECORD ::::: RECORD RECORD ::::: RECORD RECORD RECORD ::::: RECORD ::::: ARRAY ARRAY VAR VAR VAR VAR ARRAY VAR RECORD VAR VAR guard time life time factor VAR VAR VAR VAR VAR VAR VAR VAR ARRAY error register

CANopen
UNSIGNED8 UNSIGNED32 UNSIGNED32 UNSIGNED32 UNSIGNED32 UNSIGNED32 Vis-String Vis-String Vis-String UNSIGNED16 UNSIGNED8 reserved for compatibility reasons reserved for compatibility reasons store parameters restore default parameters COB-ID TIME high resolution time stamp COB-ID EMCY Inhibit Time EMCY Consumer heartbeat time Producer heartbeat time Identity Object reserved ::::: reserved Server SDO Parameter 1 Server SDO parameter 2
nd st

CiA
ro ro ro rw rw rw const const const rw rw M O O O O O O O O O O

manufacturer status register pre-defined error field COB-ID SYNC communication cycle period synchronous window length manufacturer device name manufacturer hardware version manufacturer software version

reserved for compatibility reasons

reserved for compatibility reasons

UNSIGNED32 UNSIGNED32 UNSIGNED32 UNSIGNED32 UNSIGNED32 UNSIGNED16 UNSIGNED32 UNSIGNED16 Identity (23h) :::::

rw rw rw rw rw rw rw rw ro :::::

O O O O O O O O M :::::

SDO Parameter (22h) SDO Parameter (22h) ::::: SDO Parameter (22h) SDO Parameter (22h) SDO Parameter (22h) ::::: SDO Parameter (22h) :::::

ro rw ::::: rw rw rw ::::: rw :::::

O M/O** ::::: M/O** M/O** M/O** ::::: M/O** :::::

Server SDO parameter
th

::::: 128 Server SDO parameter 1 Client SDO parameter 2
nd st

Client SDO Parameter Client SDO parameter
th

::::: 128 Client SDO parameter reserved ::::: reserved

Receive PDO Communication Parameter 1 receive PDO Parameter 2
nd st

PDO CommPar (20h) PDO CommPar (20h) :::::

rw ::::: rw rw rw

M/O* M/O* ::::: M/O* M/O* M/O*

receive PDO Parameter
th

::::: 512 receive PDO Parameter 1 receive PDO mapping 2
nd st

PDO CommPar (20h) PDO Mapping (21h) PDO Mapping (21h)

Receive PDO Mapping Parameter receive PDO mapping

85

APPLICATION LAYER
::::: 17FF 1800 1801 ::::: 19FF 1A00 1A01 ::::: 1BFF ::::: RECORD RECORD RECORD ::::: RECORD RECORD RECORD ::::: RECORD :::::

CANopen
:::::
th

CiA
::::: rw rw rw ::::: rw rw rw ::::: rw ::::: M/O* M/O* M/O* :::: M/O* M/O* M/O* ::::: M/O*

512 receive PDO mapping 1 transmit PDO Parameter 2
nd st

PDO Mapping (21h) PDO CommPar (20h) PDO CommPar (20h) ::::: PDO CommPar (20h) PDO Mapping (21h) PDO Mapping (21h) ::::: PDO Mapping (21h)

Transmit PDO Communication Parameter transmit PDO Parameter
th

::::: 512 transmit PDO Parameter 1 transmit PDO mapping 2
nd st

Transmit PDO Mapping Parameter transmit PDO mapping
th

::::: 512 transmit PDO mapping

* If a device supports PDOs, the according PDO communication parameter and PDO mapping entries in the Object Dictionary are mandatory. These may be read_only. ** If a device supports SDOs, the according SDO parameters in the Object Dictionary are mandatory. 9.6.3 Detailed Specification of Communication Profile specific Objects

Object 1000h: Device Type Contains information about the device type. The object at index 1000h describes the type of device and its functionality. It is composed of a 16-bit field which describes the device profile that is used and a second 16-bit field which gives additional information about optional functionality of the device. The Additional Information parameter is device profile specific. Its specification does not fall within the scope of this document, it is defined in the appropriate device profile. The value 0000h indicates a device that does not follow a standardised device profile. For multiple device modules the Additional Information parameter contains FFFFh and the device profile number referenced by object 1000h is the device profile of the first device in the Object Dictionary. All other devices of a multiple device module identify their profiles at objects 67FFh + x * 800h with x = internal number of the device (0 – 7). These entries describe the device type of the preceding device. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Byte: MSB Additional Information Device Profile Number

1000h device type VAR UNSIGNED32 Mandatory

ro No UNSIGNED32 No LSB

Figure 52: Structure of the Device Type Parameter

86

APPLICATION LAYER Object 1001h: Error Register

CANopen

CiA

This object is an error register for the device. The device can map internal errors in this byte. This entry is mandatory for all devices. It is a part of an Emergency object. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value ro Optional UNSIGNED8 No 1001h error register VAR UNSIGNED8 Mandatory

Table 48: Structure of the Error Register Bit 0 1 2 3 4 5 6 7 M/O M O O O O O O O Meaning generic error current voltage temperature communication error (overrun, error state) device profile specific Reserved (always 0) manufacturer specific

If a bit is set to 1 the specified error has occurred. The only mandatory error that has to be signalled is the generic error. The generic error is signaled at any error situation. Object 1002h: Manufacturer Status Register This object is a common status register for manufacturer specific purposes. In this document only the size and the location of this object is defined. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 1002h manufacturer status register VAR UNSIGNED32 Optional

87

APPLICATION LAYER ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Object 1003h: Pre-defined Error Field

CANopen ro Optional UNSIGNED32 No

CiA

The object at index 1003h holds the errors that have occurred on the device and have been signaled via the Emergency Object. In doing so it provides an error history. 1. The entry at sub-index 0 contains the number of actual errors that are recorded in the array starting at sub-index 1. 2. Every new error is stored at sub-index 1, the older ones move down the list. 3. Writing a ?0“ to sub-index 0 deletes the entire error history (empties the array). Values higher than 0 are not allowed to write. This have to lead to an abort message (error code: 0609 0030h). 4. The error numbers are of type UNSIGNED32 (see Table 7-18) and are composed of a 16 bit error code and a 16 bit additional error information field which is manufacturer specific. The error code is contained in the lower 2 bytes (LSB) and the additional information is included in the upper 2 bytes (MSB). If this object is supported it must consist of two entries at least. The length entry on subindex 0h and at least one error entry at sub-index 1H. Byte: MSB Additional Information Error code LSB

Figure 53: Structure of the pre-defined error field OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value 0h number of errors Mandatory rw No 0 - 254 0 1h standard error field Optional ro No UNSIGNED32 No 1003h pre-defined error field ARRAY UNSIGNED32 Optional

88

APPLICATION LAYER Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value

CANopen 2h - FEh standard error field Optional ro No UNSIGNED32 No

CiA

Object 1005h: COB-ID SYNC message Index 1005h defines the COB-ID of the Synchronisation Object (SYNC). Further, it defines whether the device generates the SYNC. The structure of this object is shown in Figure 54 and Table 49. UNSIGNED32 MSB bits 11-bit-ID 29-bit-ID 31 X X 30 29 28-11
000000000000000000

LSB 10-0 11-bit Identifier 0/1 0 0/1 1

29 -bit Identifier

Figure 54: Structure of SYNC COB-ID entry Table 49: Description of SYNC COB-ID entry bit number 31 (MSB) 30 29 28 – 11 10-0 (LSB) value X 0 1 0 1 0 X X meaning do not care Device does not generate SYNC message Device generates SYNC message 11-bit ID (CAN 2.0A) 29-bit ID (CAN 2.0B) if bit 29=0 if bit 29=1: bits 28-11 of 29-bit-SYNC-COB-ID bits 10-0 of SYNC-COB-ID

Bits 29, 30 may be static (not changeable). If a device is not able to generate SYNC messages, an attempt to set bit 30 is responded with an abort message (abort code: 0609 0030h). Devices supporting the standard CAN frame type only either ignore attempts to change bit 29 or respond with an abort message (abort code: 0609 0030h). The first transmission of SYNC object starts within 1 sync cycle after setting Bit 30 to 1. It is not allowed to change Bit 0-29, while the objects exists (Bit 30=1). OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 1005h COB-ID SYNC VAR UNSIGNED32 Conditional; Mandatory, if PDO communication on a synchronous base is supported

89

APPLICATION LAYER ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value

CANopen rw No UNSIGNED32 80h or 8000 0080h

CiA

Object 1006h: Communication Cycle Period This object defines the communication cycle period in ?s. This period defines the SYNC interval. It is 0 if not used. If the communication cycle period on sync producer is changed to a new value unequal 0 the transmission of sync object resumes within 1 sync cycle of the new value. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 1006h communication cycle period VAR UNSIGNED32 Conditional; Mandatory for Sync producers ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Object 1007h: Synchronous Window Length Contains the length of the time window for synchronous PDOs in ?s. It is 0 if not used. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value rw No UNSIGNED32 0 1007h synchronous window length VAR UNSIGNED32 Optional rw No UNSIGNED32 0

90

APPLICATION LAYER Object 1008h: Manufacturer Device Name Contains the manufacturer device name. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value

CANopen

CiA

1008h manufacturer device name VAR Visible String Optional

const No No No

Object 1009h: Manufacturer Hardware Version Contains the manufacturer hardware version description. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Object 100Ah: Manufacturer Software Version Contains the manufacturer software version description. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value const No No No 100Ah manufacturer software version VAR Visible String Optional const No No No 1009h manufacturer hardware version VAR Visible String Optional

91

APPLICATION LAYER Object 100Ch: Guard Time

CANopen

CiA

The objects at index 100Ch and 100Dh include the guard time in milliseconds and the life time factor. The life time factor multiplied with the guard time gives the life time for the Life Guarding Protocol. It is 0 if not used. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 100Ch guard time VAR UNSIGNED16 Conditional; Mandatory, if heartbeat is not supported ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Object 100Dh: Life Time Factor The life time factor multiplied with the guard time gives the life time for the node guarding protocol. It is 0 if not used. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 100Dh life time factor VAR UNSIGNED8 Conditional; Mandatory, if heartbeat is not supported ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Object 1010h: Store parameters This object supports the saving of parameters in non volatile memory. By read access the device provides information about its saving capabilities. Several parameter groups are distinguished: Sub-Index 0 contains the largest Sub-Index that is supported. Sub-Index 1 refers to all parameters that can be stored on the device. Sub-Index 2 refers to communication related parameters (Index 1000h - 1FFFh manufacturer specific communication parameters). Sub-Index 3 refers to application related parameters (Index 6000h - 9FFFh manufacturer specific application parameters). At Sub-Index 4 - 127 manufacturers may store their choice of parameters individually. 92 rw; ro, if life guarding is not supported No UNSIGNED8 0 rw; ro, if life guarding is not supported No UNSIGNED16 0

APPLICATION LAYER

CANopen

CiA

Sub-Index 128 - 254 are reserved for future use. In order to avoid storage of parameters by mistake, storage is only executed when a specific signature is written to the appropriate Sub-Index. The signature is ?save“. Signature ISO 8859 (“ASCII”) hex MSB e 65h v 76h a 61h LSB s 73h

Figure 55: Storage write access signature On reception of the correct signature in the appropriate sub-index the device stores the parameter and then confirms the SDO transmission (initiate download response). If the storing failed, the device responds with an Abort SDO Transfer (abort code: 0606 0000h). If a wrong signature is written, the device refuses to store and responds with Abort SDO Transfer (abort code: 0800 002xh). On read access to the appropriate Sub-Index the device provides information about its storage functionality with the following format: UNSIGNED32 MSB bits 31-2 reserved (=0) Figure 56: Storage read access structure Table 50: Structure of read access bit number 31-2 1 0 value 0 0 1 0 1 meaning reserved (=0) Device does not save parameters autonomously Device saves parameters autonomously Device does not save parameters on command Device saves parameters on command LSB 1 0 0/1 0/1

Autonomous saving means that a device stores the storable parameters in a non-volatile manner without user request. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value 0h largest subindex supported Mandatory ro No 1h – 7Fh No 1010h store parameters ARRAY UNSIGNED32 Optional

93

APPLICATION LAYER Sub-Index Description Entry Category Access PDO Mapping Value Range

CANopen 1h save all parameters Mandatory rw No UNSIGNED32 (Figure 55 for write access; Figure 56 for read access)

CiA

Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range

No 2h save communication parameters Optional rw No UNSIGNED32 (Figure 55 for write access; Figure 56 for read access)

Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range

No 3h save application parameters Optional rw No UNSIGNED32 (Figure 55 for write access; Figure 56 for read access)

Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range

No 4h - 7Fh save manufacturer defined parameters Optional rw No UNSIGNED32 (Figure 55 for write access; Figure 56 for read access)

Default Value Object 1011h: Restore default parameters

No

With this object the default values of parameters according to the communication or device profile are restored. By read access the device provides information about its capabilities to restore these values. Several parameter groups are distinguished: Sub-Index 0 contains the largest Sub-Index that is supported. Sub-Index 1 refers to all parameters that can be restored. 94

APPLICATION LAYER

CANopen

CiA

Sub-Index 2 refers to communication related parameters (Index 1000h - 1FFFh manufacturer specific communication parameters). Sub-Index 3 refers to application related parameters (Index 6000h - 9FFFh manufacturer specific application parameters). At Sub-Index 4 - 127 manufacturers may restore their individual choice of parameters. Sub-Index 128 - 254 are reserved for future use. In order to avoid the restoring of default parameters by mistake, restoring is only executed when a specific signature is written to the appropriate sub-index. The signature is ?load“. Signature ASCII hex MSB d 64h a 61h o 6Fh LSB l 6Ch

Figure 57: Restoring write access signature On reception of the correct signature in the appropriate sub-index the device restores the default parameters and then confirms the SDO transmission (initiate download response). If the restoring failed, the device responds with an Abort SDO Transfer (abort code: 0606 0000h). If a wrong signature is written, the device refuses to restore the defaults and responds with an Abort SDO Transfer (abort code: 0800 002xh). The default values are set valid after the device is reset (reset node for sub-index 1h – 7Fh, reset communication for sub-index 2h) or power cycled.

restore default

reset / power cycle

default values valid Figure 58: restore procedure On read access to the appropriate sub-index the device provides information about its default parameter restoring capability with the following format: UNSIGNED32 MSB bits 31-1 reserved (=0) LSB 0 0/1

Figure 59: Restoring default values read access structure

95

APPLICATION LAYER

CANopen Table 51: Structure of restore read access

CiA

bit number 31-1 0

value 0 0 1

meaning reserved (=0) Device does not restore default parameters Device restores parameters

OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value 0h largest subindex supported Mandatory ro No 1h – 7Fh No 1h restore all default parameters Mandatory rw No UNSIGNED32 (Figure 57) No 2h restore communication default parameters Optional rw No UNSIGNED32 (Figure 57) No 1011h restore default parameters ARRAY UNSIGNED32 Optional

96

APPLICATION LAYER Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category PDO Mapping Value Range Object 1012h: COB-ID Time Stamp Object

CANopen 3h restore application default parameters Optional rw No UNSIGNED32 (Figure 57) No 4h - 7Fh restore manufacturer default parameters Optional No UNSIGNED32 (Figure 57) defined

CiA

Index 1012h defines the COB-ID of the Time-Stamp Object (TIME). Further, it defines whether the device consumes the TIME or whether the device generates the TIME. The structure of this object is shown in Figure 60 and Table 52. UNSIGNED32 MSB bits 11-bit-ID 29-bit-ID 31 0/1 0/1 30 29 28-11
000000000000000000

LSB 10-0 11-bit Identifier 0/1 0 0/1 1

29 -bit Identifier

Figure 60: Structure of TIME COB-ID entry Table 52: Description of TIME COB-ID entry bit number 31 (MSB) 30 29 28 – 11 10-0 (LSB) value 0 1 0 1 0 1 0 X X meaning Device does not consume TIME message Device consumes TIME message Device does not produce TIME message Device produces TIME message 11-bit ID (CAN 2.0A) 29-bit ID (CAN 2.0B) if bit 29=0 if bit 29=1: bits 28-11 of 29-bit-TIME-COB-ID bits 10-0 of TIME-COB-ID

Bits 29, 30 may be static (not changeable). If a device is not able to generate TIME messages, an attempt to set bit 30 is responded with an abort message (abort code: 0609 0030h). Devices supporting the standard CAN frame type only, an attempt to set bit 29 is responded with an abort message (abort code: 0609 0030h). It is not allowed to change Bits 0-29, while the object exists (Bit 30=1).

97

APPLICATION LAYER OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Object 1013h: High Resolution Time Stamp

CANopen 1012h COB-ID time stamp message VAR UNSIGNED32 Optional

CiA

rw No UNSIGNED32 100h

This object contains a time stamp with a resolution of 1 ?s (see 9.3.2). It can be mapped into a PDO in order to define a high resolution time stamp message. (Note that the data type of the standard time stamp message (TIME) is fixed). Further application specific use is encouraged. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Object 1014h: COB-ID Emergency Object Index 1014h defines the COB-ID of the Emergency Object (EMCY). The structure of this object is shown in Figure 61. UNSIGNED32 MSB bits 31 30 0 0 29 0 1 28-11
000000000000000000

1013h high resolution time stamp VAR UNSIGNED32 Optional

rw Optional UNSIGNED32 0

LSB 10-0 11-bit Identifier

11-bit-ID 0/1 29-bit-ID 0/1

29 -bit Identifier

Figure 61: Structure of the EMCY Identifier entry

98

APPLICATION LAYER

CANopen Table 53: Description of EMCY COB-ID entry

CiA

bit number 31 (MSB) 30 29 28 - 11 10-0 (LSB)

value 0 1 0 0 1 0 X X

Meaning EMCY exists / is valid EMCY does not exist / is not valid reserved (always 0) 11-bit ID (CAN 2.0A) 29-bit ID (CAN 2.0B) if bit 29=0 if bit 29=1: bits 28-11 of 29-bit-COB-ID bits 10-0 of COB-ID

Devices supporting the standard CAN frame type only, an attempt to set bit 29 is responded with an abort message (abort code: 0609 0030h). It is not allowed to change Bits 0-29, while the object exists (Bit 31=0). OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 1014h COB-ID Emergency message VAR UNSIGNED32 Conditional; Mandatory, if Emergency is supported ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Object 1015h: Inhibit Time EMCY The inhibit time for the EMCY message can be adjusted via this entry. If this entry exists it must be writable in the object dictionary. The time has to be a multiple of 100?s. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value rw No UNSIGNED16 0 1015h Inhibit Time EMCY VAR UNSIGNED16 Optional ro; optional rw No UNSIGNED32 80h + Node-ID

99

APPLICATION LAYER Object 1016h: Consumer Heartbeat Time

CANopen

CiA

The consumer heartbeat time defines the expected heartbeat cycle time and thus has to be higher than the corresponding producer heartbeat time configured on the device producing this heartbeat. Monitoring starts after the reception of the first heartbeat. If the consumer heartbeat time is 0 the corresponding entry is not used. The time has to be a multiple of 1ms. UNSIGNED32 MSB Bits 31-24 Value reserved (value: 00h) Encoded as 23-16 Node-ID UNSIGNED8 LSB 15-0 heartbeat time UNSIGNED16

Figure 62: Structure of Consumer Heartbeat Time entry At an attempt to configure several consumer heartbeat times unequal 0 for the same Node-ID the device aborts the SDO download with abort code 0604 0043h OBJECT DESCRIPTION INDEX Name Object Code Data Type Category ENTRY DESCRIPTION Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value 0h number entries Mandatory ro No 1 – 127 No 1h Consumer Heartbeat Time Mandatory rw No UNSIGNED32 (Figure 62) 0 2h – 7Fh Consumer Heartbeat Time Optional rw No UNSIGNED32 (Figure 62) No 1016h Consumer Heartbeat Time ARRAY UNSIGNED32 Optional

Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value

100

APPLICATION LAYER Object 1017h: Producer Heartbeat Time

CANopen

CiA

The producer hartbeat time defines the cycle time of the heartbeat. The producer heartbeat time is 0 if it not used. The time has to be a multiple of 1ms. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 1017h Producer Heartbeat Time VAR UNSIGNED16 Conditional; Mandatory if guarding not supported ENTRY DESCRIPTION Access PDO Mapping Value Range Default Value Object 1018h: Identity Object The object at index 1018h contains general information about the device. The Vendor ID (sub-index 1h) contains a unique value allocated to each manufacturer. The manufacturer-specific Product code (sub-index 2h) identifies a specific device version. The manufacturer-specific Revision number (sub-index 3h) consists of a major revision number and a minor revision number. The major revision number identifies a specific CANopen behaviour. If the CANopen functionality is expanded, the major revision has to be incremented. The minor revision number identifies different versions with the same CANopen behaviour. 31 major revision number MSB Figure 63: Structure of Revision number The manufacturer-specific Serial number (sub-index 4h) identifies a specific device. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 1018h Identity Object RECORD Identity Mandatory 16 15 minor revision number LSB 0 rw No UNSIGNED16 0

101

APPLICATION LAYER ENTRY DESCRIPTION Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value

CANopen 0h number of entries Mandatory ro No 1 .. 4 No 1h Vendor ID Mandatory ro No UNSIGNED32 No 2h Product code Optional ro No UNSIGNED32 No 3h Revision number Optional ro No UNSIGNED32 No 4h Serial number Optional ro No UNSIGNED32 No

CiA

102

APPLICATION LAYER

CANopen

CiA

Object 1200h - 127Fh: Server SDO Parameter In order to describe the SDOs used on a device the data type SDO Parameter is introduced. The data type has the index 22h in the Object Dictionary. The structure is described in 9.5.4. The number of supported entries in the SDO object record is specified at sub-index 0h. The values at 1h and 2h specify the COB-ID for this SDO. Sub-index 3 gives the server of the SDO in case the record describes an SDO for which the device is client and gives the client of the SDO if the record describes an SDO for which the device is server. UNSIGNED32 MSB bits 11-bit-ID 29-bit-ID 31 0/1 0/1 30 0 0 29 0 1 28-11
000000000000000000

LSB 10-0 11-bit Identifier

29-bit Identifier

Figure 64: Structure of SDO COB-ID entry Table 54: Description of SDO COB-ID entry bit number 31 (MSB) 30 29 28 - 11 10-0 (LSB) value 0 1 0 0 1 0 X X Meaning SDO exists / is valid SDO does not exist / is not valid reserved (always 0) 11-bit ID (CAN 2.0A) 29-bit ID (CAN 2.0B) if bit 29=0 if bit 29=1: bits 28-11 of 29-bit-COB-ID bits 10-0 of COB-ID

An SDO is only valid if both SDO-valid-bits are 0. Devices supporting the standard CAN frame type only, an attempt to set bit 29 is responded with an abort message (abort code: 0609 0030h). These objects contain the parameters for the SDOs for which the device is the server. If a device handles more than one server SDO the default SDO must be located at index 1200h as the first server SDO. This entry is read only 2. All additional server SDOs are invalid by default (invalid bit - see Table 54), there description is located at subsequent indicies. It is not allowed to change the COB-ID while the SDO exists. The description of the Client of the SDO (sub-index 3h) is optional. It is not available for the default SDO (no Sub-index 3h at Index 1200h), as this entry is read only. OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 1200h - 127Fh Server SDO parameter RECORD SDO Parameter Conditional Index 1200h: Optional Index 1201h - 127Fh: Mandatory for each additionally supported server SDO

2

It has to be ensured that the COB-IDs of the default SDO can not be manipulated by writing to the Object Dictionary. 103

APPLICATION LAYER ENTRY DESCRIPTION Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value

CANopen 0h number of entries Mandatory ro No Index 1200h: 2 Index 1201h – 127F: 2 - 3 No 1h COB-ID Client->Server (rx) Mandatory Index 1200h: ro, Index 1201h-127Fh: rw No UNSIGNED32 (Table 54) Index 1200h: 600h+Node-ID, Index 1201h-127Fh: disabled

CiA

Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value

2h COB-ID Server -> Client (tx) Mandatory Index 1200h: ro Index 1201-127Fh: rw No UNSIGNED32 (Table 54) Index 1200h: 580h+Node-ID, Index 1201h-127Fh: disabled

Sub-Index Description Entry Category Access PDO Mapping Value Range Default Value

3h Node-ID of the SDO client Optional rw No 1h – 7Fh No

104

APPLICATION LAYER Object 1280h - 12FFh: Client SDO Parameter

CANopen

CiA

These objects contain the parameters for the SDOs for which the device is the client. If the entry is supported, all sub-indices must be available. Starting at index 1280h and subsequent indices. The entries are described at the Server SDO Parameter. All client SDOs are invalid by default (invalid bit – see Table 54). OBJECT DESCRIPTION INDEX Name Object Code Data Type Category 1280h - 12FFh Client SDO parameter RECORD

相关文章:
...CANopen application layer and communication prof....pdf
CiA 301 CANopen application layer and communication profile(IGCO_301_v04000202) - ? CAN in Auto...
CANopen application layer and communication profile....pdf
CANopen application layer and communication profile CiA 301 v4.2.0-2011 - CiA 301 CANopen applic...
...Application Layer and Communication Profile.pdf
CiA 301 CANopen application layer and communication profile Application layer and communication profile Version: 4.2.0 21 February 2011 ? CAN in Automation ...
CiA 406 DS V3.2 CANopen device profile for encoder(....pdf
CiA 406 DS V3.2 CANopen device profile for encoder(IGCO_406_v03020001)...the CANopen application layer and communication profile specification /CiA301/...
canopen_ds301.pdf
? CAN in Automation e. V. CANopen Application Layer and Communication Profile CiA Draft Standard 301 Version 4.02 Date: 13 February 2002 HISTORY CANopen...
CiA 303-3 DR V1.3 CANopen additional specification - Par....pdf
2 References /CiA301/ CiA DS 301, CANopen application layer and communication profile 3 Abbreviations and definitions 3.1 Abbreviations LED ERR I/O Light ...
DSP301_V420.pdf
DSP301_V420_计算机软件及应用_IT/计算机_专业资料。CANopen最新的协议(2007.12) CiA Draft Standard Proposal 301 Application layer and communication profile ...
CAN全套协议_之DS102.pdf
2 Normative references CiA 301, CANopen application layer and communication profile CiA 303-1, CANopen additional specification Part 1: Cabling and ...
CiA 303-3 DR V1.3 CANopen additional specification Pa....pdf
2 References /CiA301/ CiA DS 301, CANopen application layer and communication profile 3 Abbreviations and definitions 3.1 Abbreviations LED ERR I/O Light ...
Cia DSP414 V1.0-Device Profiles for Weaving Machines1.pdf
Controller area network (CAN), November 1993. /2/: CiA DS-301 V4.01, CANopen application layer and communication profile, June 2000. /3/ /4/ CiA ...
canopen华茂教程.pdf
如(的在 CANopen Application Layer and Communication Profile (CiA DS 301 V 4.02 ) 中定义了 MPDO(multiplexor PDO),允许一个 PDO 传输大量变量,通过在报文 ...
CANopen从站协议的设计与实现_图文.pdf
[2] CiA. CANopen-Application Layer and Communication Profile. CiA Draft Standard 301 Version 4.02[S]. 2002. [3] 宋威.CANopen现场总线应用层协议主站的...
电梯CAN1.pdf
配置程序) 4 基于 CiA DSP417 电梯设备子协议通讯原理电梯设备子协议通讯遵循 CiA DS 301 V4.02 规范Canopen application layer and communication profile ...
CAN全套协议_之DS103.pdf
Intrinsic safety CiA 301, CANopen application layer and communication profile CiA 303, CANopen additional specification Part 1: Cabling and connector pin...
LXM32A_CANopen_Manual_V105_EN编程说明.pdf
(DS301) CANopen application layer and communication profile CiA Standard 402...? Set the transmission rate in the parameter CANbaud (Cobd) to meet the...
CiA 402-1 version 3.0.0.pdf
2 Normative references CiA 301, CANopen application layer and communication profile CiA 402-2, CANopen drive and motion control device profile Part 2:...
canopen ds306.pdf
CiA 301, CANopen application layer and communication profile CiA 302, CANopen framework for CANopen managers and programmable CANopen devices CiA 401, CAN...
DS301_V4.02.pdf
DS301_V4.02 - ? CAN in Automation e. V. CANopen Application Layer and Communication Profile CiA...
CANopen协议介绍.pdf
CiA DS-301 Data Link Layer Chip CAN 2.0A ISO 11898 Physical Layer Cable...CANopen Application Layer and Communication Profile MPDO(multiplexor PDO) PDO ...
CiA 303-1 DR V1.4 CANopen additional specification - Par....pdf
CiA DS 301, CANopen application layer and communication profile CiA DS 102, CAN physical layer for industrial applications CiA DSP 413, Device profile for...
更多相关标签: