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

◆ EI_API_CIP_setRoutingRoutablePorts()

uint32_t EI_API_CIP_setRoutingRoutablePorts ( T *  pCipNode_p,
const uint8_t *  pRoutablePortTable_p,
uint8_t  mapSize_p 
)

Provides setup of routable ports.

Function can be called just once in time of initialization. On next attempt a new setup will be ignored.

Parameters
[in]pCipNode_pPointer to the CIP node.
[in]pRoutablePortTable_pRoutable port array of uint8_t values. Each value in array represents one port number.
[in]mapSize_pSize of routable port array.
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_IMPLEMENTEDParameter pRoutablePortTable_p set to NULL.
Example
#include "EI_API.h"
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 classId = 0x10D;
uint8_t maxLinkAddr = 8,
const uint8_t routablePorts[] = {11, 7, 3};
// 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);
// Create a class
errCode = EI_API_CIP_createClass(pEI_API_CIP_NODE, classId);
errCode = EI_API_CIP_setRoutingMaxLinkAddr(pEI_API_CIP_NODE, maxLinkAddr);
errCode = EI_API_CIP_setRoutingRoutablePorts(pEI_API_CIP_NODE, routablePorts, sizeof(routablePorts)/sizeof(uint8_t));
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_createClass(T *pCipNode_p, uint16_t classId_p)
Create a CIP class.
Definition EI_API_CIP_stub.c:215
ETHIP_API uint32_t EI_API_CIP_setRoutingMaxLinkAddr(T *pCipNode_p, uint8_t linkAddr_p)
Initialize a maximum number of link addresses used by application.
Definition EI_API_CIP_stub.c:5457
ETHIP_API uint32_t EI_API_CIP_setRoutingRoutablePorts(T *pCipNode_p, const uint8_t *pRoutablePortTable_p, uint8_t mapsize_p)
Provides setup of routable ports.
Definition EI_API_CIP_stub.c:5609
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_createClass EI_API_CIP_setRoutingMaxLinkAddr EI_API_CIP_EError_t