Function Block FS_COPY

The Function Block FS_COPY copies a file.

Warning: Existing files are overwritten without warning.

The File System must have been initialized beforehand using FS_INIT. All operations occur asynchronously per configured storage medium.

Input COPY

A positive edge triggers the file to be copied on the storage medium.

Input DEV

Defines the device from which files are accessed. The device is used per project and can be managed in the context menu under Project External Storage.

Input SRC_PATH

Specifies the source path to the file on the storage medium. The path corresponds to a Unix file path in UTF-8 format, if supported. The path is represented as follows:

Folder/Subfolder/File.txt

Input DEST_PATH

Specifies the destination path to the file on the storage medium. The full path name must be provided.

Input OVERWRITE

If the input is true, overwriting of files is allowed.

Output DONE

The output returns a pulse upon success to perform the next operation. The pulse occurs at the end of the process, even if an error has occurred.

Output ERROR

In case of an error, it returns a text with an error message. This is FALSE if no error has occurred. The state is stored for later use.

Possible causes:

  • The service of the storage medium was not started.
  • The memory was not initialized.
  • The login credentials are invalid.
  • The remote server could not be reached.
  • The storage medium does not exist.
  • The specified path is invalid.
  • Writing to the storage medium is not possible.
  • No more memory space available on the storage or the storage is write-protected.