EtherCAT SubDevice
 
Loading...
Searching...
No Matches

◆ EC_API_SLV_CoE_odAddRecord()

uint32_t EC_API_SLV_CoE_odAddRecord ( EC_API_SLV_SHandle_t pHandle,
uint16_t  index,
char *  pName,
EC_API_SLV_CBObjRead_t  cbRead,
void *  pReadCtxt,
EC_API_SLV_CBObjWrite_t  cbWrite,
void *  pWriteCtxt,
EC_API_SLV_SCoE_Object_t **  ppOutSdo 
)

This function creates a Record Object.

Parameters
[in]pHandleThe pointer to the EtherCAT API instance.
[in]indexrecord index number.
[in]pNameentry name.
[in]cbReadRead function pointer to the read function.
[in]pReadCtxtRead function pointer to the read function context.
[in]cbWriteWrite function pointer to the write function.
[in]pWriteCtxtWrite function pointer to the write function context.
[in]pOutSdopointer to SDO 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, &ptOutObject);
uint32_t EC_API_SLV_CoE_configRecordSubIndex(EC_API_SLV_SHandle_t *pHandle, EC_API_SLV_SCoE_Object_t *pObject, uint8_t subIndex, char *pName, uint16_t type, uint16_t bitLen, uint16_t flags)
This function creates a subIndex for the Record Object.
Definition ecSlvApi_CoE.c:3268
uint32_t EC_API_SLV_CoE_odAddRecord(EC_API_SLV_SHandle_t *pHandle, uint16_t index, char *pName, EC_API_SLV_CBObjRead_t cbRead, void *pReadCtxt, EC_API_SLV_CBObjWrite_t cbWrite, void *pWriteCtxt, EC_API_SLV_SCoE_Object_t **ppOutSdo)
This function creates a Record Object.
Definition ecSlvApi_CoE.c:1974
#define ACCESS_READWRITE
Read/write in all states.
Definition ecSlvApiDef_CoE.h:134
#define ACCESS_READ
Read only in all states.
Definition ecSlvApiDef_CoE.h:135
#define OBJACCESS_TXPDOMAPPING
Mappable in TxPDOs.
Definition ecSlvApiDef_CoE.h:145
#define OBJACCESS_RXPDOMAPPING
Mappable in RxPDOs.
Definition ecSlvApiDef_CoE.h:144
#define DEFTYPE_INTEGER32
INTEGER32.
Definition ecSlvApiDef_CoE.h:43
Definition ecSlvApiInternal.h:143
Examples
ESL_cia402Obd.c.