Classes | Macros | Functions | Variables
ethercatprint.c File Reference

Module to convert EtherCAT errors to readable messages. More...

#include <stdio.h>
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatmain.h"
Include dependency graph for ethercatprint.c:

Go to the source code of this file.

Classes

struct  ec_ALstatuscodelist_t
 
struct  ec_mbxerrorlist_t
 
struct  ec_sdoerrorlist_t
 
struct  ec_soeerrorlist_t
 

Macros

#define EC_MAXERRORNAME   127
 

Functions

char * ec_ALstatuscode2string (uint16 ALstatuscode)
 
char * ec_elist2string (void)
 
char * ec_mbxerror2string (uint16 errorcode)
 
const char * ec_sdoerror2string (uint32 sdoerrorcode)
 
char * ec_soeerror2string (uint16 errorcode)
 
char * ecx_elist2string (ecx_contextt *context)
 
char * ecx_err2string (const ec_errort Ec)
 

Variables

const ec_ALstatuscodelist_t ec_ALstatuscodelist []
 
const ec_mbxerrorlist_t ec_mbxerrorlist []
 
const ec_sdoerrorlist_t ec_sdoerrorlist []
 
const ec_soeerrorlist_t ec_soeerrorlist []
 
char estring [EC_MAXERRORNAME]
 

Detailed Description

Module to convert EtherCAT errors to readable messages.

SDO abort messages and AL status codes are used to relay slave errors to the user application. This module converts the binary codes to readable text. For the defined error codes see the EtherCAT protocol documentation.

Definition in file ethercatprint.c.

Macro Definition Documentation

◆ EC_MAXERRORNAME

#define EC_MAXERRORNAME   127

Definition at line 20 of file ethercatprint.c.

Function Documentation

◆ ec_ALstatuscode2string()

char* ec_ALstatuscode2string ( uint16  ALstatuscode)

Look up text string that belongs to AL status code.

Parameters
[in]ALstatuscode= AL status code as defined in EtherCAT protocol
Returns
readable string

Definition at line 245 of file ethercatprint.c.

◆ ec_elist2string()

char* ec_elist2string ( void  )

Definition at line 371 of file ethercatprint.c.

◆ ec_mbxerror2string()

char* ec_mbxerror2string ( uint16  errorcode)

Look up text string that belongs to MBX error code.

Parameters
[in]errorcode= MBX error code as defined in EtherCAT protocol
Returns
readable string

Definition at line 281 of file ethercatprint.c.

◆ ec_sdoerror2string()

const char* ec_sdoerror2string ( uint32  sdoerrorcode)

Look up text string that belongs to SDO error code.

Parameters
[in]sdoerrorcode= SDO error code as defined in EtherCAT protocol
Returns
readable string

Definition at line 227 of file ethercatprint.c.

◆ ec_soeerror2string()

char* ec_soeerror2string ( uint16  errorcode)

Look up text string that belongs to SoE error code.

Parameters
[in]errorcode= SoE error code as defined in EtherCAT protocol
Returns
readable string

Definition at line 263 of file ethercatprint.c.

◆ ecx_elist2string()

char* ecx_elist2string ( ecx_contextt context)

Look up error in ec_errorlist and convert to text string.

Parameters
[in]context= context struct
Returns
readable string

Definition at line 356 of file ethercatprint.c.

◆ ecx_err2string()

char* ecx_err2string ( const ec_errort  Ec)

Convert an error to text string.

Parameters
[in]Ec= Struct describing the error.
Returns
readable string

Definition at line 299 of file ethercatprint.c.

Variable Documentation

◆ ec_ALstatuscodelist

const ec_ALstatuscodelist_t ec_ALstatuscodelist[]

AL status code list definition

Definition at line 97 of file ethercatprint.c.

◆ ec_mbxerrorlist

const ec_mbxerrorlist_t ec_mbxerrorlist[]
Initial value:
= {
{0x0000, "No error" },
{0x0001, "Syntax of 6 octet Mailbox Header is wrong" },
{0x0002, "The mailbox protocol is not supported" },
{0x0003, "Channel Field contains wrong value"},
{0x0004, "The service is no supported"},
{0x0005, "Invalid mailbox header"},
{0x0006, "Length of received mailbox data is too short"},
{0x0007, "No more memory in slave"},
{0x0008, "The length of data is inconsistent"},
{0xffff, "Unknown"}
}

MBX error list definition

Definition at line 209 of file ethercatprint.c.

◆ ec_sdoerrorlist

const ec_sdoerrorlist_t ec_sdoerrorlist[]

SDO error list definition

Definition at line 61 of file ethercatprint.c.

◆ ec_soeerrorlist

const ec_soeerrorlist_t ec_soeerrorlist[]

SoE error list definition

Definition at line 154 of file ethercatprint.c.

◆ estring

char estring[EC_MAXERRORNAME]

Definition at line 58 of file ethercatprint.c.



soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Wed Mar 2 2022 01:01:49