WARNING: This function cannot be used in a task if the co_robj()/co_wobj()/coe_robj()/coe_wobj() functions are also present in the task.
This function is used to send an SDO (Service Data Object) message to the specified workstation in order to write/read an object from the object dictionary.
•In case of write -> co_send_sdo(nWs, nObj, nSub): the co_asw_sdo() function is then used to check if the write was successful
•In case of read -> co_send_sdo(nWs, nObj, nSub, type, data): the co_asw_sdo() function is then used to check if the read request was successful and to download the data
Syntax |
i32 co_send_sdo (i32 nWs, i32 nObj, i32 nSub) i32 co_send_sdo (i32 nWs, i32 nObj, i32 nSub, i32 type, real data) |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
nWs |
Robox station ID (logical workstation 1-:-64) |
||||||||||||
nObj |
Dictionary object code (see dictionary - eds file) |
||||||||||||
nSub |
Sub index code (see dictionary - eds file). In case of EtherCAT (SoE) see below |
||||||||||||
type |
Allows you to select how to transform the data to be written contained in data into the type requested by the connected device.
|
||||||||||||
data |
Value to transform (from real to FIX format of size specified in type) |
||||||||||||
Result |
Returns:
|
||||||||||||
Validity |
Rule, Task |
||||||||||||
Note |
Avoid, if the statement is used within a function, declaring local handles to the function itself. From RTE 34.13.5, the functions co_robj() and co_wobj() are available |
Example of use:
|