Referencing libraries
Elements of the library to be deployed might use elements of other libraries that have already been deployed by you. In this case, you have to specify the statement USES
with the library configuration.
If you are only using system blocks |
Example: The function block Motor1
for the library com.CompanyA.Controller
to be deployed should use the function Expand01
from the library com.CompanyA.Boards
(in version 1.0.0). Therefore, you have to specify the statement USES com.CompanyA.Boards, 1.0.0
within the library configuration for com.CompanyA.Controller
.
Perform the following steps to reference and deploy the libraries:
-
Make sure that the library to be referenced with the required elements is already included in the requested version within the project. See "Deploying the library" for the necessary steps.
Example: The project already contains this →library:com.CompanyA.Boards__1.1.0
-
Create the elements for the new library (hence:
com.CompanyA.Controller
) and use the elements from librarycom.CompanyA.Boards
. See "Creating elements (e.g. user blocks) for library" for details. -
Within the library configuration for the new library (hence:
com.CompanyA.Controller
), insert the statementUSES com.CompanyA.Boards, 1.0.0
. See "Declaration of information on creation and references for the library" for details on the other syntax.
The library must be referenced with the exact version number with which this library has been installed in the current project.Example for library configuration incl. statement "USES" LIBRARY com.CompanyA.Controller
VERSION := 1.1.0;
PACKAGETYPE := zip;
USES com.CompanyA.Boards, 1.0.0; (* The library 'com.CompanyA.Boards' in version 1.0.0 is referenced. *)
FOLDER "Motors"
IEC := com.CompanyA.Controller.Motor1; (* Assumption: The POU 'Motor1' uses an element provided by the library specified at 'USES'. *)
END_FOLDER
END_LIBRARY
-
Generate the library for
com.CompanyA.Controller
. See "Generating and examining a library or password-protected library" for details. -
Deploy the new library (hence:
com.CompanyA.Controller
) and install this library within a probject. See "Deploying the library" for details.
You only have to install thelibrary com.CompanyA.Controller
within this project. Neuron Power Engineer takes care that all required libraries are automatically installed (hencecom.CompanyA.Boards
as well).