ReferenceDriverEthercatWrite Task

EtherCAT write task

Learn how to send commands to EtherCAT devices with Synnax.

This task follows the standard task lifecycle.

Before creating a write task, configure your EtherCAT devices and identify the RxPDOs (output PDOs) to write to each one. State channels carry feedback read back from the 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

Table

Parameter Type Required Default Description
execution_rate number No 1000 Rate (Hz) at which commands are sent to hardware
state_rate number No 25 Rate (Hz) at which state channels are updated
channels array Yes - List of output channel configurations

Channel configuration modes

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.

Table

Parameter Type Required Default Description
type string Yes - Must be "automatic"
device string Yes - Device key
pdo string Yes - PDO name from device discovery (e.g., control_word)
cmd_channel number Yes - Synnax command channel key
state_channel number Yes - 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.

Table

Parameter Type Required Default Description
type string Yes - Must be "manual"
device string Yes - Device key
index number Yes - CoE object index (e.g., 0x6040)
sub_index number Yes - CoE object subindex (typically 0)
bit_length number No 16 Data width in bits (8, 16, 32, 64)
data_type string No uint16 Synnax data type (uint8, int16, float32, etc.)
cmd_channel number Yes - Synnax command channel key
state_channel number Yes - 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.
  • 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.

How-to