User-defined Libraries

If a project is to be compiled in its entity and without errors, then it can be saved in a library with the ‘Save as’ command in the ‘File’ menu. The project itself will remain unchanged. An additional file will be generated, which has the default extension “.lib”. This library afterwards can be used and accessed like e.g. the standard library.

For the purpose to have available the POUs of a project in other projects, save the project as an Internal Library *.lib. This library afterwards can be inserted in other projects using the library manager.

Note

Regard the possibility to define via pragmas to what extent the declaration part of the library should be visible in the Library Manager when the library has been included in a project.

If you have implemented POUs in other programming languages, e.g. C, and want to get them into a library, then save the project using data type External Library *.lib). You will get the library file but additionally a file with the extension “*.h”. This file is structured like a C header file and contains the declarations of all POUs, data types and global variables, which are available with the library. If an external library is used in a project, then in simulation mode that implementation of the POUs will be executed, which was written with CoDeSys; but on the target the C-written implementation will be processed.

If you want to add licensing information to a library, then press button Edit license info… and insert the appropriate settings in the dialog ‘Edit Licensing Information’.