libethercat - an embeddable realtime EtherCAT-master library
Communicate with EtherCAT slaves attached to a Network interface.
Loading...
Searching...
No Matches
CanOpen over Ethercat (CoE)

Data Structures

struct  ec_coe_emergency_message
 Message queue qentry. More...
 
struct  ec_coe
 
struct  ec_coe_sdo_desc
 CanOpen over EtherCAT sdo descriptor. More...
 
struct  ec_coe_sdo_entry_desc
 

Macros

#define CANOPEN_MAXNAME   (40u)
 CANOPEN maximum name length.
 
#define CANOPEN_MAXDATA   (128u)
 CANOPEN maximum data length.
 
#define EC_COE_SDO_VALUE_INFO_ACCESS_RIGHTS   (0x01)
 SDO value info access rights.
 
#define EC_COE_SDO_VALUE_INFO_OBJECT_CATEGORY   (0x02)
 SDO info object category.
 
#define EC_COE_SDO_VALUE_INFO_MAPPABLE   (0x04)
 SDO info mappable.
 
#define EC_COE_SDO_VALUE_INFO_UNIT   (0x08)
 SDO info unit.
 
#define EC_COE_SDO_VALUE_INFO_DEFAULT_VALUE   (0x10)
 SDO info default value.
 
#define EC_COE_SDO_VALUE_INFO_MIN_VALUE   (0x20)
 SDO info minimum value.
 
#define EC_COE_SDO_VALUE_INFO_MAX_VALUE   (0x40)
 SDO info maximum value.
 

Typedefs

typedef struct ec_coe_emergency_message ec_coe_emergency_message_t
 Message queue qentry.
 
typedef struct ec_coe ec_coe_t
 CoE type.
 
typedef struct PACKED ec_coe_sdo_desc ec_coe_sdo_desc_t
 CanOpen over EtherCAT sdo descriptor.
 
typedef struct PACKED ec_coe_sdo_entry_desc ec_coe_sdo_entry_desc_t
 CoE SDO entry description type.
 
typedef struct ec ec_t
 typedef to ec struct.
 

Enumerations

enum  {
  EC_COE_EMERGENCY = 0x01 , EC_COE_SDOREQ , EC_COE_SDORES , EC_COE_TXPDO ,
  EC_COE_RXPDO , EC_COE_TXPDO_RR , EC_COE_RXPDO_RR , EC_COE_SDOINFO
}
 CoE mailbox types. More...
 
enum  { EC_COE_SDO_DOWNLOAD_SEQ_REQ = 0x00 , EC_COE_SDO_DOWNLOAD_REQ = 0x01 , EC_COE_SDO_UPLOAD_REQ = 0x02 , EC_COE_SDO_ABORT_REQ = 0x04 }
 service data object command More...
 
enum  {
  EC_COE_SDO_INFO_ODLIST_REQ = 0x01 , EC_COE_SDO_INFO_ODLIST_RESP , EC_COE_SDO_INFO_GET_OBJECT_DESC_REQ , EC_COE_SDO_INFO_GET_OBJECT_DESC_RESP ,
  EC_COE_SDO_INFO_GET_ENTRY_DESC_REQ , EC_COE_SDO_INFO_GET_ENTRY_DESC_RESP , EC_COE_SDO_INFO_ERROR_REQUEST
}
 service data object information type More...
 
