CANopen Master Documentation
Version 6.06.04
|
With Service Data Objects (SDOs) the access to entries of a device Object Dictionary is provided. As these entries may contain data of arbitrary size and data type SDOs can be used to transfer multiple data sets (each containing an arbitrary large block of data) from a client to a server and vice versa. The client can control via a multiplexor (index and sub-index of the Object Dictionary) which data set is to be transferred. The contents of the data set are defined within the Object Dictionary (see com_dict.h).
The functions in this module are called by the CANopen master stack on reception of a SDO request.
Functions | |
uint32_t | ComSdoSrvBlkUpObjectSize (uint8_t ubNetV, uint16_t uwIndexV, uint8_t ubSubIndexV) |
void | ComSdoSrvCopyValueToMessage (uint8_t ubNetV, void *pvdValueV, uint8_t ubDataTypeV) |
void | ComSdoSrvCopyMessageToValue (uint8_t ubNetV, void *pvdValueV, uint8_t ubDataTypeV) |
void | ComSdoSrvSegSetup (uint8_t ubNetV, void *pvdDataV, uint32_t ulSizeV) |
uint32_t ComSdoSrvBlkUpObjectSize | ( | uint8_t | ubNetV, |
uint16_t | uwIndexV, | ||
uint8_t | ubSubIndexV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | uwIndexV | Object index value |
[in] | ubSubIndexV | Object sub-index value |
This function is called by the ComSdoSrvBlkUpInit() function in order to determine the size (in bytes) of the object to be uploaded using a SDO block transfer.
The action on this function is application specific. The function body is placed inside the file com_user.c
.
void ComSdoSrvCopyMessageToValue | ( | uint8_t | ubNetV, |
void * | pvdValueV, | ||
uint8_t | ubDataTypeV | ||
) |
Copy data field from SDO message into value.
[in] | ubNetV | CANopen Network channel |
[out] | pvdValueV | Pointer to value |
[in] | ubDataTypeV | Defines the value data type |
This function copies the SDO data field into the location defined by pvdValueV. Depending on the data type the byte order is assigned according to CiA 301.
void ComSdoSrvCopyValueToMessage | ( | uint8_t | ubNetV, |
void * | pvdValueV, | ||
uint8_t | ubDataTypeV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | pvdValueV | Pointer to value |
[in] | ubDataTypeV | Defines the value data type |
This function copies the given value into the data field of a SDO message. Depending on the data type the byte order is assigned according to CiA 301.
void ComSdoSrvSegSetup | ( | uint8_t | ubNetV, |
void * | pvdDataV, | ||
uint32_t | ulSizeV | ||
) |
Initialise segmented data transfer.
ubNetV | Number of corresponding network |
pvdDataV | Pointer to data |
ulSizeV | Size of data be transferred |
This function is used to initialise the Segmented SDO data transfer.