Manual
Table Of Contents
- Important User Information
- P. About This Document
- 1. Product Overview
- 2. CANopen Fieldbus Functionality
- 3. Transparent CAN Mode
- 4. Installation
- 5. Configuration
- 6. CANopen Module Specification
- 7. Supported Objects
- 8. Interface Functions
- A. Technical Specification
- B. Status LED Timing Diagrams
- C. CANopen Emergency Codes
- D. Error Codes (RET)
Interface Functions 45
Doc.Id. HMSI-216-117
CM CANopen Module for SIMATIC S7-1200
Doc.Rev. 1.00
8.1.3 SDO Read/Write
General
Reading (uploading) and writing (downloading) SDOs is performed by function blocks, available for
download from www.hms-networks.com/can-for-S7-1200.
1
Please note that these functions are only
supported in CANopen manager mode.
Input Parameters
Output Parameters
Description
ReadSDO
Performs an SDO read on the node, index and subindex that is defined in the parameters. Returned data
is saved in the area that DB points to. The block will continue to read the SDO even when the data area
is filled, until the SIMATIC S7-1200 PLC indicates that the complete SDO is read. Only the predefined
amount of data will be saved. SIZE holds the complete SDO size. If the size given in the parameter
DATA is too small, RET will return error 2200h.
WriteSDO
Performs an SDO write on the node, index and subindex that is defined in the parameters. Data written
is fetched from the area pointed to by DB.
1. Both function blocks use RDREC and WRREC for the data transfer.
Name Data type Description
REQ Bool Start request. Upload/download is started if REQ = TRUE for exactly one function block
call.
ID Word Hardware address for the module. Can be read in TIA Portal.
SLOT Byte Defines which channel is used on the backplane network. This parameter has to be
unique for each of the SDO requests running simultaneously, as the answer to the
request is put in the slot where the request was placed. Valid values: 0 - 7.
Note: This slot is not the same as the physical slot of the module
NODE Int Node-ID of the CANopen module where SDO read/write is to be performed. If you use
Node-ID 0, you always address the CANopen manager, even when the CANopen man-
ager has another Node-ID.
INDEX Word SDO index to be read/written
SUB Byte SDO subindex to be read/written
DB Dint The number of the data block, pointing to the area where to save read data or to get data
to be written.
Note: Data blocks have to be created as Standard S7-300 compatible data blocks (not
optimized).
SIZE Uint Number of bytes to be written. Only valid for WriteSDO.
Name Data type Description
SIZE Uint Number of bytes that have been read. Only valid for ReadSDO.
BUSY Bool If the request isn’t finished within one scan cycle, BUSY turns TRUE and stays TRUE until
the request is finished, when it returns to FALSE.
RET Uint Error code, see “Error Codes (RET)” on page 59. Available when BUSY turns FALSE,
until REQ turns TRUE.










