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

◆ PN_API_IOD_initiateDataWrite()

uint32_t PN_API_IOD_initiateDataWrite ( PN_API_IOD_Handle_t *const  pnHandle)

Initiates data write in Profinet stack and Performs one-time exchange of IO input data between the user application and Profinet stack for all ARs (RT, IRT).

The stack allocates the data buffer and subsequently invokes PN_API_IOD_dataWriteCbf() for all submodules containing input data associated with an active IO-AR linked to an IO controller. The user application is then required to read the data from the input of the submodule and write it to the stack. This data is subsequently transmitted to the controller in the next transfer cycle, accompanied by the exchange of IOCS and IOPS.

Warning
This function operates synchronously, implying that it does not return until all PN_API_IOD_dataWriteCbf() calls have been executed.
Parameters
[in]pnHandleProfinet API Handle.
Returns
result of the operation as uint32_t.
Return values
PN_API_OKSuccess.
PN_API_NOT_OKSomething went wrong.
Example
#include "pn_api_iod_data.h"
PN_API_IOD_Handle_t* pnHandle = NULL;
uint32_t status;
pnHandle = PN_API_IOD_new();
//Implement PN_API_IOD_dataWriteCbf in the user application
...
//Register callback functions
...
status = PN_API_IOD_initiateDataWrite(pnHandle);
uint32_t PN_API_IOD_initiateDataWrite(PN_API_IOD_Handle_t *const pnHandle)
Initiates data write in Profinet stack and Performs one-time exchange of IO input data between the us...
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