Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NEWLrcmFromUint16 ¶
func NEWLrcmFromUint16(l uint16) lrcm
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.
Types ¶
type EcatDatagram ¶
type EcatDatagram struct { Command command.EcatCommand // 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 []byte // 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.
func (EcatDatagram) Bytes ¶
func (e EcatDatagram) Bytes() []byte
Bytes returns the byte representation of the EtherCAT datagram.
Returns:
- []byte: The byte representation of the EtherCAT datagram.
Click to show internal directories.
Click to hide internal directories.