enum  {
  DEFTYPE_NULL = 0x0000 , DEFTYPE_BOOLEAN = 0x0001 , DEFTYPE_INTEGER8 = 0x0002 , DEFTYPE_INTEGER16 = 0x0003 ,
  DEFTYPE_INTEGER32 = 0x0004 , DEFTYPE_UNSIGNED8 = 0x0005 , DEFTYPE_UNSIGNED16 = 0x0006 , DEFTYPE_UNSIGNED32 = 0x0007 ,
  DEFTYPE_REAL32 = 0x0008 , DEFTYPE_VISIBLESTRING = 0x0009 , DEFTYPE_OCTETSTRING = 0x000A , DEFTYPE_UNICODE_STRING = 0x000B ,
  DEFTYPE_TIME_OF_DAY = 0x000C , DEFTYPE_TIME_DIFFERENCE = 0x000D , DEFTYPE_INTEGER24 = 0x0010 , DEFTYPE_REAL64 = 0x0011 ,
  DEFTYPE_INTEGER40 = 0x0012 , DEFTYPE_INTEGER48 = 0x0013 , DEFTYPE_INTEGER56 = 0x0014 , DEFTYPE_INTEGER64 = 0x0015 ,
  DEFTYPE_UNSIGNED24 = 0x0016 , DEFTYPE_UNSIGNED40 = 0x0018 , DEFTYPE_UNSIGNED48 = 0x0019 , DEFTYPE_UNSIGNED56 = 0x001A ,
  DEFTYPE_UNSIGNED64 = 0x001B , DEFTYPE_GUID = 0x001D , DEFTYPE_BYTE = 0x001E , DEFTYPE_WORD = 0x001F ,
  DEFTYPE_DWORD = 0x0020 , DEFTYPE_PDOMAPPING = 0x0021 , DEFTYPE_IDENTITY = 0x0023 , DEFTYPE_COMMAND = 0x0025 ,
  DEFTYPE_PDOCOMPAR = 0x0027 , DEFTYPE_ENUM = 0x0028 , DEFTYPE_SMPAR = 0x0029 , DEFTYPE_RECORD = 0x002A ,
  DEFTYPE_BACKUP = 0x002B , DEFTYPE_MDP = 0x002C , DEFTYPE_BITARR8 = 0x002D , DEFTYPE_BITARR16 = 0x002E ,
  DEFTYPE_BITARR32 = 0x002F , DEFTYPE_BIT1 = 0x0030 , DEFTYPE_BIT2 = 0x0031 , DEFTYPE_BIT3 = 0x0032 ,
  DEFTYPE_BIT4 = 0x0033 , DEFTYPE_BIT5 = 0x0034 , DEFTYPE_BIT6 = 0x0035 , DEFTYPE_BIT7 = 0x0036 ,
  DEFTYPE_BIT8 = 0x0037 , DEFTYPE_ARRAY_OF_INT = 0x0260 , DEFTYPE_ARRAY_OF_SINT = 0x0261 , DEFTYPE_ARRAY_OF_DINT = 0x0262 ,
  DEFTYPE_ARRAY_OF_UDINT = 0x0263 , DEFTYPE_ERRORHANDLING = 0x0281 , DEFTYPE_DIAGHISTORY = 0x0282 , DEFTYPE_SYNCSTATUS = 0x0283 ,
  DEFTYPE_SYNCSETTINGS = 0x0284 , DEFTYPE_FSOEFRAME = 0x0285 , DEFTYPE_FSOECOMMPAR = 0x0286
}
 datatypes
 
enum  { OBJCODE_VAR = 0x07 , OBJCODE_ARR = 0x08 , OBJCODE_REC = 0x09 }
 
enum  {
  ACCESS_READWRITE = 0x003F , ACCESS_READ = 0x0007 , ACCESS_READ_PREOP = 0x0001 , ACCESS_READ_SAFEOP = 0x0002 ,
  ACCESS_READ_OP = 0x0004 , ACCESS_WRITE = 0x0038 , ACCESS_WRITE_PREOP = 0x0008 , ACCESS_WRITE_SAFEOP = 0x0010 ,
  ACCESS_WRITE_OP = 0x0020
}
 

Functions

void ec_coe_init (ec_t *pec, osal_uint16_t slave)
 Initialize CoE structure.
 
void ec_coe_deinit (ec_t *pec, osal_uint16_t slave)
 deinitialize CoE structure
 
int ec_coe_sdo_read (ec_t *pec, osal_uint16_t slave, osal_uint16_t index, osal_uint8_t sub_index, int complete, osal_uint8_t *buf, osal_size_t *len, osal_uint32_t *abort_code)
 Read CoE service data object (SDO)
 
