SOEM v1.2.5
Data Structures | Defines | Functions | Variables

ethercatprint.c File Reference

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

#include <stdio.h>
#include "ethercattype.h"
#include "ethercatmain.h"

Data Structures

struct  ec_sdoerrorlist_t
struct  ec_ALstatuscodelist_t
struct  ec_soeerrorlist_t

Defines

#define EC_MAXERRORNAME   127

Functions

char * ec_sdoerror2string (uint32 sdoerrorcode)
char * ec_ALstatuscode2string (uint16 ALstatuscode)
char * ec_soeerror2string (uint16 errorcode)
char * ec_elist2string (void)

Variables

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

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 readble text. For the defined error codes see the EtherCAT protocol documentation.


Define Documentation

#define EC_MAXERRORNAME   127

Function Documentation

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
char* ec_elist2string ( void  )

Look up error in ec_errorlist and convert to text string.

Returns:
readable string
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
char* ec_soeerror2string ( uint16  errorcode)

Look up text string that belongs to SoE error code.

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

Variable Documentation

AL status code list definition

Initial value:
 {
        {0x00000000, "No error" },
        {0x05030000, "Toggle bit not changed" },
        {0x05040000, "SDO protocol timeout" },
        {0x05040001, "Client/Server command specifier not valid or unknown" },
        {0x05040005, "Out of memory" },
        {0x06010000, "Unsupported access to an object" },
        {0x06010001, "Attempt to read to a write only object" },
        {0x06010002, "Attempt to write to a read only object" },
        {0x06020000, "The object does not exist in the object directory" },
        {0x06040041, "The object can not be mapped into the PDO" },
        {0x06040042, "The number and length of the objects to be mapped would exceed the PDO length" },
        {0x06040043, "General parameter incompatibility reason" },
        {0x06040047, "General internal incompatibility in the device" },
        {0x06060000, "Access failed due to a hardware error" },
        {0x06070010, "Data type does not match, length of service parameter does not match" },
        {0x06070012, "Data type does not match, length of service parameter too high" },
        {0x06070013, "Data type does not match, length of service parameter too low" },
        {0x06090011, "Subindex does not exist" },
        {0x06090030, "Value range of parameter exceeded (only for write access)" },
        {0x06090031, "Value of parameter written too high" },
        {0x06090032, "Value of parameter written too low" },
        {0x06090036, "Maximum value is less than minimum value" },
        {0x08000000, "General error" },
        {0x08000020, "Data cannot be transferred or stored to the application" },
        {0x08000021, "Data cannot be transferred or stored to the application because of local control" },
        {0x08000022, "Data cannot be transferred or stored to the application because of the present device state" },
        {0x08000023, "Object dictionary dynamic generation fails or no object dictionary is present" },
        {0xffffffff, "Unknown" }
}

SDO error list definition

SoE error list definition

char estring[EC_MAXERRORNAME]