Creating and Using Sandboxes
What is a CODESYS sandbox?
A CODESYS sandbox is an isolated instance of CODESYS which does not change or influence the environment/machine where it is running. Everything that belongs to this instance – all settings and repositories – is located in the defined "root directory" of the sandbox on the computer. By moving/copying this root directory, a sandbox can simply be moved to a new computer and used there as an installation. No new installation is required.
A sandbox is useful for "freezing" and archiving the CODESYS environment for a completed project so that it is easy to make changes to the project again at a later date. Because the versions within the sandbox do not change, it is always possible to log in without an online change.
A sandbox is also useful if several developers need to continue working on the same project. In this case, the versions used (CODESYS and packages) must be defined at the start of the project. Then a sandbox can be created and distributed to the developers.
The disadvantages of a sandbox are the additional storage space required and the management overhead.
What is a "clean sandbox"?
A clean sandbox only contains exactly those versions of devices/libraries/styles that match the CODESYS version which is used as the origin of the sandbox. A "simple" sandbox, on the other hand, usually already contains multiple versions of the same device/library because they were already included in the underlying CODESYS version. To prevent mixing of versions, you can use the Create Clean Sandbox from Setup function in the CODESYS Installer.
Note
A "clean sandbox" can be created only with CODESYS versions >= SP19 Patch 6.
Note
A CODESYS sandbox cannot be updated to a newer patch version.
Prerequisites and Gateway Setup
To run a sandbox, some prerequisites in the form of files must be available in the sandbox directory; otherwise CODESYS cannot start. These files are created when the sandbox is created. The setup for the CODESYS Gateway is also saved in the sandbox directory. As soon as the CODESYS Gateway and the prerequisites are installed on a computer, they can be used by any sandbox of the same CODESYS version on the computer.
Important
Because CODESYS does not support unlimited long file system paths, please use the shortest possible paths for sandbox root directories.
Open the Installations view of the CODESYS Installer.
To create a sandbox for an existing installation, select the Create sandbox command in the tile for this installation. Note: In this case, a "clean sandbox" is not created. You can only get a clean sandbox by using the Create clean sandbox from setup command.
The dialog for selecting a root directory for the sandbox in the local file system opens.
Select a root directory. Keep the path as short as possible.
After confirming the selection, the sandbox immediately starts to be created. A dialog opens, displaying the creation progress and the option to cancel.
When the sandbox is completed, you will receive a message that access to the sandbox is not restricted and that you need to make sure that only authorized people can access the sandbox directory.
The sandbox is displayed as an additional tile, highlighted in color, and with the
icon in the Installations view.
Using the Duplicate Sandbox button, you can now duplicate the root directory of the sandbox for further distribution and store it in the file system.
You can register an installation which is located in a sandbox. This will add it as another installation on your computer with a tile in CODESYS Installer.
Open the Installations view of the CODESYS Installer.
In the
list box of the Add Installation command button, click the Register Sandbox button.
The Register Sandbox dialog opens.
Specify the directory in the local file system which should be used as the root directory of the sandbox.
Decide whether or not the gateway services should also be downloaded and installed if they are not yet available in the sandbox. Note: If the gateway services for the same CODESYS version are already available in a sandbox, then they can also be used by the new sandbox to be registered.
Select the check box before the note about the potential security risk. Only then can you click OK to complete the registration.
If a gateway installation has been performed, then you will first get a dialog where you need to confirm this. After that, the sandbox is added as a tile in the Installations view.
You can also manage the sandbox installations in the settings of CODESYS Installer. You can see which sandboxes are currently registered, make new registrations, and exclude sandbox directories from possible registration.
Open the Installations view of the CODESYS Installer.
In the Installer window, click Settings command from the
menu in the top right corner.
The Settings dialog opens.
Click Sandboxes.
The section under sandboxes shows which sandboxes are currently registered on the computer and which are excluded.
If you confirm the option with the security notice, then you can use the button to register additional sandboxes.
Under Excluded sandbox directories, you can specify root directories which should not be displayed in the Installer. This can be helpful if a parent directory is specified when adding a sandbox, but not all sandboxes contained in the directory are to be displayed.