Control and Status Ports
Control Port
The realtime port ecat-control-port provides control commands as RPC services.
The following services are available:
Service |
Request |
Response |
Description |
|---|---|---|---|
|
- |
- |
Request a restart (in case of error) |
|
- |
Continue with error (recovery mode) |
|
|
|
- |
Request an EtherCAT state |
The following response codes may be returned by the services:
Code |
Name |
Description |
|---|---|---|
0 |
|
The request was successful. |
100 |
|
The requested EtherCAT Master state is invalid. |
101 |
|
The request is not possible/allowed in the current state. |
202 |
|
An unexpected error occurred in the service implementation. |
See State Machine for more details about the commands.
Status Port
The realtime port ecat-status-port provides current system and master status information as output variables. The following variables are available:
Name |
Type |
Description |
|---|---|---|
|
|
Current error number (0 = no error). |
|
|
Human-readable error message corresponding to |
|
|
Current EtherCAT master state (INIT, PREOP, …). |
|
|
Number of status port updates since startup. |
|
|
Cycle start timestamp in nanoseconds (since realtime-port timestamp clock epoch). |
|
|
Current system state. See State Machine for details. |
Note: the status port will always be updated last (after all PDO ports were updated) and will emit a notification in each cycle. Therefore the status port’s notifications can be used to synchronize user applications to the EtherCAT cycle.
SDO Port
The realtime port ecat-sdo-port provides acyclic SDO read/write access as RPC services.
Multiple read/write request can be processed concurrently. The responses will be buffered until polled.
The following services are available:
Service |
Request |
Response |
Description |
|---|---|---|---|
|
|
|
Start an SDO download |
|
|
|
Poll SDO download status |
|
|
|
Start an SDO upload |
|
|
|
Poll SDO upload status |
The request/response structs contain the following members:
StartSdoWriteRequest
Member |
Type |
Description |
|---|---|---|
|
|
Target slave index in the EtherCAT network. |
|
|
SDO object index. |
|
|
SDO object subindex. |
|
|
Request timeout in milliseconds. |
|
|
Number of payload bytes to write from |
|
|
Write payload buffer. |
StartSdoWriteResponse
Member |
Type |
Description |
|---|---|---|
|
|
Identifier of the started write request. |
PollSdoWriteRequest
Member |
Type |
Description |
|---|---|---|
|
|
Identifier returned by start call. |
PollSdoWriteResponse
Member |
Type |
Description |
|---|---|---|
|
|
True when the write request has finished. |
|
|
True when the write finished without SDO error. |
|
|
SDO abort code (valid when |
StartSdoReadRequest
Member |
Type |
Description |
|---|---|---|
|
|
Target slave index in the EtherCAT network. |
|
|
SDO object index. |
|
|
SDO object subindex. |
|
|
Maximum number of bytes to read. |
|
|
Request timeout in milliseconds. |
StartSdoReadResponse
Member |
Type |
Description |
|---|---|---|
|
|
Identifier of the started read request. |
PollSdoReadRequest
Member |
Type |
Description |
|---|---|---|
|
|
Identifier returned by start call. |
PollSdoReadResponse
Member |
Type |
Description |
|---|---|---|
|
|
True when the read request has finished. |
|
|
True when the read finished without SDO error. |
|
|
SDO abort code (valid when |
|
|
Number of valid bytes in |
|
|
Read payload buffer. |
The data array capacity is configured via the sdo-max-payload-size application option.
Note: the SDO port is updated from the acyclic EtherCAT thread (non-RT).