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

◆ PN_APP_IOD_initCyclicDataExchange()

uint32_t PN_APP_IOD_initCyclicDataExchange ( PN_API_IOD_Handle_t *const  pnHandle)

Initiates continuous exchange of IO data between the user application and Profinet stack for all ARs (RT, IRT).

Upon this function call, an infinite thread starts and runs in parallel to Profinet stack. The purpose of this thread is to continuously call data input and output trigger functions (PN_API_IOD_initiateDataRead() and PN_API_IOD_initiateDataWrite()) whenever the stack is done doing a single IO data exchange. Hence, the IO data exchange between the user application and Profinet stack can keep going.

Remarks
Without this thread, the IO data exchange between the IO device and IO controller would still take place but on the stack level (isolated from the user application). This means, the cyclic exchange will continue but the values of input/output data won't be up to date.
Warning
Initiating the thread handling the IO data exchange on the user application level does not include activating this process on the stack level. This mean, the thread will be blocked in "waiting state" until PN_API_IOD_activateCyclicDataExchange() is called.
Parameters
[in]pnHandleProfinet API Handle.
Returns
result of the operation as uint32_t
Return values
PN_API_OKSuccess.
PN_API_NOT_OKSomething went wrong.