SOEM  v1.4.0
Data Structures | Macros | Typedefs | Enumerations
ethercattype.h File Reference

General typedefs and defines for EtherCAT. More...

#include "osal.h"

Data Structures

struct  ec_etherheadert
 
struct  ec_comt
 
struct  ec_errort
 

Macros

#define EC_VER1
 
#define EC_LITTLE_ENDIAN
 
#define EC_NOFRAME   -1
 
#define EC_OTHERFRAME   -2
 
#define EC_ERROR   -3
 
#define EC_SLAVECOUNTEXCEEDED   -4
 
#define EC_TIMEOUT   -5
 
#define EC_MAXECATFRAME   1518
 
#define EC_MAXLRWDATA   (EC_MAXECATFRAME - 14 - 2 - 10 - 2 - 4)
 
#define EC_FIRSTDCDATAGRAM   20
 
#define EC_BUFSIZE   EC_MAXECATFRAME
 
#define EC_ECATTYPE   0x1000
 
#define EC_MAXBUF   16
 
#define EC_TIMEOUTRET   2000
 
#define EC_TIMEOUTRET3   (EC_TIMEOUTRET * 3)
 
#define EC_TIMEOUTSAFE   20000
 
#define EC_TIMEOUTEEP   20000
 
#define EC_TIMEOUTTXM   20000
 
#define EC_TIMEOUTRXM   700000
 
#define EC_TIMEOUTSTATE   2000000
 
#define EC_MAXEEPBITMAP   128
 
#define EC_MAXEEPBUF   EC_MAXEEPBITMAP << 5
 
#define EC_DEFAULTRETRIES   3
 
#define EC_LOGGROUPOFFSET   16
 
#define ETH_HEADERSIZE   sizeof(ec_etherheadert)
 
#define EC_HEADERSIZE   sizeof(ec_comt)
 
#define EC_ELENGTHSIZE   sizeof(uint16)
 
#define EC_CMDOFFSET   EC_ELENGTHSIZE
 
#define EC_WKCSIZE   sizeof(uint16)
 
#define EC_DATAGRAMFOLLOWS   (1 << 15)
 
#define EC_ESTAT_R64   0x0040
 
#define EC_ESTAT_BUSY   0x8000
 
#define EC_ESTAT_EMASK   0x7800
 
#define EC_ESTAT_NACK   0x2000
 
#define ECT_SII_START   0x0040
 
#define ECT_SDO_SMCOMMTYPE   0x1c00
 
#define ECT_SDO_PDOASSIGN   0x1c10
 
#define ECT_SDO_RXPDOASSIGN   0x1c12
 
#define ECT_SDO_TXPDOASSIGN   0x1c13
 
#define ETH_P_ECAT   0x88A4
 
#define MK_WORD(msb, lsb)   ((((uint16)(msb))<<8) | (lsb))
 
#define HI_BYTE(w)   ((w) >> 8)
 
#define LO_BYTE(w)   ((w) & 0x00ff)
 
#define SWAP(w)   ((((w)& 0xff00) >> 8) | (((w) & 0x00ff) << 8))
 
#define LO_WORD(l)   ((l) & 0xffff)
 
#define HI_WORD(l)   ((l) >> 16)
 
#define get_unaligned(ptr)   ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
 
#define put_unaligned32(val, ptr)   (memcpy((ptr), &(val), 4))
 
#define put_unaligned64(val, ptr)   (memcpy((ptr), &(val), 8))
 
#define htoes(A)   (A)
 
#define htoel(A)   (A)
 
#define htoell(A)   (A)
 
#define etohs(A)   (A)
 
#define etohl(A)   (A)
 
#define etohll(A)   (A)
 

Typedefs

typedef uint8 ec_bufT[EC_BUFSIZE]
 

Enumerations

enum  ec_err {
  EC_ERR_OK = 0, EC_ERR_ALREADY_INITIALIZED, EC_ERR_NOT_INITIALIZED, EC_ERR_TIMEOUT,
  EC_ERR_NO_SLAVES, EC_ERR_NOK
}
 
enum  ec_state {
  EC_STATE_NONE = 0x00, EC_STATE_INIT = 0x01, EC_STATE_PRE_OP = 0x02, EC_STATE_BOOT = 0x03,
  EC_STATE_SAFE_OP = 0x04, EC_STATE_OPERATIONAL = 0x08, EC_STATE_ACK = 0x10, EC_STATE_ERROR = 0x10
}
 
