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

◆ PN_API_IOD_activateIsoIsrObj()

uint32_t PN_API_IOD_activateIsoIsrObj ( PN_API_IOD_Handle_t *const  pnHandle,
const uint32_t  nsDelayTime,
const uint8_t  isomEvent 
)

Activate an isochronous event interrupt after/before a specified delay to a new cycle. The service
scans for an available object and sets it up (typically used to setup Ti/To events that can be handled by implementing and registering the callback function PN_API_IOD_isoInterruptEventCbf().

Parameters
[in]pnHandleProfinet API Handle.
[in]nsDelayTimeDelay value added to new cycle in nsec.
[in]isomEventIsochronous ISR event ID (PN_API_IOD_TI_ISR_EVENT or PN_API_IOD_TO_ISR_EVENT).
Returns
result of the operation as uint32_t.
Return values
PN_API_OKSuccess.
PN_API_NOT_OKSomething went wrong.
PN_API_ERR_PARAMInvalid parameter.
Example
#include "pn_api_iod_isoch.h"
#include "pn_api_iod_startup.h"
PN_API_IOD_Handle_t* pnHandle = NULL;
uint32_t status;
uint32_t to; //Usually obtained from the PLC
uint8_t isrEventID = PN_API_IOD_TO_ISR_EVENT;
pnHandle = PN_API_IOD_new();
//Implement and store PN_API_IOD_isoInterruptEventCbf() in the user application
status = PN_API_IOD_activateIsoIsrObj(pnHandle, to, isrEventID);
PN_API_IOD_Handle_t * PN_API_IOD_new(void)
Creates Profinet API handle.
uint32_t PN_API_IOD_activateIsoIsrObj(PN_API_IOD_Handle_t *const pnHandle, const uint32_t nsDelayTime, const uint8_t isomEvent)
Activate an isochronous event interrupt after/before a specified delay to a new cycle....
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