Application note 0564-05: SDO split indication
This document is an amendment to the user manual of the CANopen Library from port.
Sometimes the handling of a SDO request needs more time or the application shall process functions before a SDO response is sent. In these cases the function FlushMbox() shall be finished without the generation of the SDO response message. The generation of the SDO response message must be initiated by the application.
The following steps have to do for such behavior:
Activate the necessary C code in the Library by the compiler define: CONFIG_SPLIT_INDICATION. The Design Tool does not provide a setting for this compiler define. We recommend to set the compiler define in C syntax in the Design Tool,V 2.2.x under Hardware Configurations / Advanced Settings or in the Design Tool, V2.3.x under General Settings / Advanced Settings:
#define CONFIG_SPLIT_INDICATION 1 /* SDO slpit indication activated */
After the receipt of a SDO request FlushMbox() calls the indication function sdoRdInd() or sdoWrInd(). These indication functions have to be left with the return value CO_SDO_IND_BUSY in order to avoid the sending of a SDO response message.
After finishing of FlushMbox() the application can execute special functions. In order to finish the SDO transfer the application program has to call the function:
RET_T finishSdoRdInd(UNSIGNED8 sdoNr, RET_T returnValue) for SDO read requests or
RET_T finishSdoWrInd(UNSIGNED8 sdoNr, RET_T returnValue) for SDO write requests
These Library functions generate the SDO response message or an Abort SDO Transfer depending on the returnValue.
The picture shows the flow for a SDO write request:
Please note that the SDO timeout on the SDO client has to suit to the delayed SDO transfer.
The application must go on with calling the function FlushMbox() early enough between the SDO request and the SDO response to handle the time-dependet communication services.