Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datagram ¶
type Datagram struct { Command command.Type // EtherCAT Command Type Index uint8 // The index is a numeric identifier used by the master for identification of duplicates/lost datagrams. It shall not be changed by EtherCAT slaves Address uint32 // Address (Auto Increment, Configured Station Address, or Logical Address) LRCM Lrcm // LRCM represents the Len, R, C, M fields in the EtherCAT Datagram header. IRQ uint16 // EtherCAT Event Request registers of all slaves combined with a logical OR Data payload.MarshalerByte // Read/Write Data WKC uint16 // Working Counter }
EcatDatagram represents an EtherCAT datagram.
It contains various fields including the EtherCAT command type, index, address, LRCM (Length, Reserved, Circulating Frame, More EtherCAT Data), IRQ (EtherCAT Event Request registers of all slaves combined with a logical OR), data for read/write operations, and the working counter.
type Lrcm ¶
type Lrcm struct { M bool // M: 1 bit (More EtherCAT Data) C bool // C: 1 bit (Circulating Frame) R uint16 // R: 3 bit (Reserved) Len uint16 // Len: 11 bits (Paylod Length) }
Lrcm represents the Len, R, C, M fields in the EtherCAT Datagram header.
----------------- LRCM ---------------------
| M: 1bit | C: 1bit | R: 3bit | Len: 11bit |
--------------------------------------------
func NEWLrcmFromUint16 ¶
NEWLrcmFromUint16 creates an Lrcm instance from a uint16 value.
Parameters:
- l: The uint16 value representing Lrcm fields.
Returns:
- Lrcm: New Lrcm instance
func NewLrcm ¶
NewLrcm creates a new Lrcm instance with the specified values for M, C, and Len.
Parameters:
- m: More EtherCAT Data field (1 bit, {0: last, 1: more})
- c: Circulating Frame field (1 bit, {0: not, 1: circulating})
- len: Payload Length field (11 bits, valid values: 0 to 2047)
Returns:
- Lrcm: New Lrcm instance
- error: An error is returned if the provided values are out of valid range.