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

◆ PN_API_IOD_enterDbai()

uint32_t PN_API_IOD_enterDbai ( PN_API_IOD_Handle_t *const  pnHandle)

Acquires the semaphore of the IOD thread.

This function ensures that application access to shared data is safeguarded against callback functions. This precautionary measure is taken to prevent the inadvertent deletion of this data in case the AR unexpectedly terminates while the application is still utilizing it.

Warning
This function must be called before PN_API_IOD_lockDbaiBuf().
Parameters
[in]pnHandleProfinet API Handle.
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_dbai.h"
PN_API_IOD_Handle_t* pnHandle = NULL;
uint32_t status;
pnHandle = PN_API_IOD_new();
status = PN_API_IOD_enterDbai(pnHandle);
uint32_t PN_API_IOD_enterDbai(PN_API_IOD_Handle_t *const pnHandle)
Acquires the semaphore of the IOD thread.
PN_API_IOD_Handle_t * PN_API_IOD_new(void)
Creates Profinet API handle.
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