enum  ec_bufstate {
  EC_BUF_EMPTY = 0x00, EC_BUF_ALLOC = 0x01, EC_BUF_TX = 0x02, EC_BUF_RCVD = 0x03,
  EC_BUF_COMPLETE = 0x04
}
 
enum  ec_datatype {
  ECT_BOOLEAN = 0x0001, ECT_INTEGER8 = 0x0002, ECT_INTEGER16 = 0x0003, ECT_INTEGER32 = 0x0004,
  ECT_UNSIGNED8 = 0x0005, ECT_UNSIGNED16 = 0x0006, ECT_UNSIGNED32 = 0x0007, ECT_REAL32 = 0x0008,
  ECT_VISIBLE_STRING = 0x0009, ECT_OCTET_STRING = 0x000A, ECT_UNICODE_STRING = 0x000B, ECT_TIME_OF_DAY = 0x000C,
  ECT_TIME_DIFFERENCE = 0x000D, ECT_DOMAIN = 0x000F, ECT_INTEGER24 = 0x0010, ECT_REAL64 = 0x0011,
  ECT_INTEGER64 = 0x0015, ECT_UNSIGNED24 = 0x0016, ECT_UNSIGNED64 = 0x001B, ECT_BIT1 = 0x0030,
  ECT_BIT2 = 0x0031, ECT_BIT3 = 0x0032, ECT_BIT4 = 0x0033, ECT_BIT5 = 0x0034,
  ECT_BIT6 = 0x0035, ECT_BIT7 = 0x0036, ECT_BIT8 = 0x0037
}
 
enum  ec_cmdtype {
  EC_CMD_NOP = 0x00, EC_CMD_APRD, EC_CMD_APWR, EC_CMD_APRW,
  EC_CMD_FPRD, EC_CMD_FPWR, EC_CMD_FPRW, EC_CMD_BRD,
  EC_CMD_BWR, EC_CMD_BRW, EC_CMD_LRD, EC_CMD_LWR,
  EC_CMD_LRW, EC_CMD_ARMW, EC_CMD_FRMW
}
 
enum  ec_ecmdtype { EC_ECMD_NOP = 0x0000, EC_ECMD_READ = 0x0100, EC_ECMD_WRITE = 0x0201, EC_ECMD_RELOAD = 0x0300 }
 
enum  {
  ECT_SII_STRING = 10, ECT_SII_GENERAL = 30, ECT_SII_FMMU = 40, ECT_SII_SM = 41,
  ECT_SII_PDO = 50
}
 
enum  {
  ECT_SII_MANUF = 0x0008, ECT_SII_ID = 0x000a, ECT_SII_REV = 0x000c, ECT_SII_BOOTRXMBX = 0x0014,
  ECT_SII_BOOTTXMBX = 0x0016, ECT_SII_MBXSIZE = 0x0019, ECT_SII_TXMBXADR = 0x001a, ECT_SII_RXMBXADR = 0x0018,
  ECT_SII_MBXPROTO = 0x001c
}
 
enum  {
  ECT_MBXT_ERR = 0x00, ECT_MBXT_AOE, ECT_MBXT_EOE, ECT_MBXT_COE,
  ECT_MBXT_FOE, ECT_MBXT_SOE, ECT_MBXT_VOE = 0x0f
}
 
enum  {
  ECT_COES_EMERGENCY = 0x01, ECT_COES_SDOREQ, ECT_COES_SDORES, ECT_COES_TXPDO,
  ECT_COES_RXPDO, ECT_COES_TXPDO_RR, ECT_COES_RXPDO_RR, ECT_COES_SDOINFO
}
 
enum  {
  ECT_SDO_DOWN_INIT = 0x21, ECT_SDO_DOWN_EXP = 0x23, ECT_SDO_DOWN_INIT_CA = 0x31, ECT_SDO_UP_REQ = 0x40,
  ECT_SDO_UP_REQ_CA = 0x50, ECT_SDO_SEG_UP_REQ = 0x60, ECT_SDO_ABORT = 0x80
}
 
