Application note 0564-01: Domain transfer

 

This document is an amendment to the user manual of the CANopen Library from port.

 

An object of data type DOMAIN allows the transfer of up to 232-1 data bytes by using the SDO segmented transfer (also called SDO normal transfer) or SDO block transfer.

 

Objects of the data type DOMAIN are mapped on a void* pointer in C. The object dictionary created by the Design Tool makes such pointer available. The application is responsible to provide the necessary memory and to direct the pointer onto the memory. Therefor CANopen Library provides the following functions:

 

setDomainAddr(<domainObjectIndex>, <domainObjectSubIndex>, <bufferAddr>)

setDomainSize(<domainObjectIndex>, <domainObjectSubIndex>, <maximalDomainByteSize>)

 

setDomainAddr() directs the pointer to the memory on address <bufferAdr>. The maximal byte length of the complete domain is set about function setDomainSize(). These functions shall be called in the application program at the end of the initialization.

 

When the application cannot provide enough RAM memory for the domain data or the access on flash memory is only allowed page-wise there is the possibility to split the domain data into smaller packets and to save/load the small packets of domain data in/from an intermediate buffer in the RAM and to exchange the domain data between the intermediate buffer and the target memory. In this case <bufferAddr> points on the smaller intermediate buffer in the call of function setDomainAddr(). The input parameter <maximalDomainByteSize> of function setDomainSize() specifies the maximal size of the complete domain again and NOT the size of the smaller intermediate buffer. The size of the smaller intermediate buffer shall be CONFIG_DOMAIN_INDICATION_SIZE + 7 bytes to handle all bytes of a CAN message.

 

The properties of the domain transfer can be configured by the Design Tool as follow:

compiler define

Design Tool setting

CONFIG_DOMAIN_UPDNLD

automatically set during creation of an object of data type DOMAIN

CONFIG_DOMAIN_INDICATION_SIZE

object 1200h / Tab Mask / Enable domain transfer split indication           (SDO Server)

Number of bytes between indications: <smallerMemorySize>

CONFIG_DOMAIN_CONFIRMATION

object 1200h / Tab Mask / Enable domain transfer split indication           (SDO Client)

 

 

Domain download

Figure 1  shows the data processing during SDO domain download from application’s point of view. The arrows “request” and “response” sum up all CAN messages of the used SDO service.

 

 

 

Figure 1: SDO domain download

Domain upload

Figure 2 shows the data processing during SDO domain upload from application’s point of view. The responses from the SDO server are hidden during the data transfer for clarity.

 

 

Figure 2: SDO domain upload

 

SDO transfer

 

The CANopen Library transfers domain data by SDO segmented transfer by default. The transfer by the SDO block transfer requires the extra package “SDO Block Transfer” to the CANopen Library. This extra package does not belong to the standard delivery scope. Please contact port when you like to use the SDO block transfer.

 

The properties of the SDO block transfer can be configured by the Design Tool as follow:

 

compiler define

Design Tool setting

CONFIG_SDO_BLOCKTRANSFER

object 1200h / Tab Mask / Enable SDO Block Transfer

CONFIG_BLOCK_MIN_DATASIZE

object 1200h / Tab Mask / Min. Data Size for Block Transfer

CONFIG_BLOCK_MAX_CNT

object 1200h / Tab Mask / Number of segments per Block

CONFIG_BLOCK_CRC

object 1200h / Tab Mask / Use CRC Check for Block Transfer