Adding Libraries
- To add libraries, first open the “Program Structure” panel.
Libraries contain collections of reusable objects such as functions, function blocks or variables that are incorporated into projects. The contents of these libraries can be used here without any new declaration.
Project libraries are managed in library managers that are displayed in the program structure below the applications. Library managers handle both application-related, function-related libraries as well as CODESYS and WAGO system libraries.
Exactly one library manager per application (or controller) is automatically created by default. This also corresponds to WAGO recommendations.
A so-called “System” library repository already contains all updated libraries included with e!COCKPIT from CODESYS and WAGO. The library repository is automatically installed when setting up the e!COCKPIT software. Using the library manager, you can load libraries into your project from this existing library pool.
If no library manager is available, proceed as follows:
- Right-click on the application.
- Select Library Managers in the context menu.
- Click [New] in the dialog.
Reinstalling libraries via file:
- Double-click to open the library manager.
- Click the [Library Repository] button in the library manager.
- Click the [Install…] button.
- Select the library on your PC (*.compiled-library, *.library, *.lib).
- Click [Open] to confirm the installation.
- The library is installed in the library repository.
To load new libraries from the library repository, proceed as follows:
- Double-click to open the library manager.
Usually, different libraries are displayed that have already been added by e!COCKPIT from the device selection and configuration. These libraries are described as “implicit” and shown in gray in the library manager. You should only change them implicitly by changing the device selection or configuration in the project.
Examples:
- Use Modbus Fieldbus
- → Implicit “WagoSysModbusDiag” library
- Use I/O Module 750-464
- → Implicit “WagoSysModule_750_464” library
- Use Trend Storage Manager
- → Implicit “VisuTrendStorageAccess” library
If you want to add libraries from the existing library repository for application development (e.g., WagoAppBluetooth), proceed as follows:
- To add a new library that has already been installed in e!COCKPIT, click [Bibliothek hinzufügen].
- Select the relevant library in the dialog.
- Click the [OK] button to confirm your selection.
The library manager adds a reference to a pre-installed library to the project. You have then “explicitly” added the library to the project. Explicit libraries are shown in black in the list.
Different versions of a library may be available in the e!COCKPIT library repository. Which version is used when adding a library depends on the placeholder resolution of the library.
A library placeholder is used as a reference to the library and contains relevant properties of a library such as name, company, version and type of resolution. Generally, there are three types of resolution:
- Device description
- The version of the library depends on a specific firmware version of the controller. The library is thus dependent on the set device description.
- Library profile
- The version of the library depends on the CODESYS compiler version and depends on the settings for your project.
- Open placeholder
- The version of the library depends neither on the device description nor on the library profile. If you add a library to the project, a reference to the latest version is automatically used in the library repository. If you are already using a library in your project and an updated library is installed in the library reference, you then need to update the placeholder based on the project.
To update placeholders based on the project, proceed as follows:
- Click the [Placeholder] button in the library manager.
- The dialog displays a list of placeholders. This includes all placeholders for libraries that are included in your project via placeholders.
The “Library” column shows both the name and version of the currently used library. - Click on a library name.
- All versions of the library available in the library repository are displayed.
- Select the required version.
- “Resolved by placeholder redirection” now appears after the entry.
- Click [OK] to confirm the change.
Note
Install libraries in e!COCKPIT !
Note that all libraries must be integrated permanently, i.e., they must be installed in the e!COCKPIT library database (library repository). If you simply replace library files in a local directory on your computer, the libraries are not available in e!COCKPIT.
For additional information see:
- Workspace > “Programming” Workspace
- Panels > Program Structure
- “Programming” Workspace > Library Manager