CANopen Master Documentation
Version 6.06.04
Loading...
Searching...
No Matches
com_usdo_cln.h File Reference

Detailed Description

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.

+ Include dependency graph for com_usdo_cln.h:

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)
 

Enumeration Type Documentation

◆ ComUsdoStat_e

USDO transfer status.

The enumeration defines the status of a USDO client connection. It can be requested with the ComUsdoGetStatus() function.

Enumerator
eCOM_USDO_STAT_EMPTY 

USDO client is free, no USDO communication present

eCOM_USDO_STAT_EXP_RD 

Expedited transfer in progress (read)

eCOM_USDO_STAT_SEG_RD 

Segmented transfer in progress (read)

eCOM_USDO_STAT_BLK_RD 

Bulk transfer in progress (read)

eCOM_USDO_STAT_EXP_WR 

Expedited transfer in progress (write)

eCOM_USDO_STAT_SEG_WR 

Segmented transfer in progress (write)

eCOM_USDO_STAT_BLK_WR 

Block transfer in progress (write)

eCOM_USDO_STAT_SUCCESS 

USDO communication success

eCOM_USDO_STAT_ABORT 

USDO communication aborted

eCOM_USDO_STAT_TIMEOUT 

USDO communication timeout

eCOM_USDO_STAT_ERR 

USDO protocol error

eCOM_USDO_STAT_SIZE 

Data size for client/server does not match

Function Documentation

◆ ComUsdoGetClient()

uint8_t ComUsdoGetClient ( uint8_t  ubNetV)
Parameters
[in]ubNetVCANopen Network channel
Returns
USDO client index

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.

◆ ComUsdoGetStatus()

ComStatus_tv ComUsdoGetStatus ( uint8_t  ubNetV,
uint8_t  ubClientV 
)
Parameters
[in]ubNetVCANopen Network channel
[in]ubClientVUSDO client index
Returns
Value of enumeration ComErr_e

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.

◆ ComUsdoReadObject()

ComStatus_tv ComUsdoReadObject ( uint8_t  ubNetV,
uint8_t  ubClientV,
uint8_t  ubNodeIdV,
CoObject_ts ptsCoObjV,
uint32_t *  pulObjCntV 
)
Parameters
[in]ubNetVCANopen Network channel
[in]ubClientVUSDO client index
[in]ubNodeIdVnode-ID value
[in]ptsCoObjVPointer to object structure
[in,out]pulObjCntVPointer to variable for object count
Returns
Value of enumeration ComErr_e
See also
ComUsdoWriteObject()

This function will start the read request for an object that is defined by the structure CoObject_ts.

◆ ComUsdoSetTimeout()

ComStatus_tv ComUsdoSetTimeout ( uint8_t  ubNetV,
uint8_t  ubClientV,
uint16_t  uwTimeV 
)
Parameters
[in]ubNetVCANopen Network channel
[in]ubClientVUSDO client index
[in]uwTimeVtimeout value in milliseconds
Returns
Value of enumeration ComErr_e

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).

◆ ComUsdoWriteObject()

ComStatus_tv ComUsdoWriteObject ( uint8_t  ubNetV,
uint8_t  ubClientV,
uint8_t  ubNodeIdV,
CoObject_ts ptsCoObjV,
uint32_t *  pulObjCntV 
)
Parameters
[in]ubNetVCANopen Network channel
[in]ubClientVUSDO client index
[in]ubNodeIdVnode-ID value
[in]ptsCoObjVPointer to object structure
[in,out]pulObjCntVPointer to variable for object count
Returns
Value of enumeration ComErr_e
See also
ComUsdoReadObject()

This function will start the write request for an object that is defined by the structure CoObject_ts.