RdcyAcyclicSendAsync (FUN)ΒΆ
FUNCTION RdcyAcyclicSendAsync : RTS_IEC_RESULT
Send acyclic data asynchronous (non-blocking).
This function has non-blocking (asynchronous) behavior. The acyclic data transfer module will call the AsyncJobDone method of the iSendAsyncDoneCallback Interface when the send job has been processed. The result of the send call will be passed to the jobResult parameter of that callback function.
Precondition: The acyclic data transfer module has to be in the RA_STATE_PROTOCOL_VER_SUCCEEDED RdcyAcyclicState. Hint: The current state of the acyclic data transfer module can be queried with the RdcyAcyclicGetCurState function.
Note: We do not need a user-data pointer. Any user-data can be passed as data members of the function block passed in the iSendAsyncDoneCallback parameter.
- InOut:
Scope
Name
Type
Comment
Return
RdcyAcyclicSendAsyncRTS_IEC_RESULTError code (see CmpErrors.library). ERR_PENDING if the asynchronous send job has been successfully added to the job queue, ERR_PARAMETER if (length > RdcyAcyclicGetMaxPayloadSize()), ERR_NO_OBJECT if there is no usage with this data UUID registered, ERR_FAILED if adding a send job to the send queue of the AsyncMgr failed (see log for more information), ERR_NOTINITIALIZED if the acyclic data transfer module has not been correctly initialized during initialization of the CmpRedundancy component, ERR_NOBUFFER if the maximum number of concurrent send jobs is exhausted at the moment, or ERR_NO_MEMORY if the memory for the send buffer could not be allocated.
Input
pcszAcyclicDataUUIDREFERENCE TO STRING
IN: The same Data UUID, which was used for registration with the RdcyAcyclicRegisterUsage FUNCTION
pcBufferPOINTER TO BYTE
IN: A pointer to the buffer containing the data to transmit
lengthDWORDIN: The length of the data pointed to by the pcBuffer parameter
iSendAsyncDoneCallbackIRdcyAcyclicAsyncJobDoneCallbackINOUT: FB whichs AsyncJobDone method will be called when the asynchronous send job of this function has been processed