Mosaic libraries provide the ability to easily and repeatedly use pre-built functions and function blocks in Mosaic projects. The basic condition is that we have to create program units (functions, function blocks) for one library in one project. It is not possible to create different functions and function blocks in several projects and then combine them into one library.
When we have created function blocks and functions that we want to include in the library, we mark them in the project manager in the left panel on the Project files tab. You can mark them via the local menu called up by pressing the right mouse button, which contains the item Include file in library.
In each function block or function we use functions and function blocks from other libraries. These must always be part of the project where the library to be created will be used in order to be able to translate this library. Therefore, it is necessary to mark the related libraries using the Enable library dependency option, again via the local menu of the Project files window. This will link the libraries and after adding the user library to the project, the related libraries will be added automatically.
The next step is to set the version of the library, or comments on changes made in the published version of the library. Library version and release date information is used for library updates, comments can be viewed in the Library Explorer under the library header, and the user can decide if the update is required for the library. This applies equally to libraries created directly by Teco and to user libraries. After all, who among us remembers what changes he made to projects a few months ago. The library version is set in the project manager, in the SW node, the Program branch. It is also common to publish a library under a name other than the project name. This can also be changed in the header.
After completing these steps, we can translate the project and after successful translation, the Save project as library option will be visible in the File menu. When we save the project, the library is generated and saved in the user libraries folder. This is typically the C: / MosaicLib folder in the root directory of the C: / drive. This path can be changed by the user (see Project Manager / Common Settings / Folder Settings). The generation of the library ends with the display of a message, from which the result is evident and on which libraries the newly created library depends and on which, on the contrary, it is independent. This information can also be seen in the header of the * .mlb library file.
To insert any user library into a new project, it is necessary to enable / enable the display of user libraries in the Library Explorer with the User Lib button.