int ec_coe_master_sdo_read (ec_t *pec, osal_uint16_t index, osal_uint8_t sub_index, int complete, osal_uint8_t *buf, osal_size_t *len, osal_uint32_t *abort_code)
 Read CoE service data object (SDO) of master.
 
int ec_coe_sdo_write (ec_t *pec, osal_uint16_t slave, osal_uint16_t index, osal_uint8_t sub_index, int complete, osal_uint8_t *buf, osal_size_t len, osal_uint32_t *abort_code)
 Write CoE service data object (SDO)
 
int ec_coe_master_sdo_write (ec_t *pec, osal_uint16_t index, osal_uint8_t sub_index, int complete, osal_uint8_t *buf, osal_size_t len, osal_uint32_t *abort_code)
 Write CoE service data object (SDO) of master.
 
int ec_coe_sdo_desc_read (ec_t *pec, osal_uint16_t slave, osal_uint16_t index, ec_coe_sdo_desc_t *desc, osal_uint32_t *error_code)
 Read CoE SDO description.
 
int ec_coe_master_sdo_desc_read (const ec_t *pec, osal_uint16_t index, ec_coe_sdo_desc_t *desc, osal_uint32_t *error_code)
 Read CoE SDO description of master.
 
int ec_coe_sdo_entry_desc_read (ec_t *pec, osal_uint16_t slave, osal_uint16_t index, osal_uint8_t sub_index, osal_uint8_t value_info, ec_coe_sdo_entry_desc_t *desc, osal_uint32_t *error_code)
 Read CoE SDO entry description.
 
int ec_coe_master_sdo_entry_desc_read (const ec_t *pec, osal_uint16_t index, osal_uint8_t sub_index, osal_uint8_t value_info, ec_coe_sdo_entry_desc_t *desc, osal_uint32_t *error_code)
 Read CoE SDO entry description of master.
 
int ec_coe_odlist_read (ec_t *pec, osal_uint16_t slave, osal_uint8_t *buf, osal_size_t *len)
 Read CoE object dictionary list.
 
int ec_coe_master_odlist_read (ec_t *pec, osal_uint8_t *buf, osal_size_t *len)
 Read CoE object dictionary list of master.
 
int ec_coe_generate_mapping (ec_t *pec, osal_uint16_t slave)
 generate sync manager process data mapping via coe
 
void ec_coe_emergency_enqueue (ec_t *pec, osal_uint16_t slave, pool_entry_t *p_entry)
 queue read mailbox content
 
int ec_coe_emergency_get_next (ec_t *pec, osal_uint16_t slave, ec_coe_emergency_message_t *msg)
 Get next CoE emergency message.
 
void ec_coe_enqueue (ec_t *pec, osal_uint16_t slave, pool_entry_t *p_entry)
 Enqueue CoE message received from slave.
 
const osal_char_t * get_sdo_info_error_string (osal_uint32_t errorcode)
 Get SDO INFO error string.
 

Detailed Description

This modules contains functions on how to communicate to the CANOpen over EtherCAT mailbox.

Typedef Documentation

◆ ec_coe_sdo_desc_t

typedef struct PACKED ec_coe_sdo_desc ec_coe_sdo_desc_t

CanOpen over EtherCAT sdo descriptor.

CoE SDO description type.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

CoE mailbox types.

Enumerator
EC_COE_EMERGENCY 

emergency message

EC_COE_SDOREQ 

service data object request

EC_COE_SDORES 

service data object response

EC_COE_TXPDO 

transmit PDO

EC_COE_RXPDO 

receive PDO

EC_COE_TXPDO_RR 

transmit PDO RR

EC_COE_RXPDO_RR 

receive PDO RR

EC_COE_SDOINFO 

service data object information

◆ anonymous enum

anonymous enum

service data object command

Enumerator
EC_COE_SDO_DOWNLOAD_SEQ_REQ 

sdo download seq request

EC_COE_SDO_DOWNLOAD_REQ 

sdo download request

EC_COE_SDO_UPLOAD_REQ 

sdo upload request

EC_COE_SDO_ABORT_REQ 

sdo abort request

