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

Description
This block is used to write objects of remote CANopen slaves via the SDO (service
data object) protocol. Use one block for each SDO you want to write.
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 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 write 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
-
Value
The value that should be written to the object in the remote slave
device. The port inherits the data type and the dimensions from the
connected sink block. 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
accepts the requested data length or indicates an error.
Data type: Fundamental data types
from boolean to double are supported as well as dimensions from scalar
values to 1D-arrays
Outputs
-
Status
A rising or falling edge indicates a completed write operation. Either
a response was received and data was written, or the Error output port provides an error
code.
If the Status output does not change,
the write operation is still in progress or the block is idle.
Data type: uint32
-
Error
Outputs either the error code of the overall write 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
-
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. |