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

◆ PN_API_IOD_arInDataCbf

typedef void(* PN_API_IOD_arInDataCbf) (PN_API_IOD_Handle_t *const pnHandle, const uint16_t arNum, const uint16_t sessionKey)

Callback function prototype to inform the user application that the cyclic data communication was started.

When the stack receives the first real-time IO data frame from the IO controller, it calls this callback function which needs to be implemented by the user application to handle this update or at least display it.

Parameters
[in]pnHandleProfinet API Handle.
[in]arNumAR number.
[in]sessionKeySession key.
Example
#include "pn_api_iod_callbacks.h"
#include "pn_api_iod_data.h"
#include "pn_api_iod_startup.h"
//Implement the callback function in the user application
uint32_t PN_APP_IOD_cbArInData(PN_API_IOD_Handle_t *const pnHandle,
const uint16_t arNum, const uint16_t sessionKey)
{...}
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.
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_cbArInData(PN_API_IOD_Handle_t *const pnHandle, const uint16_t arNum, const uint16_t sessionKey)
Callback function to inform that the cyclic data communication was started.
PN_API_IOD_arInDataCbf arInData
Definition pn_api_iod_callbacks.h:57
Structure representing a set of callbacks.
Definition pn_api_iod_callbacks.h:41