◆ anonymous enum

anonymous enum

service data object information type

Enumerator
EC_COE_SDO_INFO_ODLIST_REQ 

object dict list request

EC_COE_SDO_INFO_ODLIST_RESP 

object dict list response

EC_COE_SDO_INFO_GET_OBJECT_DESC_REQ 

object description request

EC_COE_SDO_INFO_GET_OBJECT_DESC_RESP 

object description response

EC_COE_SDO_INFO_GET_ENTRY_DESC_REQ 

entry description request

EC_COE_SDO_INFO_GET_ENTRY_DESC_RESP 

entry description response

EC_COE_SDO_INFO_ERROR_REQUEST 

error request

◆ anonymous enum

anonymous enum
Enumerator
OBJCODE_VAR 

Object code VARIABLE.

OBJCODE_ARR 

Object code ARRAY.

OBJCODE_REC 

Object code RECORD.

◆ anonymous enum

anonymous enum
Enumerator
ACCESS_READWRITE 

Read/write in all states.

ACCESS_READ 

Read only in all states.

ACCESS_READ_PREOP 

Read only in PreOP.

ACCESS_READ_SAFEOP 

Read only in SafeOP.

ACCESS_READ_OP 

Read only in OP.

ACCESS_WRITE 

Write only in all states.

ACCESS_WRITE_PREOP 

Write only in PreOP.

ACCESS_WRITE_SAFEOP 

Write only in SafeOP.

ACCESS_WRITE_OP 

Write only in OP.

Function Documentation

◆ ec_coe_deinit()

void ec_coe_deinit ( ec_t pec,
osal_uint16_t  slave 
)

deinitialize CoE structure

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]slaveNumber of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached).

◆ ec_coe_emergency_enqueue()

void ec_coe_emergency_enqueue ( ec_t pec,
osal_uint16_t  slave,
pool_entry_t p_entry 
)

queue read mailbox content

Parameters
[in]pecPointer to ethercat master struct.
[in]slaveNumber of EtherCAT slave connected to bus.
[in]p_entryEmergency message to enqueue.

◆ ec_coe_emergency_get_next()

int ec_coe_emergency_get_next ( ec_t pec,
osal_uint16_t  slave,
ec_coe_emergency_message_t msg 
)

Get next CoE emergency message.

Parameters
[in]pecPointer to EtherCAT mater struct.
[in]slaveNumber of EtherCAT slave connected to bus.
[out]msgPointer to return emergency message.
Returns
EC_OK on success, errorcode otherwise

◆ ec_coe_enqueue()

void ec_coe_enqueue ( ec_t pec,
osal_uint16_t  slave,
pool_entry_t p_entry 
)

Enqueue CoE message received from slave.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]slaveNumber of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached).
[in]p_entryPointer to pool entry containing received mailbox message from slave.
Return values
EC_ERROR_UNAVAILABLENo more emergency message in queue.
EC_OKSuccess, got next emergency message.

◆ ec_coe_generate_mapping()

int ec_coe_generate_mapping ( ec_t pec,
osal_uint16_t  slave 
)

generate sync manager process data mapping via coe

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]slaveNumber of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached).
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_MAILBOX_TIMEOUTGot timeout waiting for message.
EC_ERROR_UNAVAILABLELocking mailbox failed for some reason.
EC_ERROR_MAILBOX_NOT_SUPPORTED_COENo CoE support on slave's mailbox.
EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERSNo more free send buffer available.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.
EC_ERROR_MAILBOX_READGot unexpected message on CoE read.

◆ ec_coe_init()

void ec_coe_init ( ec_t pec,
osal_uint16_t  slave 
)

Initialize CoE structure.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]slaveNumber of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached).

◆ ec_coe_master_odlist_read()

int ec_coe_master_odlist_read ( ec_t pec,
osal_uint8_t *  buf,
osal_size_t *  len 
)

Read CoE object dictionary list of master.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[out]bufPointer to a preallocated buffer.
[in,out]lenLength of buffer, outputs read length.
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_MAILBOX_COE_INDEX_NOT_FOUNDRequested index not found.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.
EC_ERROR_MAILBOX_BUFFER_TOO_SMALLProvided buffer was too small, returning size in len.