enum  {
  ECT_GET_ODLIST_REQ = 0x01, ECT_GET_ODLIST_RES = 0x02, ECT_GET_OD_REQ = 0x03, ECT_GET_OD_RES = 0x04,
  ECT_GET_OE_REQ = 0x05, ECT_GET_OE_RES = 0x06, ECT_SDOINFO_ERROR = 0x07
}
 
enum  {
  ECT_FOE_READ = 0x01, ECT_FOE_WRITE, ECT_FOE_DATA, ECT_FOE_ACK,
  ECT_FOE_ERROR, ECT_FOE_BUSY
}
 
enum  {
  ECT_SOE_READREQ = 0x01, ECT_SOE_READRES, ECT_SOE_WRITEREQ, ECT_SOE_WRITERES,
  ECT_SOE_NOTIFICATION, ECT_SOE_EMERGENCY
}
 
enum  {
  ECT_REG_TYPE = 0x0000, ECT_REG_PORTDES = 0x0007, ECT_REG_ESCSUP = 0x0008, ECT_REG_STADR = 0x0010,
  ECT_REG_ALIAS = 0x0012, ECT_REG_DLCTL = 0x0100, ECT_REG_DLPORT = 0x0101, ECT_REG_DLALIAS = 0x0103,
  ECT_REG_DLSTAT = 0x0110, ECT_REG_ALCTL = 0x0120, ECT_REG_ALSTAT = 0x0130, ECT_REG_ALSTATCODE = 0x0134,
  ECT_REG_PDICTL = 0x0140, ECT_REG_IRQMASK = 0x0200, ECT_REG_RXERR = 0x0300, ECT_REG_FRXERR = 0x0308,
  ECT_REG_EPUECNT = 0x030C, ECT_REG_PECNT = 0x030D, ECT_REG_PECODE = 0x030E, ECT_REG_LLCNT = 0x0310,
  ECT_REG_WDCNT = 0x0442, ECT_REG_EEPCFG = 0x0500, ECT_REG_EEPCTL = 0x0502, ECT_REG_EEPSTAT = 0x0502,
  ECT_REG_EEPADR = 0x0504, ECT_REG_EEPDAT = 0x0508, ECT_REG_FMMU0 = 0x0600, ECT_REG_FMMU1 = ECT_REG_FMMU0 + 0x10,
  ECT_REG_FMMU2 = ECT_REG_FMMU1 + 0x10, ECT_REG_FMMU3 = ECT_REG_FMMU2 + 0x10, ECT_REG_SM0 = 0x0800, ECT_REG_SM1 = ECT_REG_SM0 + 0x08,
  ECT_REG_SM2 = ECT_REG_SM1 + 0x08, ECT_REG_SM3 = ECT_REG_SM2 + 0x08, ECT_REG_SM0STAT = ECT_REG_SM0 + 0x05, ECT_REG_SM1STAT = ECT_REG_SM1 + 0x05,
  ECT_REG_SM1ACT = ECT_REG_SM1 + 0x06, ECT_REG_SM1CONTR = ECT_REG_SM1 + 0x07, ECT_REG_DCTIME0 = 0x0900, ECT_REG_DCTIME1 = 0x0904,
  ECT_REG_DCTIME2 = 0x0908, ECT_REG_DCTIME3 = 0x090C, ECT_REG_DCSYSTIME = 0x0910, ECT_REG_DCSOF = 0x0918,
  ECT_REG_DCSYSOFFSET = 0x0920, ECT_REG_DCSYSDELAY = 0x0928, ECT_REG_DCSYSDIFF = 0x092C, ECT_REG_DCSPEEDCNT = 0x0930,
  ECT_REG_DCTIMEFILT = 0x0934, ECT_REG_DCCUC = 0x0980, ECT_REG_DCSYNCACT = 0x0981, ECT_REG_DCSTART0 = 0x0990,
  ECT_REG_DCCYCLE0 = 0x09A0, ECT_REG_DCCYCLE1 = 0x09A4
}
 
