EtherNet/IP™ Adapter3.09.00
 
Loading...
Searching...
No Matches

◆ EI_API_CIP_createCfgAssembly()

uint32_t EI_API_CIP_createCfgAssembly ( T *  pCipNode_p,
uint16_t  assemblyInstanceId_p,
EI_API_CIP_CBCfgAssembly  fuCfgAssemblyCb_p 
)

Creates configuration assembly instance under Assembly Object class.

Creates configuration assembly and registers routed callback if configuration assembly callback parameter is not equal NULL.

Remarks
For standard configuration assembly set callback parameter to NULL and set a callback afterwards by EI_API_CIP_setCfgAssemblyCb function call.
Parameters
[in]pCipNode_pPointer to the CIP node.
[in]assemblyInstanceId_pConfiguration assembly instance identifier.
[in]fuCfgAssemblyCb_pRouted configuration assembly callback function pointer.
Returns
EI_API_CIP_EError_t as uint32_t value.
Return values
EI_API_CIP_eERR_OKSuccess.
EI_API_CIP_eERR_NODE_INVALIDCIP node is invalid, possibly EI_API_CIP_NODE_new() was not called.
EI_API_CIP_eERR_NOT_IMPLEMENTEDCallback function pointer set to NULL.
EI_API_CIP_eERR_INSTANCE_DOES_NOT_EXISTThe assembly with the given ID could not be found.
EI_API_CIP_eERR_ASSEMBLY_ALREADY_EXISTSThe assembly with the given ID already exists.
EI_API_CIP_eERR_MEMALLOCMemory allocation error.
Example
#include "EI_API.h"
uint32_t EI_APP_cfgAssemblyCb (EI_API_CIP_NODE_T* pCipNode_p,
uint16_t o2t_p,
uint16_t t2o_p,
uint16_t cfg_inst_p,
const uint8_t* const cfg_data_p,
uint16_t cfg_data_size_p)
{
}
void EI_APP_cipInit (void)
{
EI_API_ADP_T* pEI_API_ADP = NULL;
EI_API_CIP_NODE_T* pEI_API_CIP_NODE = NULL;
uint32_t errCode;
uint8_t numInterfaces = 1;
uint16_t cfgAssemblyInstanceId;
// Create a new adapter first
pEI_API_ADP = EI_API_ADP_new(numInterfaces);
// Create a CIP node next
initParams.maxInstanceNum = 256;
pEI_API_CIP_NODE = EI_API_CIP_NODE_new(&initParams);
...
// Under pEI_API_CIP_NODE, create assembly instance with ID = 103, with read-write access
cfgAssemblyInstanceId = 0x67;
errCode = EI_API_CIP_createCfgAssembly(pEI_API_CIP_NODE, cfgAssemblyInstanceId, NULL);
// Set configuration assembly callback
errCode = EI_API_CIP_setCfgAssemblyCb(pEI_API_CIP_NODE, cfgAssemblyInstanceId, EI_APP_cfgAssemblyCb);
...
}
ETHIP_API T * EI_API_ADP_new(uint8_t numInterfaces_p)
Create a new EtherNet/IP adapter.
Definition EI_API_ADP_stub.c:231
ETHIP_API uint32_t EI_API_CIP_setCfgAssemblyCb(T *pCipNode_p, uint16_t assemblyInstanceId_p, EI_API_CIP_CBCfgAssemblySimple fuCfgAssemblyAccess_p)
Set configuration assembly callback.
Definition EI_API_CIP_stub.c:5380
ETHIP_API uint32_t EI_API_CIP_createCfgAssembly(T *pCipNode_p, uint16_t assemblyInstanceId_p, EI_API_CIP_CBCfgAssembly fuCfgAssemblyAccess_p)
Creates configuration assembly instance under Assembly Object class.
Definition EI_API_CIP_stub.c:5244
@ EI_API_eERR_CB_NO_ERROR
Definition EI_API_def.h:147
ETHIP_API T * EI_API_CIP_NODE_new(EI_API_CIP_NODE_InitParams_t *pInitParams)
Create a new CIP node.
Definition EI_API_CIP_stub.c:81
uint16_t maxInstanceNum
Definition EI_API_CIP_define.h:162
Initialization parameters to create new CIP Node.
Definition EI_API_CIP_define.h:161
See also
EI_API_CIP_createCfgAssembly EI_API_CIP_setCfgAssemblyCb EI_API_CIP_EError_t