PROFINET Device4.2.0
 
Loading...
Searching...
No Matches

◆ PN_API_IOD_arConnectCbf

typedef void(* PN_API_IOD_arConnectCbf) (PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_ArType_t arType, uint32_t arNum, uint16_t sessionKey, uint16_t sendClock, uint16_t redRatioIoCrIn, uint16_t redRatioIoCrOut, uint32_t hostIpAddr)

Callback function prototype to notify the user application that a new connection to an IO controller has been established.

The user application must save the AR information that it received from the stack within the implementation of this callback.

Parameters
[in]pnHandleProfinet API Handle.
[in]arTypeAR type.
[in]arNumAR number.
[in]sessionKeySession key.
[in]sendClockSend clock parameter.
[in]redRatioIoCrInReduction ratio of input IOCR.
[in]redRatioIoCrOutReduction ratio of output IOCR.
[in]hostIpAddrIP address of the host (IO controller).
Example
#include "pn_api_iod_callbacks.h"
#include "pn_api_iod_communication.h"
#include "pn_api_iod_startup.h"
//Implement the callback function in the user application
PN_API_IOD_ArType_t arType, uint32_t arNum, uint16_t sessionKey,
uint16_t sendClock, uint16_t redRatioIoCrIn, uint16_t redRatioIoCrOut,
uint32_t hostIpAddr)
{...}
PN_API_IOD_Handle_t* pnHandle = NULL;
uint32_t status;
pnHandle = PN_API_IOD_new();
//Store callback functions implemented by the user application
...}
//Register callback function
status = PN_API_IOD_registerCallbacks(pnHandle, &callbacks);
PN_API_IOD_Handle_t * PN_API_IOD_new(void)
Creates Profinet API handle.
uint32_t PN_API_IOD_registerCallbacks(PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_Callbacks_t *callbacksInst)
Register callback functions.
PN_API_IOD_ArType_t
AR type.
Definition pn_api_iod_types.h:244
struct PN_API_IOD_Handle PN_API_IOD_Handle_t
API handle instance which holds IO device's info.
Definition pn_api_iod_types.h:61
void PN_APP_IOD_cbArConnectInd(PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_ArType_t arType, uint32_t arNum, uint16_t arSessionKey, uint16_t sendClock, uint16_t redRatioIoCrIn, uint16_t redRatioIoCrOut, uint32_t hostIp)
Callback function prototype to notify that a new connection to an IO controller has been established.
PN_API_IOD_arConnectCbf arConnect
Definition pn_api_iod_callbacks.h:42
Structure representing a set of callbacks.
Definition pn_api_iod_callbacks.h:41