Service Data Object (SDO)
[Communication Objects]

Collaboration diagram for Service Data Object (SDO):

Functions

UNS8 writeNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 count, UNS8 dataType, void *data)
 Used to send a SDO request frame to write the data at the index and subIndex indicated.
UNS8 writeNetworkDictCallBack (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback)
 Used to send a SDO request frame to write in a distant node dictionnary.
UNS8 writeNetworkDictCallBackAI (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize)
 Used to send a SDO request frame to write in a distant node dictionnary.
UNS8 readNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType)
 Used to send a SDO request frame to read.
UNS8 readNetworkDictCallback (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback)
 Used to send a SDO request frame to read in a distant node dictionnary.
UNS8 readNetworkDictCallbackAI (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback)
 Used to send a SDO request frame to read in a distant node dictionnary.
UNS8 getReadResultNetworkDict (CO_Data *d, UNS8 nodeId, void *data, UNS8 *size, UNS32 *abortCode)
 Use this function after calling readNetworkDict to get the result.
UNS8 getWriteResultNetworkDict (CO_Data *d, UNS8 nodeId, UNS32 *abortCode)
 Use this function after calling writeNetworkDict function to get the result of the write.

Detailed Description

SDOs provide the access to entries in the CANopen Object Dictionary. An SDO is made up of at least two CAN messages with different identifiers. SDO s are always confirmed point-to-point communications services.

Function Documentation

UNS8 getReadResultNetworkDict ( CO_Data d,
UNS8  nodeId,
void *  data,
UNS8 *  size,
UNS32 *  abortCode 
)

Use this function after calling readNetworkDict to get the result.

