Skip to main content

Installing a Library Project to the Library Repository

The following guide will show you how to create a compiled library from a fully developed library project. Then this compiled library is installed in your default library repository so that the function blocks of the library can be referenced in other projects.

Tip

A compiled library generated in CODESYS 4 can also be installed in a library repository of CODESYS 3.

Requirement: A workspace with a fully developed library project is open.

  1. In the open workspace, right-click the <library project>.fbslib library and select the Save Compiled Library command in the context menu.

  2. In the Save Compiled Library <library name>.fbslib dialog, fill in the following fields:

    • Destination path: Path of the folder where the compiled library should be saved

    • Compression level: Setting for how the compiled library should be compressed

    • Compiler target version: Versions 3.5.22.30 and 3.5.19.0 are currently available.

    • Library documentation: Path to the compiled main documentation archive which is created by the LibDoc toolchain, usually called either doc.lmd or __lmd__.auxiliary. Compile files in the same folder which conform to the naming convention __lmd__*.aux[iliary] will also be included, where * corresponds to the ISO language/country code.

    • Overwrite project info properties: During this save process, if you want to save different properties than those entered in the ProjectInfo.json file, then make these changes in this expandable dialog. The entries in the ProjectInfo.json file are not permanently overwritten by this.

    • Overwrite existing: _c4ld_checked_check_box.png: If this library has already been saved as a compiled library in the location selected above, then it will be overwritten.

  3. Click Save.

    The library will be saved as a compiled library <library name>.compiled-library-v3 in the selected destination path.

Installing a library in the CODESYS 4 library repository

Requirement: A library project has been saved as a compiled library.

  1. Select the Menu → Install Libraries into Repository command.

    The Install Libraries into Default Repository dialog will open.

    The dialog will display the path to the default repository.

  2. Click the Add library files button.

  3. In the Open dialog, select the desired compiled libraries from the file directory and click Open.

    The selected library will be displayed in the Install Libraries into Default Repository dialog.

  4. In the If a library already exists list box, select the action to be done when the library already exists in the default repository. If an exactly identical library already exists in the repository, then it will be skipped during installation without an error message – regardless of the option chosen here. "Exactly identical" means that the files match byte-by-byte (matching names, versions, etc. are not enough).

  5. Click Install.

    The library will be installed in the default repository. A corresponding notification will be displayed in the dialog.

    The library can now be used in other projects.