|
Firmware Limitations: |
RMC200: 1.25.0 or newer |
|
Hardware Limitations: |
Requires an EtherCAT MainDevice module |
See the Commands Overview topic for basic command information and how to issue commands from PLCs, HMIs, etc.
Command Parameters
|
# |
Parameter Description |
Range |
|---|---|---|
|
1 |
SubDevice The Station Address of the SubDevice. |
A valid integer between 0 and 65,535 |
|
2 |
Object Index The address of the object in the SubDevice. This integer value represents both the Object Index and Object Subindex. See Object Index below. |
A valid integer between 1,048,576 (16#100000) and 16,777,215 (16#FFFFFF) |
|
3 |
Object Data Type Specifies the type of data being read. |
See Supported Object Data Types below |
|
4 |
Destination Address of destination register within the Variable Table. |
Valid Variable Table address |
|
5 |
Status Register Address of a DWORD variable in the Variable Table, which the RMC will update with the status of the CoE SDO Read. |
Valid Variable Table address |
Description
This command allows the user to read data from an EtherCAT SubDevice, using an SDO (Service Data Object) read. An SDO read transfers data only when specifically requested, as compared to a PDO that transfers data continuously. For writing to an EtherCAT SubDevice via SDO, see EtherCAT CoE SDO Write (124).
Timing Considerations
A CoE SDO Read takes multiple loop times to complete. Therefore, it is important to verify that the read is complete before attempting to act on the received data. To verify the data is complete, check bit zero in the variable specified by the Status Register command parameter.
In the example user program below, the command reads object 0x6072 (with subindex zero) from SubDevice 1001 and places it into the variable MyDestVar. The DWORD variable MyStatusVar is used as the Status Register. The Wait For Link Type waits for bit 0 of MyStatusVar to be true, which indicates that the read completed successfully, before continuing to the next user program step.
See Error Handling below for user program examples for handling errors.
Object Index
The Object Index command parameter specifies the address of the object to read from and includes both the Index and Subindex of the object. The Index and Subindex are listed in the CoE Object Dictionary for each object in an EtherCAT SubDevice.
The Object Index command parameter is typically entered in hexadecimal form, using either 16# or 0x as the prefix, followed by 6 hexadecimal characters, for example 16#607B01. The lowest two (rightmost) characters represent the SubIndex (1 byte), and the next four characters represent the Index (2 bytes). If represented as a 32-bit hexadecimal value, the left two characters (1 byte) must be zero, for example 16#00607B01.
Example 1:
In the CoE Object Dictionary section given below, the object Max Torque has an Index value of 0x6072 and no Subindex, which means the Subindex is zero (0x00). Therefore, the Object Index command parameter is 16#607200.
Example 2:
In the CoE Object Dictionary section given below, the object Proportional gain for velocity loop has an Index value of 0x2381 and a Subindex value of 0x01. Therefore, the Object Index command parameter is 16#238101.
More Examples:
The following Index and SubIndex values from the CoE Object Dictionary yield the Object Index command parameter value.
|
CoE Index |
0x7000 |
0x6061 |
0x1705 |
|
CoE Subindex |
0x10 |
0x00 |
0x0A |
|
Object Index Command Value |
16#700010 |
16#606100 |
16#17050A |
Note: In the CoE Object Dictionary, the SubIndex is given as both a decimal and hexadecimal (0xnn) value. Make sure to use the hexadecimal value when entering this command parameter as a hexadecimal value.
Object Data Types
The Object Data Type command parameter should be set to the data type of the object in the SubDevice. The table below lists the supported data types of objects in the SubDevice and which Variable Table data types they can be read into. It also explains how the data will be applied to the destination variable.
In general, object data of less than 32 bits is placed in the lower bits of the destination variable, and if the object data type is signed, it will be sign-extended. 64-bit REAL will be cast to a 32-bit REAL which can result in a loss of precision. Other 64-bit integer data types are spread across two destination variables.
Reading arrays from a SubDevice is not supported.
Supported Object Data Types
The Variable Table data types DINT and DWORD can be interchanged depending on use case.
|
Value |
Object Data Type |
Bit Length |
Supported Variable Table Data Type |
Notes |
|---|---|---|---|---|
|
1 |
BOOL |
1 |
DWORD |
Maps to bit zero of the variable. |
|
2 |
SINT |
8 |
DINT |
Will sign extend high bits. |
|
3 |
INT |
16 |
DINT |
SDO read from INT to DINT will sign extend high bits. |
|
4 |
DINT |
32 |
DINT |
Maps directly. |
|
5 |
USINT |
8 |
DINT |
Maps to the low 8 bits of the variable. |
|
6 |
UINT |
16 |
DINT |
Maps to the low 16 bits of the variable. |
|
7 |
UDINT |
32 |
DINT |
Maps directly. |
|
8 |
REAL |
32 |
REAL |
Maps directly. |
|
17 |
LREAL |
64 |
REAL |
A read from an LREAL (64-bit) object to a REAL (32 bits) variable will have resolution loss. |
|
21 |
LINT |
64 |
DWORD |
Will use 2 consecutive variables in the Variable Table. The low 32 bits of the LINT will be applied to the destination variable, and the high 32 bits will be applied to the next variable. |
|
27 |
ULINT |
64 |
DWORD |
Will use 2 consecutive variables in the Variable Table. The low 32 bits of the ULINT will be applied to the destination variable, and the high 32 bits will be applied to the next variable. |
|
30 |
BYTE |
8 |
DWORD |
Maps to the low 8 bits of the variable. |
|
31 |
WORD |
16 |
DWORD |
Maps to the low 16 bits of the variable. |
|
32 |
DWORD |
32 |
DWORD |
Maps directly. |
Status Register
Select a DWORD variable in the Variable Table to act as a status register for this command. The following table describes the status bits that are returned into the variable specified by the Status Register after sending this command. After sending a read command, either the Done bit or Error bit will be set. If the Error bit is set, bits 2-12 indicate the specific error that occurred. The Event Log reports any errors that occur.
|
Status Register |
Name |
Description |
|---|---|---|
|
Bit 0 |
Done bit |
Set to Off when command is issued. Set to On when the command completes successfully. |
|
Bit 1 |
Error bit |
Set to Off when command is issued. Set to On when an error condition occurs. |
|
Bit 2 |
Invalid command parameter |
Valid command parameters are: Station Address must be between 1 and 65535 (inclusive). Object Index must be between 0x100000 and 0xFFFFFF. Data Type must be in the supported value list. Source or Destination must be a variable table address. The Status Register must be a variable table address. |
|
Bit 3 |
SubDevice was not found |
The object address must be a SubDevice on the network. |
|
Bit 4 |
Object index is invalid |
The Index portion of the Object Index command parameter must be valid for the SubDevice. |
|
Bit 5 |
Object subindex is invalid |
The Subindex portion of the Object Index command parameter must be valid for the SubDevice. |
|
Bit 6 |
Object data type length mismatch |
The Object Data Type command parameter length must match the length of the object in the SubDevice. |
|
Bit 7 |
Object access type is write-only |
Object must have a read access type for read commands. |
|
Bit 8 |
Object access type is read-only |
Object must have a write access type for write commands. |
|
Bit 9 |
Object data value is invalid |
Some Objects have limited allowed values during write. |
|
Bit 10 |
CoE SDO request timed out |
This error can occur if the SubDevice goes offline during a request. |
|
Bit 11 |
CoE SDO request queue is full |
This error can occur if issuing a large number of requests to the same SubDevice. |
|
Bit 12 |
EtherCAT network is not ready |
This error can occur when the EtherCAT network is restarting. |
Error Handling
A CoE SDO Read may succeed or fail. If it succeeds, bit 0 (Done) of the variable specified by the Status Register parameter will be set. If it fails, bit 1 (Error) of the variable specified by the Status Register parameter will be set and bits 2-12 will indicated the specific error that occurred.
To check both the Done and Error bits, and take action based on which is set, use the Conditional Jump link type in a user program.
For example, the user program below uses the EtherCAT CoE SDO Read (123) command to read object 0x607B, subindex 1 from SubDevice 1001 and places it into the variable MyDestVar. The DWORD variable MyStatusVar is used as the Status Register. In the Conditional Jump Link Type, the first condition waits for bit 0 of MyStatusVar to be true, which indicates that the read completed successfully. The second condition waits for bit 1 of MyStatusVar, which indicates that the read failed. Each of the conditions jumps to a specific step, which should take the proper actions.
See Also
EtherCAT CoE SDO Write (124) | EtherCAT SDO | EtherCAT Overview
Copyright © 2026 Delta Computer Systems, Inc. dba Delta Motion