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

◆ PN_API_IOD_asyncReqDoneCbf

typedef void(* PN_API_IOD_asyncReqDoneCbf) (PN_API_IOD_Handle_t *const pnHandle, const uint32_t arNum, const PN_API_IOD_AlarmType_t alarmType, const uint32_t api, PN_API_IOD_DevAddr_t *const addr, const uint32_t status, const uint16_t diagnosisTag)

Callback function prototype to acknowledge an asynchronous request issued by the user application to the Profinet stack. Currently, only alarms are implemented as asynchronous requests.

If the submodule to which the alarm has been assigned, is not included in a running AR, then arNum is set to 0 by the stack to refer to a dummy acknowledgement.

Parameters
[in]pnHandleProfinet API Handle.
[in]arNumAR number.
[in]alarmTypeAlarm type (see PN_API_IOD_AlarmType_t).
[in]apiApplication Process Identifier.
[in]addrGeographical address (slot/subslot) of the module/submodule.
[in]statusPN_API_OK or PN_API_NOT_OK.
[in]diagnosisTagDiagnosis tag which distinguishes different alarms on one subslot (can not be 0).
Example
#include "pn_api_iod_alarm.h"
#include "pn_api_iod_callbacks.h"
#include "pn_api_iod_startup.h"
//Implement the callback function in the user application
PN_API_IOD_Handle_t *const pnHandle,
uint32_t arNum, PN_API_IOD_AlarmType_t alarmType,
uint32_t api, PN_API_IOD_DevAddr_t *addr,
uint32_t status, uint16_t diagnosisTag)
{...}
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_AlarmType_t
Alarm type.
Definition pn_api_iod_types.h:165
#define PN_API_IOD_IOXS
IO provider/consumer status.
Definition pn_api_iod_types.h:44
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_cbAsyncReqDone(PN_API_IOD_Handle_t *const pnHandle, uint32_t arNum, PN_API_IOD_AlarmType_t alarmType, uint32_t api, PN_API_IOD_DevAddr_t *addr, uint32_t status, uint16_t diagnosisTag)
Callback function to acknowledge an asynchronous request (alarm) issued previously from the applicati...
Module/Submodule address (logical/geographical).
Definition pn_api_iod_types.h:445
PN_API_IOD_asyncReqDoneCbf asyncReqDone
Definition pn_api_iod_callbacks.h:65
Structure representing a set of callbacks.
Definition pn_api_iod_callbacks.h:41