In order to avoid consistency problems and to adequately support the user, be sure to adhere to certain rules for the creation, referencing, encryption, protection, and documentation of libraries.
The following description provides only an overview of the library development possibilities. For a more detailed description of these topics, see the "LibDevSummary" guidelines for library development.
For more information, see: ⮫ “Using Libraries ”, ⮫ “Library Repository ”, ⮫ “Library Manager ”
General
-
You can define categories for libraries. The libraries are then displayed in the library repository below these categories.
-
You can define a namespace for a library in order to enable unambiguous access to the integrated objects. The access becomes unambiguous by adding the namespace in front of the POU name:
<namespace>.<variable name>
Example:
AC.Module
-
You can open the POUs of unencrypted libraries (
*.library
) by double-clicking the respective entry in the Library Manager. -
You can create the following library types:
-
*.library
: Implementation library (source code of the library) -
*
.compiled-library
,*.compiled-library-v3
: Protected libraryThe source code is no longer accessible.
-
*_Itfs.library
: Interface libraryContains only objects that are used for the interface definition of a component (for example, constants, structures, or interfaces) and do not generate any code
-
*_Cnt.library
: Container libraryDoes not contain POUs, but only other libraries
Therefore, used to conveniently integrate an entire set of libraries whose POUs are published on the top level of the container library
-
-
You can integrate external libraries into the application. External libraries are programmed outside of CODESYS in a different programming language (example: C).
Protection of libraries
-
Source code protection
When a library is prepared in "compiled-library" format, the source code of the library POUs is no longer visible after the library is integrated into a project.
-
Signing
In CODESYS V3 SP15 and higher, a certificate is always used for the signing of library projects (
*.compiled-library-v3
). The signing can be enforced by means of a setting in the security screen. Then for generating a compiled library, you need a certificate suitable for code signing in your user profile.For library projects that have to be compatible with CODESYS < V3 SP15 (
*.compiled-library
), only the less safe signing is possible with a private key and a corresponding token. These deprecated methods should only be used for reasons of compatibility. Settings are configured in the “Project Information” on the “Signing” tab.Note: For signing libraries, you should use compiler version 3.5.15.0 or higher because a better storage format is used.
-
Licensing
You can protect libraries by means of a license (dongle or soft container). License-protected libraries can be installed in the library repository. However, for use in the project, the valid license has to exist on the computer. Licenses are managed in the License Manager.
Library versions
-
You can have several versions of a library installed on the system at the same time.
-
You can have several versions of a library integrated into your project at the same time. However, we do not recommend doing this. In this case, each of the libraries must be assigned a unique namespace and access to the symbols must be qualified.
Examples:
V1.SendBlob
,V2.SendBlob
Referenced libraries
-
You can integrate a library into other libraries (referenced libraries). The nesting can be of any depth.
-
You can define whether referenced libraries should be visible in the Library Manager.
-
You can integrate referenced libraries via library placeholders. This way you avoid the problems that could occur due to version dependencies or the necessity to use vendor-specific libraries.