enum  ec_err_type {
  EC_ERR_TYPE_SDO_ERROR = 0, EC_ERR_TYPE_EMERGENCY = 1, EC_ERR_TYPE_PACKET_ERROR = 3, EC_ERR_TYPE_SDOINFO_ERROR = 4,
  EC_ERR_TYPE_FOE_ERROR = 5, EC_ERR_TYPE_FOE_BUF2SMALL = 6, EC_ERR_TYPE_FOE_PACKETNUMBER = 7, EC_ERR_TYPE_SOE_ERROR = 8,
  EC_ERR_TYPE_MBX_ERROR = 9, EC_ERR_TYPE_FOE_FILE_NOTFOUND = 10, EC_ERR_TYPE_EOE_INVALID_RX_DATA = 11
}
 

Detailed Description

General typedefs and defines for EtherCAT.

Defines that could need optimisation for specific applications are the EC_TIMEOUTxxx. Assumptions for the standard settings are a standard linux PC or laptop and a wired connection to maximal 100 slaves. For use with wireless connections or lots of slaves the timeouts need increasing. For fast systems running Xenomai and RT-net or alike the timeouts need to be shorter.

Macro Definition Documentation

◆ EC_BUFSIZE

#define EC_BUFSIZE   EC_MAXECATFRAME

standard frame buffer size in bytes

◆ EC_CMDOFFSET

#define EC_CMDOFFSET   EC_ELENGTHSIZE

offset position of command in EtherCAT header

◆ EC_DATAGRAMFOLLOWS

#define EC_DATAGRAMFOLLOWS   (1 << 15)

definition of datagram follows bit in ec_comt.dlength

◆ EC_DEFAULTRETRIES

#define EC_DEFAULTRETRIES   3

default number of retries if wkc <= 0

◆ EC_ECATTYPE

#define EC_ECATTYPE   0x1000

datagram type EtherCAT

◆ EC_ELENGTHSIZE

#define EC_ELENGTHSIZE   sizeof(uint16)

size of ec_comt.elength item in EtherCAT header

◆ EC_ERROR

#define EC_ERROR   -3

return value general error

◆ EC_ESTAT_BUSY

#define EC_ESTAT_BUSY   0x8000

EEprom state machine busy flag

◆ EC_ESTAT_EMASK

#define EC_ESTAT_EMASK   0x7800

EEprom state machine error flag mask

◆ EC_ESTAT_NACK

#define EC_ESTAT_NACK   0x2000

EEprom state machine error acknowledge

◆ EC_ESTAT_R64

#define EC_ESTAT_R64   0x0040

EEprom state machine read size

◆ EC_FIRSTDCDATAGRAM

#define EC_FIRSTDCDATAGRAM   20

size of DC datagram used in first LRW frame

◆ EC_HEADERSIZE

#define EC_HEADERSIZE   sizeof(ec_comt)

EtherCAT header size

◆ EC_LITTLE_ENDIAN

#define EC_LITTLE_ENDIAN

Define little endian target by default if no endian is set

◆ EC_LOGGROUPOFFSET

#define EC_LOGGROUPOFFSET   16

default group size in 2^x

◆ EC_MAXBUF

#define EC_MAXBUF   16

number of frame buffers per channel (tx, rx1 rx2)

◆ EC_MAXECATFRAME

#define EC_MAXECATFRAME   1518

maximum EtherCAT frame length in bytes

◆ EC_MAXEEPBITMAP

#define EC_MAXEEPBITMAP   128

size of EEPROM bitmap cache

◆ EC_MAXEEPBUF

#define EC_MAXEEPBUF   EC_MAXEEPBITMAP << 5

size of EEPROM cache buffer

◆ EC_MAXLRWDATA

#define EC_MAXLRWDATA   (EC_MAXECATFRAME - 14 - 2 - 10 - 2 - 4)

maximum EtherCAT LRW frame length in bytes

◆ EC_NOFRAME

#define EC_NOFRAME   -1

return value no frame returned

◆ EC_OTHERFRAME

#define EC_OTHERFRAME   -2

return value unknown frame received

◆ EC_SLAVECOUNTEXCEEDED

#define EC_SLAVECOUNTEXCEEDED   -4

return value too many slaves

◆ EC_TIMEOUT

#define EC_TIMEOUT   -5

return value request timeout

◆ EC_TIMEOUTEEP

#define EC_TIMEOUTEEP   20000

timeout value in us for EEPROM access

◆ EC_TIMEOUTRET

#define EC_TIMEOUTRET   2000

timeout value in us for tx frame to return to rx

