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

◆ EC_API_SLV_CoE_odAddVariable()

uint32_t EC_API_SLV_CoE_odAddVariable ( EC_API_SLV_SHandle_t pHandle,
uint16_t  index,
char *  pName,
uint16_t  type,
uint16_t  bitLen,
uint16_t  flags,
EC_API_SLV_CBObjRead_t  cbRead,
void *  pReadCtxt,
EC_API_SLV_CBObjWrite_t  cbWrite,
void *  pWriteCtxt 
)

This function creates a Base Data Type Object for the Object Dictionary.

Parameters
[in]pHandleThe pointer to the EtherCAT API instance.
[in]indexarray index number
[in]pNameentry name
[in]typebase type (USINT, UDINT...).
[in]bitLenbit length of the data type
[in]flagsRead, Write, PDO Mapping and other flags
[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
Returns
uint32_t Returns the API error code.
Example
#include <ecSlvApi.h>
// required variables
uint32_t retVal = 0;
// the Call
retVal = EC_API_SLV_CoE_odAddVariable(ptEcSlvApi, 0x2001, "Test Variable", DEFTYPE_INTEGER32, 32, ACCESS_READWRITE, NULL, NULL);
uint32_t EC_API_SLV_CoE_odAddVariable(EC_API_SLV_SHandle_t *pHandle, uint16_t index, char *pName, uint16_t type, uint16_t bitLen, uint16_t flags, EC_API_SLV_CBObjRead_t cbRead, void *pReadCtxt, EC_API_SLV_CBObjWrite_t cbWrite, void *pWriteCtxt)
This function creates a Base Data Type Object for the Object Dictionary.
Definition ecSlvApi_CoE.c:1606
#define ACCESS_READWRITE
Read/write in all states.
Definition ecSlvApiDef_CoE.h:134
#define DEFTYPE_INTEGER32
INTEGER32.
Definition ecSlvApiDef_CoE.h:43
Examples
ESL_cia402Obd.c.