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

◆ PN_API_IOD_dataReadIOxSOnlyCbf

typedef PN_API_IOD_IOXS(* PN_API_IOD_dataReadIOxSOnlyCbf) (PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_DevAddr_t *const addr, const PN_API_IOD_IOXS remoteIops)

Callback function prototype to update only IOxS for read.

This function is called by Profinet stack to notify the user application to set the IOPS status of the IO controller of a specific submodule to a specific value.

Parameters
[in]pnHandleProfinet API Handle.
[in]addrGeographical address (slot/subslot) of the module/submodule.
[in]remoteIopsIOPS from the IO controller, can be: PN_API_IOD_STATUS_BAD or PN_API_IOD_STATUS_GOOD.
Returns
Local IOCS as PN_API_IOD_IOXS.
Return values
PN_API_IOD_STATUS_GOODIOCS from the IO device is good.
PN_API_IOD_STATUS_BADIOCS from the IO device is bad.
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
PN_API_IOD_Handle_t *const pnHandle,
PN_API_IOD_DevAddr_t *const addr,
const PN_API_IOD_IOXS iops)
{...}
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.
#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
PN_API_IOD_IOXS PN_APP_IOD_cbDataReadIOxSOnly(PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_DevAddr_t *const addr, const PN_API_IOD_IOXS remoteIops)
Callback function to update only IOxS for read.
Module/Submodule address (logical/geographical).
Definition pn_api_iod_types.h:445
PN_API_IOD_dataReadIOxSOnlyCbf readIOxSDataOnly
Definition pn_api_iod_callbacks.h:61
Structure representing a set of callbacks.
Definition pn_api_iod_callbacks.h:41