◆ EC_TIMEOUTRET3

#define EC_TIMEOUTRET3   (EC_TIMEOUTRET * 3)

timeout value in us for safe data transfer, max. triple retry

◆ EC_TIMEOUTRXM

#define EC_TIMEOUTRXM   700000

timeout value in us for rx mailbox cycle

◆ EC_TIMEOUTSAFE

#define EC_TIMEOUTSAFE   20000

timeout value in us for return "safe" variant (f.e. wireless)

◆ EC_TIMEOUTSTATE

#define EC_TIMEOUTSTATE   2000000

timeout value in us for check statechange

◆ EC_TIMEOUTTXM

#define EC_TIMEOUTTXM   20000

timeout value in us for tx mailbox cycle

◆ EC_VER1

#define EC_VER1

define EC_VER1 if version 1 default context and functions are needed define EC_VER2 if application uses only ecx_ functions and own context

◆ EC_WKCSIZE

#define EC_WKCSIZE   sizeof(uint16)

size of workcounter item in EtherCAT datagram

◆ ECT_SDO_PDOASSIGN

#define ECT_SDO_PDOASSIGN   0x1c10

standard SDO PDO assignment

◆ ECT_SDO_RXPDOASSIGN

#define ECT_SDO_RXPDOASSIGN   0x1c12

standard SDO RxPDO assignment

◆ ECT_SDO_SMCOMMTYPE

#define ECT_SDO_SMCOMMTYPE   0x1c00

standard SDO Sync Manager Communication Type

◆ ECT_SDO_TXPDOASSIGN

#define ECT_SDO_TXPDOASSIGN   0x1c13

standard SDO TxPDO assignment

◆ ECT_SII_START

#define ECT_SII_START   0x0040

Start address SII sections in Eeprom

◆ ETH_HEADERSIZE

#define ETH_HEADERSIZE   sizeof(ec_etherheadert)

ethernet header size

◆ ETH_P_ECAT

#define ETH_P_ECAT   0x88A4

Ethercat packet type

◆ etohl

#define etohl (   A)    (A)

◆ etohll

#define etohll (   A)    (A)

◆ etohs

#define etohs (   A)    (A)

◆ get_unaligned

#define get_unaligned (   ptr)    ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })

◆ HI_BYTE

#define HI_BYTE (   w)    ((w) >> 8)

Macro to get hi byte of a word

◆ HI_WORD

#define HI_WORD (   l)    ((l) >> 16)

Macro to get hi word of a dword

◆ htoel

#define htoel (   A)    (A)

◆ htoell

#define htoell (   A)    (A)

◆ htoes

#define htoes (   A)    (A)

◆ LO_BYTE

#define LO_BYTE (   w)    ((w) & 0x00ff)

Macro to get low byte of a word

◆ LO_WORD

#define LO_WORD (   l)    ((l) & 0xffff)

Macro to get hi word of a dword

◆ MK_WORD

#define MK_WORD (   msb,
  lsb 
)    ((((uint16)(msb))<<8) | (lsb))

Helper macros Macro to make a word from 2 bytes

◆ put_unaligned32

#define put_unaligned32 (   val,
  ptr 
)    (memcpy((ptr), &(val), 4))

◆ put_unaligned64

#define put_unaligned64 (   val,
  ptr 
)    (memcpy((ptr), &(val), 8))

◆ SWAP

#define SWAP (   w)    ((((w)& 0xff00) >> 8) | (((w) & 0x00ff) << 8))

Macro to swap hi and low byte of a word

Typedef Documentation

◆ ec_bufT

typedef uint8 ec_bufT[EC_BUFSIZE]

definition for frame buffers

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ECT_SII_STRING 

SII category strings

ECT_SII_GENERAL 

SII category general

ECT_SII_FMMU 

SII category FMMU

ECT_SII_SM 

SII category SM

ECT_SII_PDO 

SII category PDO

◆ anonymous enum

anonymous enum

Item offsets in SII general section

Enumerator
ECT_SII_MANUF 
ECT_SII_ID 
ECT_SII_REV 
ECT_SII_BOOTRXMBX 
ECT_SII_BOOTTXMBX 
ECT_SII_MBXSIZE 
ECT_SII_TXMBXADR 
ECT_SII_RXMBXADR 
ECT_SII_MBXPROTO 

