Generalities About Libraries

Content of Libraries

Libraries are collections of objects that you can link to your application. You can use the objects contained in libraries in the same way as objects that you have defined in the project.

Libraries can contain the following objects:

  • POUs (such as function blocks or functions)

  • Interfaces and their methods and attributes

  • Data types (such as enumerations, structures, aliases, and unions)

  • Global variables, constants, and parameter lists

  • Text lists, image pools, visualizations, and visual elements

  • External files (such as documentation)

  • Cam tables

  • Objects from the ETEST plugin (for example, Test Cases)

For managing libraries in a project, use a Library Manager. The Library Manager editor is described in the Library Manager Editor chapter. The installation of libraries is accomplished during the installation of those elements (devices, solutions, controllers) you select to install with the Schneider Electric Software Installer. You can manage user-defined libraries via the Library Manager and the Library Repository directly within EcoStruxure Machine Expert.

Library Information

In the Library Manager , you find the libraries included in your project / library and in the Library Repository , you find the available libraries. Depending on the selected library, different information is available:

Information

Description

Example

Name

Name of the library

TcpUdpCommunication

Version

Version of the library

1.1.10.0

Company

The primary provider or group name defined by the primary provider of the library, as shown in the Library Manager and Library Repository dialog box.

Schneider Electric

Namespace

The default namespace of the library for accessing functions of the library.

NOTE: Good practice is to use the default namespace as the namespace used in your application.

If qualified-access-only is set as library attribute, the usage of the namespace in your application is mandatory.

TCPUDP

Category

The category (or categories) which this library belongs to, as shown in the Library Manager and Library Repository dialog box.

Communication

Namespace

A library namespace is a symbol that allows the unique access to the attached library components (functions, function blocks, variables…). The namespace is necessary when two components of two different libraries used in the same project have the same name. The usage of the namespace in your application is mandatory if the library has set the attribute qualified-access-only . To ensure unique access to the correct component, use the full name <namespace>.<component> format, including the namespace.

Case

Description

1

There is a function block GEN in the library Util. The namespace of the library Util is Util. An instance of the function block GEN can be declared with or without the library namespace if the name GEN is unique within the project:

MyGenerator: Util.GEN;

Or MyGenerator: GEN;

2

A function block GEN has been created within the project. The use of the library Util namespace will allow the system to access the function block GEN of the library Util. Without namespace, the project function block GEN will be accessed:

MyGenerator_Util: Util.GEN;

MyGenerator_Project: GEN;

3

Another library, also containing a function block called GEN, is declared in the project with namespace NewLib. The use of the namespace becomes mandatory to identify the correct function block GEN to be accessed:

MyGenerator_Util: Util.GEN;

MyGenerato_NewLib: NewLib.GEN;

A default namespace is defined for each library.

Library Repository

The Library Repository is the editor that manages libraries installed in EcoStruxure Machine Expert. The Library Repository allows you to install or remove user-defined libraries as well as other library types, such as application libraries, device libraries, or other libraries. A library can be used in an EcoStruxure Machine Expert project only if it is installed in the Library Repository. With the installation of EcoStruxure Machine Expert, a set of libraries is installed by default in the System library repository. You can install new libraries or new versions of existing libraries either via the Library Repository dialog box, or by using the Schneider Electric Software Installer.

The paths to the folders where the (System and User) repositories are located are configured in the Tools > Options > Directories (Devices, Libraries, ...) dialog box.

Protection of Libraries

The following methods exist to protect your library:

Method

Description

Source code protection

When a library is prepared in “compiled-library” format, the source code of the library modules is no longer visible after the library is integrated into a project.

Signing

A certificate is used for the signing of library projects (*.compiled-library-v3). The signing can be enforced by means of a setting in the Security Screen dialog. Then for generating a compiled library, you need a certificate suitable for code signing in your user profile. See also Save Project As Compiled Library.

For library projects that have to be compatible with EcoStruxure Machine Expert < V2.0 (*.compiled-library), only less secure signing is possible with a private key and a corresponding token. These methods should only be used for reasons of compatibility. Settings are configured in the Project Information on the Signing tab.

Integrity check

When the option Integrity check is selected in the Project Settings > Security dialog box, the project file is stored in a proprietary format. The integrity of the file is verified each time the project is loaded.

Encryption using password or certificate

When the option Encryption is selected in the Project Settings > Security dialog box, the project file is encrypted by password or certificate according to your individual requirements. For further information, refer to the Menu Commands Online Help.

Licensing

You can protect libraries by means of a license (dongle or soft container). License-protected libraries can be installed in the library repository. However, for use in the project, the valid license has to exist on the computer.

Managing Libraries by Using Library Managers

Libraries declared in a project are managed in the Library Manager editor.

An EcoStruxure Machine Expert project can include more than one controller. Therefore, different Library Managers are available. In general, two intended use cases of the same Library Manager object exists:

Use Case

Location of the Library Manager

One Library Manager for each controller to handle the controller-specific and the application-specific libraries.

In the Tools tree below the Application node for each controller

Library Manager nodes for user-specific POUs which are used in more than one controller of the same EcoStruxure Machine Expert project.

In the Tools tree below the Global node.

For more information about library management, Library Repository and Library Manager Editor, refer to Library Management.

For more information on finding a function or function block of libraries with the FFB Finder, refer to How to Find a Function or Function block with the FFB Finder.