CODESYS and the CODESYS standard runtime systems (with version 3.5.8.0 and later) support backing up application-specific files on the PLC. You can execute the required actions in the “Backup and Restore” tab of the generic device editor.
A backup consists of creating and saving a file in zip archive that contains the application-related
files and an information file meta.info
. This backup file has the extension TBF
(="Target Backup File") and can be saved in the local file system or on the PLC.
The following applies when restoring the software status from the backup file:
-
A dialog opens with a list of affected files on the PLC, and you can deactivate optional components.
-
We highly recommend to set the application to STOP mode for backup or restore. A dialog prompt will open to warn you about this.
-
The user interface is blocked when restoring to the PLC.
-
Existing files are overwritten without warning.
-
Existing boot applications are deactivated as soon as at least one new boot application is part of the restore.
See also
Creating backup files
Requirement: A project is open with an application that is running on the required
device. In addition, for this example an external file myExternalFile.txt
is inserted as an object below the application. This file is downloaded to the PLC
implicitly when downloading the application.
-
Open the device editor by double-clicking the device entry in the device tree. Click the “Backup and Restore” tab.
The tab opens with a menu bar including the “Backup” and “Restore” menus.
-
In the “Backup” menu, select the “Read Backup Information from Device” item.
If the PLC is not connected at the moment, then CODESYS opens a temporary connection to the device and reads the relevant files from the
$PlcLogic$
directory of the PLC into a table in the lower part of the tabbed page. In this example, at least the following files will be listed:$PlcLogic$/Application/Application.app
,$PlcLogic$/Application/Application.crc
, and$PlcLogic$/Application/myExternalFile.txt
. In addition, other external, project-dependent files are listed, which have been inserted below the application in the device tree. Furthermore, the source code archive file$PlcLogic$/Archive.prj
is listed if you have set the project setting for this (“Implicitly at program download and online change”) as the loading time. -
In the table, clear the check box for the
$PlcLogic$/Application//myExternalFile.txt
file in the “Active” column. -
Select “Save Backup File to Device” in the “Backup” menu.
The “Save as” dialog opens. The file type is predefine as “Backup files (*.tbf)”.
-
Select a location for the backup file and click “Save”.
Restoring from backup files
Requirement: A project is open with a PLC device connected. A backup file is saved to the local file system as described above.
-
Open the device editor by double-clicking the device entry in the device tree. Click the “Backup and Restore” tab.
Click “Restore Load Backup File from Disc”.
The default prompt opens for selecting a backup file
tbf
in the local file system. -
Select the backup file and click “Open”.
The files are read from the backup file and shown in the table of the dialog below. The file
$PlcLogic$/Application/myExternalFile.txt
that was excluded in the backup is missing. -
Click “Restore Restore Backup to Device”.
A dialog prompt opens with information about the actions when restoring.
-
Click “OK” to start restoring the files to the PLC file system.
When restore is complete, you are prompted to restart the PLC in order to activate the loaded application.