IO643 - SDO Read
IO643 - SDO Read — Reads objects of remote CANopen
slave devices via the SDO (service data object) protocol.
Library
Simulink Real-Time - Speedgoat

Description
This block is used to read objects of remote CANopen slaves via the SDO (service
data object) protocol. Use one block for each object you want to read.
Reading and writing of objects is performed acyclically. Slave response times
vary. SDO read and write commands are executed one after another. The more SDO
blocks you place in your model the longer you will wait for responses from connected
slave devices.
![[Note]](images/note.png) | Note |
|---|
You need to add one (PDO) Receive block to your model and connect the output
to a terminator block, even if your application does not require PDO
communication and your model only contains SDO Read and Write blocks. |
Ports
Inputs
-
Enable
The block sends out read requests as long as the input port is
TRUE.
Best practice is to set the block's sample time to a higher rate (like
1 ms) and trigger the Enable input port
at a lower rate. This ensures low network traffic but immediate updates
of the output ports once a response is received.
Data type: boolean
Outputs
-
Value
Outputs the current value of the requested object. The data type and
dimensions are defined by the Init
Value parameter. The data type and dimensions need not
both match the data type and dimensions of the object in the remote
slave device. This depends on the implementation of the slave device,
and whether it sends the actual data length or indicates an error. The
block outputs the number of bytes received, or truncates the data if it
exceeds the port size.
Data type: Fundamental data types
from boolean to double are supported as well as dimensions from scalar
values to 1D-arrays
-
Status
A rising or falling edge indicates a completed read operation. Either
a response was received and the Value
output port was updated or the Error
output port provides an error code.
If the Status output does not change,
the read operation is still in progress or the block is idle.
Data type: uint32
-
Error
Outputs either the error code of the overall read operation or the
error code included in the response.
Data type: uint32
Parameters
-
Module ID
This ID defines the link to the corresponding Setup block
-
Remote CAN Node ID
The address of the remote slave in the CANopen network. Each slave has
a unique address between 1 and 127. The value must match the address of
the related slave in the network configuration of the master.
-
Object Index
Enter the index of the object in the slave's object dictionary. Valid
values are between 0x0000 and 0xFFFF
-
Object Sub-Index
Enter the sub-index of the object in the slave's object dictionary.
Valid values are between 0x00 and 0xFF
-
Init Value
The value that the Value port outputs
before a read response is received. The parameter's data type and
dimensions define the data type and dimensions of the Value output port and specify the length of
the requested data. Fundamental data types from boolean to double are
supported as well as 1D-arrays.
-
Sample Time
Defines the base sample time at which this driver block gets its sample hit. This
parameter can also be set to -1 for inherited
sample time. The units are in seconds.
![[Caution]](images/caution.png) | Caution |
|---|
All blocks that interface with the same I/O module must have identical
sample times. |