Backup and Restore

CODESYS and the CODESYS Development System 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 file 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 box opens with a list of affected files on the PLC, and you can deactivate optional components.
  • If you have to set the application to STOP mode for backup or restore, a dialog prompt will open to warn you about this- Warnings also open when incompatibilities are detected.
  • 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.

  1. Open the device editor by double-clicking the device entry in the device tree. Click the Backup and Restore tab.

    The tabbed page opens with a menu bar including the Backup and Restore menus.

  2. 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.

  3. In the table, clear the check box for the $PlcLogic$/Application//myExternalFile.txt file in the Active column.

  4. Select Save backup file to device in the Backup menu.

    The Save As dialog box opens. The file type is predefine as Backup files (*.tbf).

  5. Select a storage location for the backup file and click Save.

See also

Restoring from backup files

Requirement: A project is open with an application that is running on the required device. A backup file is saved to the local file system as described above.

  1. 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.

  2. 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.

  3. Click Restore ‣ Restore backup to device.

    A dialog prompt opens with information about the actions when restoring.

  4. 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.