FC_BackupAllFiles - General Information
Type: |
Function |
Available as of: |
SystemInterface_1.34.1.0 |
Support for: |
- |
Versions: |
Current version |
Backup the data on the flash disk of the controller to a USB memory device.
This function copies the data of the controller to a USB memory device.
You can restore this backup to the data storage of the controller using FC_RestoreFiles
An absolute path, with the name of the USB device can be transferred (for example, "usb2msd:1/backup") or only the path on the USB device ("/backup").
The connected USB memory device is automatically selected for the backup.
You can choose USB device = "usb2msd:0" (USB device without partition table) or "usb2msd:1" (USB device with partition table)
It starts to copy as long as enough memory space is available on the device.
If the backup directory already exists and contains files, then the content is deleted. Therefore, if you want to preserve the existing data, you must move it to another directory before executing the function.
If the transfer is interrupted (for example, when disconnecting the USB device before the function has terminated), then the copying process must be restarted.
NOTE: The directory structure, except for the last subdirectory, has to be created beforehand: "usb2msd:0/Controller/Backup". The folder "Controller" has to exist, "Backup" is created.
The transfer can take a few minutes.
Input |
Data type |
Description |
---|---|---|
i_strBackupPath |
STRING[1023] |
Path for the backup |
Data type |
Description |
---|---|
DINT |
0: The copying was successful -1: Error detected when copying (USB device disconnected) -315: The USB device was not found. Verify whether the used identification of the device is correct and the USB device is connected to the controller. -316: Not enough memory available on the target device -318: Invalid path (path on flash disk or not existing path) |
Requirement
The complete content of the flash disk has to be saved on a USB device.
Program
diStatus := FC_BackupAllFiles('usb2msd:0/backup');
IF ( diStatus = 0 ) THEN
//copy successful
END_IF
Result
If there is enough memory space available on the USB device, the complete content of the controllers flash disk is copied on the USB device in the folder „backup“.
Existing files/subfolders in "/backup" are deleted.