EtherCAT.Register (yaethercat v0.1.0)

Copy Markdown View Source

The registers of an EtherCAT SubDevice controller (ESC) that this library uses, by the names ETG.1000.4 clause 6 gives them, and the layout of the sync manager and FMMU entities.

RegisterAddress
DL information: type, revision, build, FMMUs, sync managers, RAM, ports, features0x0000 to 0x0009
Configured station address0x0010
Configured station alias0x0012
DL control0x0100
Loop control, DL control's second byte0x0101
DL status0x0110
AL control0x0120
AL status0x0130
AL status code0x0134
RX error counters0x0300
Lost link counters0x0310
Watchdog divider0x0400
DLS-user watchdog0x0410
Sync manager watchdog0x0420
Sync manager watchdog status0x0440
SII access, control and status, address, data0x0500, 0x0502, 0x0504, 0x0508
FMMU entities, 16 bytes each0x0600
Sync manager channels, 8 bytes each0x0800

The AL registers are the "DLS-user R1" to "R6" of ETG.1000.4, which ETG.1000.6 names.

Summary

Functions

AL control, R1: the state requested.

AL status, R3: the state, and whether the last change failed.

AL status code, R6: why it failed.

DL control: forwarding and loop control of each port.

DL information: the ESC's type, revision, build, FMMUs, sync managers, RAM and features.

DL status: link, loop and signal of each port.

DLS-user watchdog, in units of the divider.

FMMU entity n.

An FMMU entity: length bytes of logical memory at logical, from bit start_bit of its first byte to bit end_bit of its last, mapped to the physical memory at physical from bit physical_bit, for reading, writing or both.

Loop control, the second byte of DL control: two bits for each port, from port 0 up. 0 is Auto, a port closed while it has no link and open while it has; 1 Auto close, closed when its link goes and opened again by a frame that comes in at it; 2 always open; 3 always closed.

Lost link counters of the four ports.

RX error counters of the four ports.

SII access: who owns the SII.

SII address, in words.

SII control/status.

SII data.

Configured station address.

Configured station alias, loaded from SII word 4.

Sync manager channel n.

A sync manager channel: its area of physical memory, its control byte and whether it's enabled. The status byte is not written, as it's the SubDevice's.

The control byte of a sync manager channel: buffered (three buffers) or mailbox, written or read by the MainDevice, and whether the sync manager watchdog watches it.

Sync manager watchdog, in units of the divider; 0 turns it off.

Sync manager watchdog status.

Watchdog divider, in 40 ns steps: the unit of the watchdogs, 100 µs by default.

Functions

al_control()

AL control, R1: the state requested.

al_status()

AL status, R3: the state, and whether the last change failed.

al_status_code()

AL status code, R6: why it failed.

dl_control()

DL control: forwarding and loop control of each port.

dl_information()

DL information: the ESC's type, revision, build, FMMUs, sync managers, RAM and features.

dl_status()

DL status: link, loop and signal of each port.

dls_user_watchdog()

DLS-user watchdog, in units of the divider.

fmmu(n)

FMMU entity n.

fmmu_entity(opts)

@spec fmmu_entity(keyword()) :: <<_::128>>

An FMMU entity: length bytes of logical memory at logical, from bit start_bit of its first byte to bit end_bit of its last, mapped to the physical memory at physical from bit physical_bit, for reading, writing or both.

loop_control()

Loop control, the second byte of DL control: two bits for each port, from port 0 up. 0 is Auto, a port closed while it has no link and open while it has; 1 Auto close, closed when its link goes and opened again by a frame that comes in at it; 2 always open; 3 always closed.

rx_error_counter()

RX error counters of the four ports.

sii_access()

SII access: who owns the SII.

sii_address()

SII address, in words.

sii_control()

SII control/status.

sii_data()

SII data.

station_address()

Configured station address.

station_alias()

Configured station alias, loaded from SII word 4.

sync_manager(n)

Sync manager channel n.

sync_manager_channel(start, length, control, enable)

@spec sync_manager_channel(0..65535, 0..65535, byte(), boolean()) :: <<_::64>>

A sync manager channel: its area of physical memory, its control byte and whether it's enabled. The status byte is not written, as it's the SubDevice's.

sync_manager_control(mode, direction, opts \\ [])

@spec sync_manager_control(:buffered | :mailbox, :write | :read, keyword()) :: byte()

The control byte of a sync manager channel: buffered (three buffers) or mailbox, written or read by the MainDevice, and whether the sync manager watchdog watches it.

sync_manager_watchdog()

Sync manager watchdog, in units of the divider; 0 turns it off.

sync_manager_watchdog_status()

Sync manager watchdog status.

watchdog_divider()

Watchdog divider, in 40 ns steps: the unit of the watchdogs, 100 µs by default.