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

◆ PN_API_IOD_newModPlugCbf

typedef void(* PN_API_IOD_newModPlugCbf) (PN_API_IOD_Handle_t *const pnHandle, const PN_API_IOD_DevAddr_t *const addr, const uint32_t inDataLen, const uint32_t outDataLen)

Callback function prototype to indicate the plug of a module.

When a module is plugged, Profinet stack sends a plug indication to the user application indicating the geographical address and data length of the plugged module.

Parameters
[in]pnHandleProfinet API Handle.
[in]addrGeographical address (slot/subslot) of the module/submodule.
[in]inDataLenLength of input data.
[in]outDataLenLength of output data.
Example
#include "pn_api_iod_callbacks.h"
#include "pn_api_iod_device.h"
#include "pn_api_iod_startup.h"
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_cbNewModPlug(PN_API_IOD_Handle_t *const pnHandle, const PN_API_IOD_DevAddr_t *const addr, const uint32_t inDataLen, const uint32_t outDataLen)
Callback function to indicate the plug of a module.
PN_API_IOD_newModPlugCbf newModPlug
Definition pn_api_iod_callbacks.h:64
Structure representing a set of callbacks.
Definition pn_api_iod_callbacks.h:41