RdcyAcyclicFileTransferAsync (FUN)¶
FUNCTION RdcyAcyclicFileTransferAsync : RTS_IEC_RESULT
Synchronize a file specified by name asynchronously in acyclic context (non-blocking).
This function has non-blocking (asynchronous) behavior. The acyclic file transfer module will call the AsyncJobDone method of the iTransferAsyncDoneCallback Interface when the transfer job has been processed. The result of the internal file transfer 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 iTransferAsyncDoneCallback parameter.
- InOut:
Scope
Name
Type
Comment
Return
RdcyAcyclicFileTransferAsyncRTS_IEC_RESULTError code (see CmpErrors.library). ERR_PENDING if the asynchronous send job has been successfully added to the job queue, ERR_PARAMETER if pcszAcyclicDataUUID or pcszLocalFileName is NULL, 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_ACCESS_RIGHTS if any of the two file names is not allowed to be accessed from IEC applications.
Input
pcszAcyclicDataUUIDREFERENCE TO STRING
IN: The same Data UUID, which was used for registration with the RdcyAcyclicRegisterUsage FUNCTION
pcszLocalFileNameREFERENCE TO STRING
IN: Path to the local file to be synchronized to the other PLC. This can be a full file path or a path containing placeholders as defined in the ‘SysFile’ section
pcszPeerFileNameREFERENCE TO STRING
IN: Path to the file on the partner PLC. This can be a full file path or a path with placeholders as defined in the ‘SysFile’ section. If NULL is provided, the same path as pcszLocalFileName is used
iTransferAsyncDoneCallbackIRdcyAcyclicAsyncJobDoneCallbackINOUT: FB whichs AsyncJobDone method will be called when the asynchronous file transfer job of this function has been processed