How to use Functions (F) and Function Blocks (FB)

List

This page is part of the IEC 61131-3 Programming Manual. Go to the index.

A series of objects (functions "F“, function blocks “FB", data structures, etc.) divided into libraries (See list), on the IEC61131-3 Programming Manual for each object the library in which it is located is indicated. The latest version of the libraries is distributed with LogicLab in the program installation path (Usually C:\Program Files (x86)\Elsist\LogicLab\Libraries). There are several methods of using library objects.

Link to library package

This is the recommended method, see article (Available from LogicLab version 5.22.x.xx), allows you to select the folder where the libraries are located. All the objects present in the libraries become available in the project.

With Project -> Library manager, the window with the list of libraries present in the project opens, if present, eliminate them, by pressing the button Add you can search the disk, choose the desired folder. With a double click on the name, the folder will be linked to the project. The libraries are not imported into the project but only the compiled code of the objects used is included. The library package is downloadable from here.

Screenshot library folder definition in LogicLab

Object import

The object is imported from the library that contains it, the object is copied into the project so it will always be available even when moving the project to other development PCs. To update the object, you need to import the updated version by replacing it in the project.

With Project -> Import objects the window to search for the library on disk opens, choose the library from which you want to import the object. The window opens Object browser which displays the objects in the library. With a click of the mouse, the desired object or objects are highlighted with the key Import objects the selected objects will be included in the project. The lock symbol on the object indicates that it is a protected object, it cannot be changed.

Screenshot importing LogicLab objects

Library import

The entire library containing the object is imported, the library is copied into the project so it will always be available even if the project is moved to other development PCs. To update the object you need to import the updated version.

With Project -> Library manager, the window with the list of libraries present in the project opens, with the key Add you can search the library on the disk, choose the library. With a double click on the name, the library will be included in the project maintaining a reference (Link) to the source library. The imported library keeps the reference Link to the folder you imported from. The Link allows when the project is opened to check the defined folder for an updated version of the library.

LogicLab library management screenshot

If there is an updated version, a pop-up asks whether to replace it. The new library may have updates that make it incompatible with your program, therefore I recommend upgrading only if really necessary, it is better to remove the link by selecting it and pressing the UnLink button to avoid the request.

LogicLab project opening screenshot

final Thoughts

Let's see the differences between the different methods:

Link to collection, the object sources remain in the collection libraries. The advantage of this solution in addition to the decrease of the source code in the download on the device, allows by selecting a new version of the package, to update all the objects of the program. If you want to archive the collection with the program, just make a copy even if it is not necessary, because all the versions of the collections are always available on our site.

Object and/or library import, you embed the import into your project. On the one hand this allows you to have everything needed for compilation in the project but involves an increase in the source code saved in the system, increasing download times and the disk space needed to store it. In updates, it forces you to replace the import with new versions of the objects by looking for them in the various libraries, with the risk that the new objects are not compatible with other objects that are not updated.

Was this article helpful?