AB&T / SOEM

Dependents:   EasyCAT_LAB_simple EasyCAT_LAB_very_simple EasyCAT_LAB

Embed: (wiki syntax)

« Back to documentation index

ethercattype.h File Reference

ethercattype.h File Reference

General typedefs and defines for EtherCAT. More...

Go to the source code of this file.

Data Structures

struct  ec_errort
 Struct to retrieve errors. More...

Typedefs

typedef uint8 ec_bufT [EC_BUFSIZE]
 definition for frame buffers
typedef PACKED_BEGIN struct PACKED ec_etherheadert
 ethernet header definition
typedef PACKED_BEGIN struct PACKED ec_comt
 EtherCAT datagram header definition.

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
}
 

Possible error codes returned.

More...
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
}
 

Possible EtherCAT slave states.

More...
enum  ec_bufstate {
  EC_BUF_EMPTY = 0x00, EC_BUF_ALLOC = 0x01, EC_BUF_TX = 0x02, EC_BUF_RCVD = 0x03,
  EC_BUF_COMPLETE = 0x04
}
 

Possible buffer states.

More...
enum  ec_datatype
 

Ethercat data types.

More...
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
}
 

Ethercat command types.

More...
enum  ec_ecmdtype { EC_ECMD_NOP = 0x0000, EC_ECMD_READ = 0x0100, EC_ECMD_WRITE = 0x0201, EC_ECMD_RELOAD = 0x0300 }
 

Ethercat EEprom command types.

More...
enum  {
  ECT_SII_STRING = 10, ECT_SII_GENERAL = 30, ECT_SII_FMMU = 40, ECT_SII_SM = 41,
  ECT_SII_PDO = 50
}
enum  
 

Item offsets in SII general section.

More...
enum  {
  ECT_MBXT_ERR = 0x00, ECT_MBXT_AOE, ECT_MBXT_EOE, ECT_MBXT_COE,
  ECT_MBXT_FOE, ECT_MBXT_SOE, ECT_MBXT_VOE = 0x0f
}
 

Mailbox types definitions.

More...
enum  
 

CoE mailbox types.

More...
enum  
 

CoE SDO commands.

More...
enum  
 

CoE Object Description commands.

More...
enum  
 

FoE opcodes.

More...
enum  
 

SoE opcodes.

More...
enum  
 

Ethercat registers.

More...
enum  ec_err_type
 

Error types.

More...

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.

Definition in file ethercattype.h.


Typedef Documentation

typedef uint8 ec_bufT[EC_BUFSIZE]

definition for frame buffers

Definition at line 81 of file ethercattype.h.

typedef PACKED_BEGIN struct PACKED ec_comt

EtherCAT datagram header definition.

typedef PACKED_BEGIN struct PACKED ec_etherheadert

ethernet header definition


Enumeration Type Documentation

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.

Definition at line 278 of file ethercattype.h.

anonymous enum

Item offsets in SII general section.

Definition at line 293 of file ethercattype.h.

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.

Definition at line 307 of file ethercattype.h.

anonymous enum

CoE mailbox types.

Definition at line 326 of file ethercattype.h.

anonymous enum

CoE SDO commands.

Definition at line 339 of file ethercattype.h.

anonymous enum

CoE Object Description commands.

Definition at line 351 of file ethercattype.h.

anonymous enum

FoE opcodes.

Definition at line 363 of file ethercattype.h.

anonymous enum

SoE opcodes.

Definition at line 374 of file ethercattype.h.

anonymous enum

Ethercat registers.

Definition at line 385 of file ethercattype.h.

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.

Definition at line 169 of file ethercattype.h.

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

Definition at line 216 of file ethercattype.h.

Ethercat data types.

Definition at line 184 of file ethercattype.h.

Ethercat EEprom command types.

Enumerator:
EC_ECMD_NOP 

No operation.

EC_ECMD_READ 

Read.

EC_ECMD_WRITE 

Write.

EC_ECMD_RELOAD 

Reload.

Definition at line 252 of file ethercattype.h.

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.

Definition at line 132 of file ethercattype.h.

Error types.

Definition at line 456 of file ethercattype.h.

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.

Definition at line 149 of file ethercattype.h.