◆ ec_coe_master_sdo_desc_read()

int ec_coe_master_sdo_desc_read ( const ec_t pec,
osal_uint16_t  index,
ec_coe_sdo_desc_t desc,
osal_uint32_t *  error_code 
)

Read CoE SDO description of master.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]indexCoE SDO index number.
[out]descReturns CoE SDO description.
[out]error_codeReturns the error code if we got one.
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_MAILBOX_COE_INDEX_NOT_FOUNDRequested index not found.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.

◆ ec_coe_master_sdo_entry_desc_read()

int ec_coe_master_sdo_entry_desc_read ( const ec_t pec,
osal_uint16_t  index,
osal_uint8_t  sub_index,
osal_uint8_t  value_info,
ec_coe_sdo_entry_desc_t desc,
osal_uint32_t *  error_code 
)

Read CoE SDO entry description of master.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]indexCoE SDO index number.
[in]sub_indexCoE SDO sub index number.
[in]value_infoBitset which description values you want to get
[in]descReturn CoE entry description.
[out]error_codeReturns the error code if we got one.
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_MAILBOX_COE_INDEX_NOT_FOUNDRequested index not found.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.

◆ ec_coe_master_sdo_read()

int ec_coe_master_sdo_read ( ec_t pec,
osal_uint16_t  index,
osal_uint8_t  sub_index,
int  complete,
osal_uint8_t *  buf,
osal_size_t *  len,
osal_uint32_t *  abort_code 
)

Read CoE service data object (SDO) of master.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]indexCoE SDO index number.
[in]sub_indexCoE SDO sub index number.
[in]completeSDO Complete access (only if sub_index == 0)
[out]bufBuffer where to store the answer. User supplied pointer to a buffer. If buffer is too small an error code is returned and the needed length is stored in 'len'.
[in,out]lenLength of buffer, outputs read length.
[out]abort_codeReturns the abort code if we got abort request
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_MAILBOX_COE_INDEX_NOT_FOUNDRequested index not found.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.

◆ ec_coe_master_sdo_write()

int ec_coe_master_sdo_write ( ec_t pec,
osal_uint16_t  index,
osal_uint8_t  sub_index,
int  complete,
osal_uint8_t *  buf,
osal_size_t  len,
osal_uint32_t *  abort_code 
)

Write CoE service data object (SDO) of master.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]indexCoE SDO index number.
[in]sub_indexCoE SDO sub index number.
[in]completeSDO Complete access (only if sub_index == 0)
[in]bufBuffer with data which will be written.
[in]lenLength of buffer.
[out]abort_codeReturns the abort code if we got abort request
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_MAILBOX_COE_INDEX_NOT_FOUNDRequested index not found.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.

◆ ec_coe_odlist_read()

int ec_coe_odlist_read ( ec_t pec,
osal_uint16_t  slave,
osal_uint8_t *  buf,
osal_size_t *  len 
)

Read CoE object dictionary list.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]slaveNumber of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached).
[out]bufPointer to a preallocated buffer.
[in,out]lenLength of buffer, outputs read length.
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_UNAVAILABLELocking mailbox failed for some reason.
EC_ERROR_MAILBOX_NOT_SUPPORTED_COENo CoE support on slave's mailbox.
EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERSNo more free send buffer available.
EC_ERROR_MAILBOX_TIMEOUTGot timeout waiting for message.
EC_ERROR_MAILBOX_BUFFER_TOO_SMALLProvided buffer was too small, returning size in len.

◆ ec_coe_sdo_desc_read()

int ec_coe_sdo_desc_read ( ec_t pec,
osal_uint16_t  slave,
osal_uint16_t  index,
ec_coe_sdo_desc_t desc,
osal_uint32_t *  error_code 
)

