EtherCAT Slave  1.06.01

◆ EC_API_SLV_CoE_odAddRecord()

uint32_t EC_API_SLV_CoE_odAddRecord ( EC_API_SLV_SHandle_t pEcSlaveApi_p,
uint16_t  index_p,
char *  pName_p,
EC_API_SLV_CBObjRead_t  cbRead_p,
void *  pReadCtxt_p,
EC_API_SLV_CBObjWrite_t  cbWrite_p,
void *  pWriteCtxt_p,
EC_API_SLV_SCoE_Object_t **  pOutSdo_p 
)

This function creates a Record Object.

Parameters
[in]pEcSlaveApi_pThe pointer to the EtherCAT API instance.
[in]index_pRecord index number.
[in]pName_pEntry name.
[in]cbRead_pRead function pointer to the read function.
[in]pReadCtxt_pRead function pointer to the read function context.
[in]cbWrite_pWrite function pointer to the write function.
[in]pWriteCtxt_pWrite function pointer to the write function context.
[in]pOutSdo_ppointer to object instance.
Returns
uint32_t Returns the API error code.
Example
#include <ecSlvApi.h>
// required variables
EC_API_SLV_CoE_odAddRecord(ptEcSlvApi, 0x2002, "Test Record", 2, 80, ACCESS_READWRITE | OBJACCESS_RXPDOMAPPING | OBJACCESS_TXPDOMAPPING, NULL, NULL, &ptRecObj);
EC_API_SLV_configRecordSubIndex(ptEcSlvApi, ptRecObj, 1, "SubIndex 1", DEFTYPE_INTEGER32, 32, ACCESS_READ | OBJACCESS_TXPDOMAPPING);
Examples
ESL_cia402Obd.c.
OBJACCESS_TXPDOMAPPING
#define OBJACCESS_TXPDOMAPPING
Mappable in TxPDOs.
Definition: ecApiDef.h:143
ACCESS_READWRITE
#define ACCESS_READWRITE
Read/write in all states.
Definition: ecApiDef.h:132
DEFTYPE_INTEGER32
#define DEFTYPE_INTEGER32
INTEGER32.
Definition: ecApiDef.h:68
EC_API_SLV_SCoE_Object_t
struct EC_API_SLV_SCoE_Object EC_API_SLV_SCoE_Object_t
TSdo describes an Object Dictionary Object.
Definition: ecSlvApi.h:132
ACCESS_READ
#define ACCESS_READ
Read only in all states.
Definition: ecApiDef.h:133
EC_API_SLV_CoE_odAddRecord
uint32_t EC_API_SLV_CoE_odAddRecord(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint16_t index_p, char *pName_p, EC_API_SLV_CBObjRead_t cbRead_p, void *pReadCtxt_p, EC_API_SLV_CBObjWrite_t cbWrite_p, void *pWriteCtxt_p, EC_API_SLV_SCoE_Object_t **pOutSdo_p)
This function creates a Record Object.
Definition: ecSlvApi_CoEStub.c:731
OBJACCESS_RXPDOMAPPING
#define OBJACCESS_RXPDOMAPPING
Mappable in RxPDOs.
Definition: ecApiDef.h:142