RdcyAcyclicDirCopyAsync (FUN)

FUNCTION RdcyAcyclicDirCopyAsync : RTS_IEC_RESULT

Copy a directory specified by name asynchronously (non-blocking) in acyclic context. Copies all files from this PLC to the other PLC, overwriting any existing files on the target side. After a successful copy the receive event created when the corresponding UUID was registered, will be posted. The EVTPARAM_CmpRdcyAcyclicRecv of this event includes the directory name that was copied in the pBuffer element and the strlen of the directory name in the length member of the struct.

This function has non-blocking (asynchronous) behavior. The acyclic directory synchronization module will call the AsyncJobDone method of the iCopyAsyncDoneCallback Interface when the copy job has been processed. The result of the internal directory copy 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 iCopyAsyncDoneCallback parameter.

InOut:

Scope

Name

Type

Comment

Return

RdcyAcyclicDirCopyAsync

RTS_IEC_RESULT

Error code (see CmpErrors.library). ERR_PENDING if the asynchronous send job has been successfully added to the job queue, ERR_PARAMETER if pcszAcyclicDataUUID or pcszSrcDirName 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 directories is not allowed to be accessed from IEC applications.

Input

pcszAcyclicDataUUID

REFERENCE TO STRING

IN: The same Data UUID, which was used for registration with the RdcyAcyclicRegisterUsage FUNCTION

pcszSrcDirName

REFERENCE TO STRING

IN: UTF-8 encoded source directory name including relative path, relative to the working directory of the PLC, with forward slashes (/) as path separators, with strlen() <= maxPayloadSize. This can be a full directory path or a path containing placeholders as defined in the ‘SysDir’ section.

pcszDestDirName

REFERENCE TO STRING

IN: UTF-8 encoded destination directory name on the other PLC including relative path, relative to the working directory of the other PLC, with forward slashes (/) as path separators, with strlen() <= maxPayloadSize. This can be a full directory path or a path containing placeholders as defined in the ‘SysDir’ section.

iCopyAsyncDoneCallback

IRdcyAcyclicAsyncJobDoneCallback

INOUT: FB whichs AsyncJobDone method will be called when the asynchronous directory copy job of this function has been processed