ReferenceDevice driversEtherCATWrite 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

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

Channel configuration

Each channel writes one RxPDO entry at its CoE index and sub-index. The Driver gets the size of the entry from the device, so the data type of the channel must be the same size.

Entry output channel

Writes one RxPDO entry.

Parameter Type Required Default Description
type string - Must be "entry"
device string - Device key
index number - CoE object index (e.g., 0x6040)
sub_index number - CoE object sub-index
data_type string - Synnax data type, the same size as the entry
cmd_channel number - Synnax command channel key
state_channel number 0 Synnax state channel key

The Console lists each entry the device reports, with its address. In code, find the address of an entry by name with ethercat.find_entry(dev, name, direction="output") in Python or ethercat.findEntry in TypeScript.

A task from an earlier release can hold an "unresolved" channel: one that named an entry the device does not have, or has more than once. Pick an entry for it in the Console before the task runs.

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 -> The bus cycles at least this fast. A higher rate sends new commands to the device sooner.
  • Stopping -> When the task stops, its outputs go to zero, unless another running write task commanded them. See how the Driver runs a network.

How-to

When you create channels with a client library, give each command channel its own index channel. A writer that holds several commands on one index must write all of them in every frame.