RdcyAcyclicDirCopy (FUN)¶
FUNCTION RdcyAcyclicDirCopy : RTS_IEC_RESULT
Copy a directory synchronously (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 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 copied. 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
RdcyAcyclicDirCopyRTS_IEC_RESULTError code (see CmpErrors.library). ERR_OK if the directory was successfully copied, 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.