Parameters:
*d Pointer to a CAN object data structure
nodeId Node Id of the slave
*data Pointer to the datas
*size Pointer to the size
*abortCode Pointer to the abortcode. (0 = not available. Else : SDO abort code. (received if return SDO_ABORTED_RCV)
Returns:
  • SDO_FINISHED // datas are available
  • SDO_ABORTED_RCV // Transfert failed (abort SDO received)
  • SDO_ABORTED_INTERNAL // Transfert failed (internal abort)
  • SDO_UPLOAD_IN_PROGRESS // Datas are not yet available
  • SDO_DOWNLOAD_IN_PROGRESS // Download is in progress

    example :
     UNS32 data;
     UNS8 size;
     readNetworkDict(0, 0x05, 0x1016, 1, 0) // get the data index 1016 subindex 1 of node 5
     while (getReadResultNetworkDict (0, 0x05, &data, &size) != SDO_UPLOAD_IN_PROGRESS);
    

Definition at line 1532 of file sdo.c.

References getSDOlineOnUse(), and struct_CO_Data::transfers.

Here is the call graph for this function:

UNS8 getWriteResultNetworkDict ( CO_Data d,
UNS8  nodeId,
UNS32 *  abortCode 
)

Use this function after calling writeNetworkDict function to get the result of the write.

It is mandatory to call this function because it is releasing the line used for the transfer.

Parameters:
*d Pointer to a CAN object data structure
nodeId Node Id of the slave
*abortCode Pointer to the abortcode
  • 0 = not available.
  • SDO abort code (received if return SDO_ABORTED_RCV)
Returns:
:
  • SDO_FINISHED // datas are available
  • SDO_ABORTED_RCV // Transfert failed (abort SDO received)
  • SDO_ABORTED_INTERNAL // Transfert failed (Internal abort)
  • SDO_DOWNLOAD_IN_PROGRESS // Datas are not yet available
  • SDO_UPLOAD_IN_PROGRESS // Upload in progress

    example :
     UNS32 data = 0x50;
     UNS8 size;
     UNS32 abortCode;
     writeNetworkDict(0, 0x05, 0x1016, 1, size, &data) // write the data index 1016 subindex 1 of node 5
     while (getWriteResultNetworkDict (0, 0x05, &abortCode) != SDO_DOWNLOAD_IN_PROGRESS);
    

Definition at line 1567 of file sdo.c.

References getSDOlineOnUse(), and struct_CO_Data::transfers.

Here is the call graph for this function:

UNS8 readNetworkDict ( CO_Data d,
UNS8  nodeId,
UNS16  index,
UNS8  subIndex,
UNS8  dataType 
)

Used to send a SDO request frame to read.

Parameters:
*d Pointer to a CAN object data structure
nodeId Node Id of the slave
index At index indicated
subIndex At subIndex indicated
dataType (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value.
Returns:
  • 0 is returned upon success.
  • 0xFE is returned when no sdo client to communicate with node.
  • 0xFF is returned when error occurs.

Definition at line 1474 of file sdo.c.

UNS8 readNetworkDictCallback ( CO_Data d,
UNS8  nodeId,
UNS16  index,
UNS8  subIndex,
UNS8  dataType,
SDOCallback_t  Callback 
)

Used to send a SDO request frame to read in a distant node dictionnary.

The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort).

Parameters:
*d Pointer on a CAN object data structure
nodeId Node Id of the slave
index At index indicated
subIndex At subIndex indicated
dataType (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value.
Callback Callback function
Returns:
  • 0 is returned upon success.
  • 0xFE is returned when no sdo client to communicate with node.
  • 0xFF is returned when error occurs.

Definition at line 1479 of file sdo.c.

UNS8 readNetworkDictCallbackAI ( CO_Data d,
UNS8  nodeId,
UNS16  index,
UNS8  subIndex,
UNS8  dataType,
SDOCallback_t  Callback 
)

Used to send a SDO request frame to read in a distant node dictionnary.

The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort). First free SDO client parameter is automatically initialized for specific node if not already defined.

Parameters:
*d Pointer on a CAN object data structure
nodeId Node Id of the slave
index At index indicated
subIndex At subIndex indicated
dataType (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value.
Callback Callback function
Returns:
  • 0 is returned upon success.
  • 0xFF is returned when error occurs.

Definition at line 1484 of file sdo.c.

References struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, and struct_CO_Data::objdict.

UNS8 writeNetworkDict ( CO_Data d,
UNS8  nodeId,
UNS16  index,
UNS8  subIndex,
UNS8  count,
UNS8  dataType,
void *  data 
)

Used to send a SDO request frame to write the data at the index and subIndex indicated.

Parameters:
*d Pointer to a CAN object data structure
nodeId Node Id of the slave
index At index indicated
subIndex At subIndex indicated
count number of bytes to write in the dictionnary.
dataType (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value.
*data Pointer to data
Returns:
  • 0 is returned upon success.
  • 0xFE is returned when no sdo client to communicate with node.
  • 0xFF is returned when error occurs.

Definition at line 1331 of file sdo.c.

References _writeNetworkDict().

Here is the call graph for this function:

UNS8 writeNetworkDictCallBack ( CO_Data d,
UNS8  nodeId,
UNS16  index,
UNS8  subIndex,
UNS8  count,
UNS8  dataType,
void *  data,
SDOCallback_t  Callback 
)

Used to send a SDO request frame to write in a distant node dictionnary.

The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort).

Parameters:
*d Pointer to a CAN object data structure
nodeId Node Id of the slave
index At index indicated
subIndex At subIndex indicated
count number of bytes to write in the dictionnary.
dataType (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value.
*data Pointer to data
Callback Callback function
Returns:
  • 0 is returned upon success.
  • 0xFE is returned when no sdo client to communicate with node.
  • 0xFF is returned when error occurs.

Definition at line 1337 of file sdo.c.

References _writeNetworkDict().

Here is the call graph for this function:

UNS8 writeNetworkDictCallBackAI ( CO_Data d,
UNS8  nodeId,
UNS16  index,
UNS8  subIndex,
UNS8  count,
UNS8  dataType,
void *  data,
SDOCallback_t  Callback,
UNS8  endianize 
)

Used to send a SDO request frame to write in a distant node dictionnary.

The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort). First free SDO client parameter is automatically initialized for specific node if not already defined.

Parameters:
*d Pointer to a CAN object data structure
nodeId Node Id of the slave
index At index indicated
subIndex At subIndex indicated
count number of bytes to write in the dictionnary.
dataType (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value.
*data Pointer to data
Callback Callback function
endianize When not 0, data is endianized into network byte order when 0, data is not endianized and copied in machine native endianness
Returns:
  • 0 is returned upon success.
  • 0xFF is returned when error occurs.

Definition at line 1343 of file sdo.c.

References _writeNetworkDict(), struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, and struct_CO_Data::objdict.

Here is the call graph for this function:


Generated on Wed Feb 4 12:17:24 2009 for CanFestival by  doxygen 1.5.6