...
The stack calls the callback handler registered via the function goal_eipNew(). The callback handler returns a GOAL_STATUS_T value.
parameters of the callback handler
Parameter | Description |
---|---|
GOAL_EIP_T *pHdlEip | GOAL EtherNet/IP handle |
GOAL_EIP_CB_ID_T id | callback id |
GOAL_EIP_CB_DATA_T *pCb | callback parameters |
Table: parameters of the callback handler
The callback parameter is an array of unions that has up to 10 elements.
Code Block | ||
---|---|---|
| ||
/****************************************************************************/ |
/** EtherNet/IP Callback |
*
This function collects all callbacks from the stack and decides if the
callback must be handled.
*/
Handler * * This function collects all callbacks from the stack and decides if the * callback must be handled. */ GOAL_STATUS_T main_eipCallback( |
GOAL_EIP_T *pHdlEip, |
/**< PROFINET handle */ |
GOAL_EIP_CB_ID_T id, |
/**< callback id */ |
GOAL_EIP_CB_DATA_T |
*pCb /**< callback parameters */ |
) |
{
{ GOAL_STATUS_T res = GOAL_OK; |
/* result */ |
switch (id) |
case
{ case GOAL_EIP_CB_ID_INIT: |
/* initialize application resources */ |
break; /*
break; /* ... */ |
} return res;
} return res; } |
GOAL_EIP_CB_ID_INIT
The stack was initialized. The application can initialize its resources.
...
Inform the application about a connection event
Parametercallback parameters of GOAL_EIP_CB_ID_CONNECT_EVENT
Element | Member | data type | Description |
---|---|---|---|
0 | outputAssembly | uint32_t | instance id of output assembly |
1 | inputAssembly | uint32_t | instance id of output assembly |
2 | connectionEvent | uint32_t | GOAL_EIP_CONNECTION_EVENT_* |
Table: callback parameters of GOAL_EIP_CB_ID_CONNECT_EVENT
Return Value
<ignored>
GOAL_EIP_CB_ID_ASSEMBLY_DATA_RECV
New data for an assembly has been received.
Parameter
callback parameters of GOAL_EIP_CB_ID_ASSEMBLY_DATA_RECV
Element | Member | data type | Description |
---|---|---|---|
0 | instanceNr | uint32_t | instance id of assembly |
Table: callback parameters of GOAL_EIP_CB_ID_ASSEMBLY_DATA_RECV
Return Value
GOAL_OK - success
...
Inform application that data of an assembly will be sent.
Parametercallback parameters of GOAL_EIP_CB_ID_ASSEMBLY_DATA_SEND
Element | Member | data type | Description |
---|---|---|---|
0 | instanceNr | uint32_t | instance id of assembly |
Table: callback parameters of GOAL_EIP_CB_ID_ASSEMBLY_DATA_SEND
Return Value
GOAL_OK - data has changed
...
Inform application that the Run/Idle header of consumed cyclic data has changed.
Parameter
callback parameters of GOAL_EIP_CB_ID_RUN_IDLE_CHANGED
Element | Member | data type | Description |
---|---|---|---|
0 | outputAssembly | uint32_t | instance id of output assembly |
1 | inputAssembly | uint32_t | instance id of output assembly |
2 | runIdleValue | uint32_t | current value of the run/idle flag |
Table: callback parameters of GOAL_EIP_CB_ID_RUN_IDLE_CHANGED
Return Value
<ignored>
GOAL_EIP_CB_ID_LED_CHANGED
Inform the application that a Module Status or Network Status LED must be changed. The parameter contains a bitmap made out of GOAL_EIP_LED_* macros. If a bit is set the corresponding LED must be set. Otherwise it must be cleared.
Parametercallback parameters of GOAL_EIP_CB_ID_LED_CHANGED
Element | Member | data type | Description |
---|---|---|---|
0 | leds | uint32_t | bitmap of active LEDs |
Table: callback parameters of GOAL_EIP_CB_ID_LED_CHANGED
Return Value
<ignored>
GOAL_EIP_CB_ID_DEVICE_RESET
Inform the application that the device will be reset. Depending on the platform the device is either reset or the reset is only simulated. Therefore the application must reinitialize its resources. The callback parameter indicates the reset type.
Parameter
Element | Member | data type | Description |
---|---|---|---|
0 | resetState | uint32_t | GOAL_EIP_RESET_* |
Table: callback parameters of GOAL_EIP_CB_ID_LED_CHANGED
Return Value
<ignored>
GOAL_EIP_CB_ID_REVISION_CHECK
If the compatibility bit is set in the Electronic Key Segment the application can decide whether a Minor Revision is supported or not. This means the application can decide if it is stil compatible to a previous revision of itself.
Parameter
Element | Member | data type | Description |
---|---|---|---|
0 | resetStateminorRevision | uint32uint8_t | requested minor revision of application |
Table: callback parameters of GOAL_EIP_CB_ID_
...
REVISION_
...
CHECK
Return Value<ignored>
GOAL_OK Revision is supported
other Revision is not supported