◆ anonymous enum

anonymous enum

Mailbox types definitions

Enumerator
ECT_MBXT_ERR 

Error mailbox type

ECT_MBXT_AOE 

ADS over EtherCAT mailbox type

ECT_MBXT_EOE 

Ethernet over EtherCAT mailbox type

ECT_MBXT_COE 

CANopen over EtherCAT mailbox type

ECT_MBXT_FOE 

File over EtherCAT mailbox type

ECT_MBXT_SOE 

Servo over EtherCAT mailbox type

ECT_MBXT_VOE 

Vendor over EtherCAT mailbox type

◆ anonymous enum

anonymous enum

CoE mailbox types

Enumerator
ECT_COES_EMERGENCY 
ECT_COES_SDOREQ 
ECT_COES_SDORES 
ECT_COES_TXPDO 
ECT_COES_RXPDO 
ECT_COES_TXPDO_RR 
ECT_COES_RXPDO_RR 
ECT_COES_SDOINFO 

◆ anonymous enum

anonymous enum

CoE SDO commands

Enumerator
ECT_SDO_DOWN_INIT 
ECT_SDO_DOWN_EXP 
ECT_SDO_DOWN_INIT_CA 
ECT_SDO_UP_REQ 
ECT_SDO_UP_REQ_CA 
ECT_SDO_SEG_UP_REQ 
ECT_SDO_ABORT 

◆ anonymous enum

anonymous enum

CoE Object Description commands

Enumerator
ECT_GET_ODLIST_REQ 
ECT_GET_ODLIST_RES 
ECT_GET_OD_REQ 
ECT_GET_OD_RES 
ECT_GET_OE_REQ 
ECT_GET_OE_RES 
ECT_SDOINFO_ERROR 

◆ anonymous enum

anonymous enum

FoE opcodes

Enumerator
ECT_FOE_READ 
ECT_FOE_WRITE 
ECT_FOE_DATA 
ECT_FOE_ACK 
ECT_FOE_ERROR 
ECT_FOE_BUSY 

◆ anonymous enum

anonymous enum

SoE opcodes

Enumerator
ECT_SOE_READREQ 
ECT_SOE_READRES 
ECT_SOE_WRITEREQ 
ECT_SOE_WRITERES 
ECT_SOE_NOTIFICATION 
ECT_SOE_EMERGENCY 

◆ anonymous enum

anonymous enum

Ethercat registers

Enumerator
ECT_REG_TYPE 
ECT_REG_PORTDES 
ECT_REG_ESCSUP 
ECT_REG_STADR 
ECT_REG_ALIAS 
ECT_REG_DLCTL 
ECT_REG_DLPORT 
ECT_REG_DLALIAS 
ECT_REG_DLSTAT 
ECT_REG_ALCTL 
ECT_REG_ALSTAT 
ECT_REG_ALSTATCODE 
ECT_REG_PDICTL 
ECT_REG_IRQMASK 
ECT_REG_RXERR 
ECT_REG_FRXERR 
ECT_REG_EPUECNT 
ECT_REG_PECNT 
ECT_REG_PECODE 
ECT_REG_LLCNT 
ECT_REG_WDCNT 
ECT_REG_EEPCFG 
ECT_REG_EEPCTL 
ECT_REG_EEPSTAT 
ECT_REG_EEPADR 
ECT_REG_EEPDAT 
ECT_REG_FMMU0 
ECT_REG_FMMU1 
ECT_REG_FMMU2 
ECT_REG_FMMU3 
ECT_REG_SM0 
ECT_REG_SM1 
ECT_REG_SM2 
ECT_REG_SM3 
ECT_REG_SM0STAT 
ECT_REG_SM1STAT 
ECT_REG_SM1ACT 
ECT_REG_SM1CONTR 
ECT_REG_DCTIME0 
ECT_REG_DCTIME1 
ECT_REG_DCTIME2 
ECT_REG_DCTIME3 
ECT_REG_DCSYSTIME 
ECT_REG_DCSOF 
ECT_REG_DCSYSOFFSET 
ECT_REG_DCSYSDELAY 
ECT_REG_DCSYSDIFF 
ECT_REG_DCSPEEDCNT 
ECT_REG_DCTIMEFILT 
ECT_REG_DCCUC 
ECT_REG_DCSYNCACT 
ECT_REG_DCSTART0 
ECT_REG_DCCYCLE0 
ECT_REG_DCCYCLE1 

