Libraries are collections of objects that you can link to your application. You can use the objects contained in libraries in exactly the same way as objects that you have defined in the project.
Libraries can contain the following objects:
-
POUs (for example function blocks, or functions)
-
Interfaces and their methods and attributes
-
Data types (for example enumerations, structures, aliases, and unions)
-
Global variables, constants, and parameter lists
-
Text lists, image pools, visualizations, and visual elements
-
External files (for example, documentation)
-
Cam plate tables
Libraries in a project are managed in the Library Manager. You use the dialog of the library repository to perform the previous installation of the library on the system.
For "visibility" of library POUs and namespaces of libraries, see also the help page for the library properties.
Using library POUs
The following instructions describe the example of how to insert the counter POU CTUD
from the library Standard
into your program.
-
Open a POU in the editor and place the cursor in the declaration part.
-
Specify the name for the function block instance, followed by a colon (example:
iCounter1:
). -
Press [F2] to open the Input Assistant.
-
In the category “Structured Types”, select the
CTUD
function block from theStandard
library (subfolder "Counter").Select the “Insert with namespace prefix” option.
-
Click “OK” to exit the dialog.
The function block is inserted with a namespace prefix into the declaration part:
iCounter1:Standard.CTUD
.
See also