Read CoE SDO description.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]slaveNumber of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached).
[in]indexCoE SDO index number.
[out]descReturns CoE SDO description.
[out]error_codeReturns the error code if we got one.
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_UNAVAILABLELocking mailbox failed for some reason.
EC_ERROR_MAILBOX_NOT_SUPPORTED_COENo CoE support on slave's mailbox.
EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERSNo more free send buffer available.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.
EC_ERROR_MAILBOX_READGot unexpected message on CoE read.

◆ ec_coe_sdo_entry_desc_read()

int ec_coe_sdo_entry_desc_read ( ec_t pec,
osal_uint16_t  slave,
osal_uint16_t  index,
osal_uint8_t  sub_index,
osal_uint8_t  value_info,
ec_coe_sdo_entry_desc_t desc,
osal_uint32_t *  error_code 
)

Read CoE SDO entry description.

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]slaveNumber of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached).
[in]indexCoE SDO index number.
[in]sub_indexCoE SDO sub index number.
[in]value_infoBitset which description values you want to get
[in]descReturn CoE entry description.
[out]error_codeReturns the error code if we got one.
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_UNAVAILABLELocking mailbox failed for some reason.
EC_ERROR_MAILBOX_NOT_SUPPORTED_COENo CoE support on slave's mailbox.
EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERSNo more free send buffer available.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.
EC_ERROR_MAILBOX_READGot unexpected message on CoE read.

◆ ec_coe_sdo_read()

int ec_coe_sdo_read ( ec_t pec,
osal_uint16_t  slave,
osal_uint16_t  index,
osal_uint8_t  sub_index,
int  complete,
osal_uint8_t *  buf,
osal_size_t *  len,
osal_uint32_t *  abort_code 
)

Read CoE service data object (SDO)

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]slaveNumber of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached).
[in]indexCoE SDO index number.
[in]sub_indexCoE SDO sub index number.
[in]completeSDO Complete access (only if sub_index == 0)
[out]bufBuffer where to store the answer. User supplied pointer to a buffer. If buffer is too small an error code is returned and the needed length is stored in 'len'.
[in,out]lenLength of buffer, outputs read length.
[out]abort_codeReturns the abort code if we got abort request
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_MAILBOX_READGot unexpected message on CoE read.
EC_ERROR_MAILBOX_BUFFER_TOO_SMALLProvided buffer was too small, returning size in len.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.
EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERSNo more free send buffer available.
EC_ERROR_MAILBOX_NOT_SUPPORTED_COENo CoE support on slave's mailbox.
EC_ERROR_UNAVAILABLELocking mailbox failed for some reason.
EC_ERROR_MAILBOX_TIMEOUTGot timeout waiting for message.

◆ ec_coe_sdo_write()

int ec_coe_sdo_write ( ec_t pec,
osal_uint16_t  slave,
osal_uint16_t  index,
osal_uint8_t  sub_index,
int  complete,
osal_uint8_t *  buf,
osal_size_t  len,
osal_uint32_t *  abort_code 
)

Write CoE service data object (SDO)

Parameters
[in]pecPointer to ethercat master structure, which you got from ec_open.
[in]slaveNumber of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached).
[in]indexCoE SDO index number.
[in]sub_indexCoE SDO sub index number.
[in]completeSDO Complete access (only if sub_index == 0)
[in]bufBuffer with data which will be written.
[in]lenLength of buffer.
[out]abort_codeReturns the abort code if we got abort request
Return values
EC_OKCoE transfer was successfull.
EC_ERROR_UNAVAILABLELocking mailbox failed for some reason.
EC_ERROR_MAILBOX_NOT_SUPPORTED_COENo CoE support on slave's mailbox.
EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERSNo more free send buffer available.
EC_ERROR_MAILBOX_TIMEOUTGot timeout waiting for message.
EC_ERROR_MAILBOX_ABORTGot SDO abort request.
EC_ERROR_MAILBOX_READGot unexpected message on CoE read.

◆ get_sdo_info_error_string()

const osal_char_t * get_sdo_info_error_string ( osal_uint32_t  errorcode)

Get SDO INFO error string.

Parameters
[in]errorcodeError code number.
Returns
string with decoded error.