◆ ec_bufstate

Possible buffer states

Enumerator
EC_BUF_EMPTY 

Empty

EC_BUF_ALLOC 

Allocated, but not filled

EC_BUF_TX 

Transmitted

EC_BUF_RCVD 

Received, but not consumed

EC_BUF_COMPLETE 

Cycle completed

◆ ec_cmdtype

enum ec_cmdtype

Ethercat command types

Enumerator
EC_CMD_NOP 

No operation

EC_CMD_APRD 

Auto Increment Read

EC_CMD_APWR 

Auto Increment Write

EC_CMD_APRW 

Auto Increment Read Write

EC_CMD_FPRD 

Configured Address Read

EC_CMD_FPWR 

Configured Address Write

EC_CMD_FPRW 

Configured Address Read Write

EC_CMD_BRD 

Broadcast Read

EC_CMD_BWR 

Broadcast Write

EC_CMD_BRW 

Broadcast Read Write

EC_CMD_LRD 

Logical Memory Read

EC_CMD_LWR 

Logical Memory Write

EC_CMD_LRW 

Logical Memory Read Write

EC_CMD_ARMW 

Auto Increment Read Multiple Write

EC_CMD_FRMW 

Configured Read Multiple Write Reserved

◆ ec_datatype

Ethercat data types

Enumerator
ECT_BOOLEAN 
ECT_INTEGER8 
ECT_INTEGER16 
ECT_INTEGER32 
ECT_UNSIGNED8 
ECT_UNSIGNED16 
ECT_UNSIGNED32 
ECT_REAL32 
ECT_VISIBLE_STRING 
ECT_OCTET_STRING 
ECT_UNICODE_STRING 
ECT_TIME_OF_DAY 
ECT_TIME_DIFFERENCE 
ECT_DOMAIN 
ECT_INTEGER24 
ECT_REAL64 
ECT_INTEGER64 
ECT_UNSIGNED24 
ECT_UNSIGNED64 
ECT_BIT1 
ECT_BIT2 
ECT_BIT3 
ECT_BIT4 
ECT_BIT5 
ECT_BIT6 
ECT_BIT7 
ECT_BIT8 

◆ ec_ecmdtype

Ethercat EEprom command types

Enumerator
EC_ECMD_NOP 

No operation

EC_ECMD_READ 

Read

EC_ECMD_WRITE 

Write

EC_ECMD_RELOAD 

Reload

◆ ec_err

enum ec_err

Possible error codes returned.

Enumerator
EC_ERR_OK 

No error

EC_ERR_ALREADY_INITIALIZED 

Library already initialized.

EC_ERR_NOT_INITIALIZED 

Library not initialized.

EC_ERR_TIMEOUT 

Timeout occurred during execution of the function.

EC_ERR_NO_SLAVES 

No slaves were found.

EC_ERR_NOK 

Function failed.

◆ ec_err_type

Error types

Enumerator
EC_ERR_TYPE_SDO_ERROR 
EC_ERR_TYPE_EMERGENCY 
EC_ERR_TYPE_PACKET_ERROR 
EC_ERR_TYPE_SDOINFO_ERROR 
EC_ERR_TYPE_FOE_ERROR 
EC_ERR_TYPE_FOE_BUF2SMALL 
EC_ERR_TYPE_FOE_PACKETNUMBER 
EC_ERR_TYPE_SOE_ERROR 
EC_ERR_TYPE_MBX_ERROR 
EC_ERR_TYPE_FOE_FILE_NOTFOUND 
EC_ERR_TYPE_EOE_INVALID_RX_DATA 

◆ ec_state

enum ec_state

Possible EtherCAT slave states

Enumerator
EC_STATE_NONE 

No valid state.

EC_STATE_INIT 

Init state

EC_STATE_PRE_OP 

Pre-operational.

EC_STATE_BOOT 

Boot state

EC_STATE_SAFE_OP 

Safe-operational.

EC_STATE_OPERATIONAL 

Operational

EC_STATE_ACK 

Error or ACK error

EC_STATE_ERROR