7 CANopen Function and Operation All the data in the PDO has to be mapped from the object dictionary. The following is an example of the PDO mapping. The data format for RxPDO and TxPDO is as follows. PDO_1 SDO (service data object) The SDO is used to build the client/server relation between two CANopen devices. The client device can read the data from the object dictionary of the server device, and write the data into the object dictionary of the server device. The visit mode of the SDO is “client/server” mode. The mode which is visited is the SDO server. Every CANopen device has at least one service data object which provides the visit channel for the object dictionary of the device.
SDO can read all objects in the object dictionary, and write all objects into the object dictionary. The SDO message contains the index information and the subindex information which can be used to position the objects in the object dictionary, and the composite data structure can easily pass the SDO visit. After the SDO client sends the reading/writing request, the SDO server replies. The client and the server can stop the transmission of the SDO .The requested message and the reply message are divided by different COB-IDs. The SDO can transmit the data in any length. If the data length is more than 4 bytes, the data has to be transmitted by segment.
The last segment of the data contains an end flag. The structures of the SDO requested message and reply message are as follows. The format of the requested message: The definition of the requested code in the requested message:
7-11 Object dictionary PDO 1 mapping _ 0 3 1 yyyyh yyh 8 2 zzzzh zzh 16 3 xxxxh xxh 8 xxxxh xxh Application object A yyyyh yyh Application object B zzzzh zzh Application object C PDO 1 mapping _ 0 3 1 yyyyh yyh 8 2 zzzzh zzh 16 3 xxxxh xxh 8 Application object B Application object C Application object A COB-ID Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Object identifier Data COB-ID Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 600(hex +Node-ID ) Requested code Object index Object subindex Requested data LSB MSB bit7-0 bit15-8 bit23-16 bit31-24 Request code Description (hex) 23 Writing the 4-byte data 2B Writing the 2-byte data 2F Writing the 1-byte data 40 Reading the data 80 Stopping the current SDO function