SDO_READ_DATA (FB)¶
FUNCTION_BLOCK SDO_READ_DATA EXTENDS CiA405Base
This function block is used for reading a specific object from object dictionary of a DEVICE.
If object can be read without error CONFIRM becomes TRUE and DATA contains read data in Little Endian byte order.
If an error occurs ERROR becomes unequal 0. In case of a SDO abort ERROR is set to CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_OTHER_ERROR
and ERRORINFO contains the associated abort code (in Little endian) as defined by CiA 301.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
NETWORKUSINT1
CAN network number the function block should operate on. Note: It is not the same like the network number in CANBus configurator. The CiA405
NETWORKis calculated by NetID + 1. Example: 1 = CAN0, 2 = CAN1, 3 = CAN2, …CiA405Base
ENABLEBOOLFALSE
Enables the function block on rising edge. Aborts operation on falling edge.
CiA405Base
TIMEOUTUDINT0
Timeout in ms; 0 means no timeout
CiA405Base
Output
CONFIRMBOOLFALSE
TRUE: function block finished without errorCiA405Base
ERRORCANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR
Error code: see CANOPEN_KERNEL_ERROR for further details
CiA405Base
Input
DEVICENodeID of destination device; 0 means local device (= CANopenManager)
CHANNELUSINT1
SDO channel: 0: use any free channel; 1..n: specific channel
INDEXWORDIndex of object
SUBINDEXBYTESubIndex of object
MODESDO_MODE.AUTO
specifies the SDO Mode to be used
DATAPOINTER TO BYTE
Pointer to memory the data should be written to. Data is written in CANopen Byte Order (= Little Endian).
Inout
DATALENGTHUDINTVAR_IN: Number of bytes
DATAis pointing to. VAR_OUT: Amount of data bytes written toDATAOutput
ERRORINFOcontains abort code in little endian in case of
ERRORis CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_OTHER_ERROR