EtherCAT.Slave.Config (ethercat v0.4.2)

Copy Markdown View Source

Declarative configuration struct for a Slave.

Fields:

  • :name (required) — atom identifying this slave
  • :driver — module implementing EtherCAT.Slave.Driver, defaults to EtherCAT.Slave.Driver.Default
  • :config — driver-specific configuration map, default %{}
  • :process_data — one of:
    • :none — do not auto-register process data
    • {:all, domain_id} — register all signal names from the driver's signal_model/1 against one domain
    • [{signal_name, domain_id}] — explicit signal-to-domain assignments
  • :target_state — desired startup target for this slave:
    • :op — master will advance it to cyclic operation
    • :preop — master will leave it in PREOP for manual configuration
  • :sync — optional %EtherCAT.Slave.Sync.Config{} describing slave-local SYNC0/SYNC1 and latch intent
  • :health_poll_ms — interval in milliseconds to poll AL Status after reaching :op. When set, the slave periodically reads register 0x0130 and emits a [:ethercat, :slave, :health, :fault] telemetry event if the slave has faulted or dropped out of Op. Defaults to 250; set it to nil to disable polling.

Summary

Types

process_data_request()

@type process_data_request() :: :none | {:all, atom()} | [{atom(), atom()}]

t()

@type t() :: %EtherCAT.Slave.Config{
  config: map(),
  driver: module(),
  health_poll_ms: pos_integer() | nil,
  name: atom(),
  process_data: process_data_request(),
  sync: EtherCAT.Slave.Sync.Config.t() | nil,
  target_state: target_state()
}

target_state()

@type target_state() :: :preop | :op

Functions

default_health_poll_ms()

@spec default_health_poll_ms() :: pos_integer()