ReferenceDriverEthercatWrite Task

EtherCAT Write Task

Learn how to send commands to EtherCAT devices with Synnax.

For task lifecycle management, see the Task Basics page.

How Commands Work

Write tasks use command and state channels:

  • Command channels (_cmd): Write values here to send commands to the device
  • State channels (_state): Reflect the current output state from the device
  • Command time channels (_cmd_time): Index channels storing command timestamps

When you write to a command channel, the task processes the command and sends it to the EtherCAT device. The state channel is updated with feedback from the device, providing acknowledgment that the command was executed.

Prerequisites

Before creating a write task, ensure you have:

  1. Configured EtherCAT devices discovered on your network.
  2. Identified the RxPDOs (output PDOs) you want to write to each device.

All channels in a task must use devices connected to the same network interface. Create separate tasks for devices on different EtherCAT networks.

Task Configuration Reference

ParameterTypeRequiredDefaultDescription
namestringYes-Human-readable task name
execution_ratenumberYes-Rate (Hz) at which commands are sent to hardware
state_ratenumberNo1Rate (Hz) at which state channels are updated
data_savingbooleanNofalseEnable permanent storage in Synnax
auto_startbooleanNofalseAutomatically start task after configuration
channelsarrayYes-List of output channel configurations

Channel Configuration Modes

EtherCAT write tasks support two channel configuration modes: Automatic and Manual. Automatic mode is recommended for most users.

In automatic mode, you select a device and RxPDO name. The system automatically resolves the CoE index, subindex, and data type from the device’s ESI information.

Automatic Output Channel

Writes data to an RxPDO using the PDO name for automatic configuration.

ParameterTypeRequiredDefaultDescription
typestringYes-Must be "automatic"
devicestringYes-Device key
pdostringYes-PDO name from device discovery (e.g., control_word)
cmd_channelnumberYes-Synnax command channel key
state_channelnumberYes-Synnax state channel key

When to use automatic mode:

  • Device has complete ESI information
  • PDO names are visible in the Console device properties
  • Standard device configurations

Manual Mode

In manual mode, you specify the CoE index, subindex, and data type directly. Use this mode when the ESI file is incomplete or when working with non-standard PDO mappings.

Manual Output Channel

Writes data to an RxPDO using explicit CoE addressing.

ParameterTypeRequiredDefaultDescription
typestringYes-Must be "manual"
devicestringYes-Device key
indexnumberYes-CoE object index (e.g., 0x6040)
subIndexnumberYes-CoE object subindex (typically 0)
bitLengthnumberYes-Data width in bits (8, 16, 32, 64)
dataTypestringYes-Synnax data type (uint8, int16, float32, etc.)
cmd_channelnumberYes-Synnax command channel key
state_channelnumberYes-Synnax state channel key

When to use manual mode:

  • ESI file is incomplete or missing PDO definitions
  • Custom PDO mappings configured on the device
  • Non-standard devices
  • Accessing vendor-specific objects

Common servo drive RxPDO objects include control word (0x6040), target position (0x607A), and target velocity (0x60FF).

Important Rules

  • Network constraint -> All channels must use devices from the same network interface.
  • Command/State pairs -> Each output requires both a command and state channel.
  • State rate -> Higher state rates provide faster feedback but increase network load. Typically 10-50 Hz is sufficient.
  • Execution rate -> Determines how frequently commands are sent to hardware. Higher rates provide more responsive control.
  • One running task per channel -> A channel can only send commands to one task at a time.

How-To

Console

Python

TypeScript