CANopen Master Documentation
Version 6.06.04
|
USDO services are intended for configuration and diagnostic tasks in CANopen FD systems. Nevertheless process data can be transferred via USDO services as well. The USDO service offers confirmed communication between one USDO client and one or several USDO servers. By means of the USDO protocol the USDO client has access to CANopen FD object dictionary entries supported in the CANopen FD devices in the network. The USDO services provide read and write access to sub-indexes in the USDO servers’ object dictionary (see com_dict.h).
USDO services allow the transfer of any data size between the USDO client and the USDO server. The inherent routing capability of the USDO services enables data transfer over CANopen FD network borders; USDO client and USDO server are not necessarily connected to the same CAN.
The communication timeout between USDO client request and USDO server response is device/application specific. The initial USDO communication timeout for the client is set to 50 milliseconds. The connection timeout value can be change with the ComUsdoSetTimeout() function.
Enumerations | |
enum | ComUsdoStat_e { eCOM_USDO_STAT_EMPTY = 0 , eCOM_USDO_STAT_EXP_RD = 1 , eCOM_USDO_STAT_SEG_RD = 2 , eCOM_USDO_STAT_BLK_RD = 3 , eCOM_USDO_STAT_EXP_WR = 4 , eCOM_USDO_STAT_SEG_WR = 5 , eCOM_USDO_STAT_BLK_WR = 6 , eCOM_USDO_STAT_SUCCESS = 7 , eCOM_USDO_STAT_ABORT = 8 , eCOM_USDO_STAT_TIMEOUT = 9 , eCOM_USDO_STAT_ERR = 10 , eCOM_USDO_STAT_SIZE = 11 } |
Functions | |
uint8_t | ComUsdoGetClient (uint8_t ubNetV) |
ComStatus_tv | ComUsdoGetStatus (uint8_t ubNetV, uint8_t ubClientV) |
ComStatus_tv | ComUsdoReadObject (uint8_t ubNetV, uint8_t ubClientV, uint8_t ubNodeIdV, CoObject_ts *ptsCoObjV, uint32_t *pulObjCntV) |
ComStatus_tv | ComUsdoSetTimeout (uint8_t ubNetV, uint8_t ubClientV, uint16_t uwTimeV) |
ComStatus_tv | ComUsdoWriteObject (uint8_t ubNetV, uint8_t ubClientV, uint8_t ubNodeIdV, CoObject_ts *ptsCoObjV, uint32_t *pulObjCntV) |
enum ComUsdoStat_e |
USDO transfer status.
The enumeration defines the status of a USDO client connection. It can be requested with the ComUsdoGetStatus() function.
uint8_t ComUsdoGetClient | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | CANopen Network channel |
This function returns the index of an available USDO client. If no SDO client is free, the function will return the value COM_USDO_CLIENT_MAX.
ComStatus_tv ComUsdoGetStatus | ( | uint8_t | ubNetV, |
uint8_t | ubClientV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubClientV | USDO client index |
This function returns the status of a USDO transmission for the USDO client connection given by its index ubClientV
. A negative return value indicates an error. The error values are taken from the ComErr_e enumeration. The return value eCOM_USDO_STAT_EMPTY indicates that the USDO client is available for a read/write operation. Positive return values (see ComUsdoStat_e) indicate the status of a USDO client in use.
ComStatus_tv ComUsdoReadObject | ( | uint8_t | ubNetV, |
uint8_t | ubClientV, | ||
uint8_t | ubNodeIdV, | ||
CoObject_ts * | ptsCoObjV, | ||
uint32_t * | pulObjCntV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubClientV | USDO client index |
[in] | ubNodeIdV | node-ID value |
[in] | ptsCoObjV | Pointer to object structure |
[in,out] | pulObjCntV | Pointer to variable for object count |
This function will start the read request for an object that is defined by the structure CoObject_ts.
ComStatus_tv ComUsdoSetTimeout | ( | uint8_t | ubNetV, |
uint8_t | ubClientV, | ||
uint16_t | uwTimeV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubClientV | USDO client index |
[in] | uwTimeV | timeout value in milliseconds |
This function sets a timeout value for a USDO communication. If the response to a USDO request takes longer than the configured timeout value, the state of the communication will be changed to eCOM_USDO_STAT_TIMEOUT. The state of the USDO communication can be evaluated by calling the function ComUsdoGetStatus(). Please note that the timeout value is passed in multiples of 1 millisecond. The timeout value supplied to this function will be rounded towards the next lower value if necessary (depends on timer granularity).
ComStatus_tv ComUsdoWriteObject | ( | uint8_t | ubNetV, |
uint8_t | ubClientV, | ||
uint8_t | ubNodeIdV, | ||
CoObject_ts * | ptsCoObjV, | ||
uint32_t * | pulObjCntV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubClientV | USDO client index |
[in] | ubNodeIdV | node-ID value |
[in] | ptsCoObjV | Pointer to object structure |
[in,out] | pulObjCntV | Pointer to variable for object count |
This function will start the write request for an object that is defined by the structure CoObject_ts.