RdcyAcyclicDirMirror (FUN)¶
FUNCTION RdcyAcyclicDirMirror : RTS_IEC_RESULT
Mirror a directory synchronously (blocking) in acyclic context. Replaces all different items on the other PLC, deletes any orphans on the target side, and copies any source side orphans to the target side. Orphan file: File, that does not exist on other side. Makes the target side exactly the same as the source side. It will overwrite different files regardless of whether they are newer, older, or have the same timestamps. Orphans on the source side are copied and orphans on the target side are deleted.
After a successful synchronization 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 mirrored in the pBuffer element and the strlen of the directory name in the length member of the struct.
This function has the following blocking (synchronous) behavior: It will block until any other previous call of this function has finished. It will block until the whole directory is mirrored. It will interrupt when an error occurs in the underlying transmission.
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.
- InOut:
Scope
Name
Type
Comment
Return
RdcyAcyclicDirMirrorRTS_IEC_RESULTError code (see CmpErrors.library). ERR_OK if the directory was successfully mirrored, ERR_FAILED if some internal error in underlying functions occurred (see debug logger for details), ERR_NOTINITIALIZED if the acyclic data transfer module is not in the RA_STATE_PROTOCOL_VER_SUCCEEDED RdcyAcyclicState, ERR_PARAMETER if one of the parameters is invalid, ERR_NO_OBJECT if there is no usage with this data UUID registered, ERR_TIMEOUT if the acknowledge of the internal acyclic network protocol hasn’t been received, 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
pcszAcyclicDataUUIDREFERENCE TO STRING
IN: The same Data UUID, which was used for registration with the RdcyAcyclicRegisterUsage FUNCTION.
pcszSrcDirNameREFERENCE 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.
pcszDestDirNameREFERENCE 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.