Library Repository
Function: The Library Repository can be used for the definition of storage locations and for the installation or uninstallation of libraries.
Call:
- Menu PLC
- Context menu of the References object in the PLC project tree
- Button in Library Manager (symbol: )
- Via the extended dialog Find library after using the command Add library without placeholder resolution command
In order to be able to use a library, it must be installed in the repository. For the Beckhoff libraries this generally happens during the TwinCAT 3 installation or during the installation of TwinCAT 3 functions. Libraries can be installed as source library (*.library) or as compiled library (*.compiled-library). Beckhoff supplies compiled libraries. If an attempt is made to use a library version that is not installed in the repository, a note symbol appears at the reference in the project tree.
The library repository contains all installed libraries. This list can be sorted and displayed based on the library categories (option Group by category is enabled) or alphabetically based on the library titles (option Group by category is disabled). When the libraries are sorted based on categories, the categories appear as nodes. Clicking on a node opens the list of associated libraries or subcategories; clicking on a library name opens the list of installed library versions.
Buttons and commands
The following buttons and commands are available in the Library Repository.
Location
Displays the directories on the local system, in which the library files are stored. The libraries for this storage location are listed in the Installed libraries section. If several repository directories exist on the system, a repository directory can be selected for management at this point. | |
Edit | Opens the dialog Edit Repository Locations. |
For new repositories you can only use empty directories or a valid existing repository. |
Edit Repository Locations
List the repositories with location and name. | |
Add | Creates a new repository by specifying a repository name and directory. Opens the dialog Repository Location. The selected directory (Location input field) must be empty or an existing valid repository. Name is the input field for a symbolic repository name. |
Edit | Opens the Repository Location dialog (see “Add”) for editing the currently select library repository. |
Remove | The user is asked whether only the repository list entry is to be removed, or whether the whole directory containing the library files should be deleted from the file system. If you want to delete the directory, you need to confirm this. |
Move up | Command for changing the repository order, by moving the currently selected repository up by one position. |
Move down | Command for changing the repository order, by moving the currently selected repository down by one position. |
Installed libraries
List of libraries in a tree structure. Each library is shown with category, name, company and version. | |
Company | Selection list for filtering the displayed libraries. |
Install | Opens the Select Library dialog for selecting a library file in the file system. The selected library file of type *.library or *.compiled-library is installed in the local Library Repository. The library can then be used in projects. |
Uninstall | Uninstalls the selected library version. It can then no longer be used in projects. |
Export | This command allows you to export a library that is installed in your library repository and store it at the desired location. The command opens the Export Library dialog for selecting a location. The library can be exported in the format in which it was installed in the repository (as source library *.library or as *.compiled-library). |
Search | Opens the Find Library dialog for finding library names or library elements. Double-click on a search result or select a search result + [Open] to close the search dialog and the corresponding library is marked in the Library Repository. |
Details | Opens the Details dialog for the selected version of a library. |
Dependencies | Opens the Dependencies dialog for the selected version of a library. |
Group by category |
The categories are defined through external description files “*.libcat.xml”. |
Library profiles
A library profile defines with which library version TwinCAT resolves a library placeholder, if a certain compiler version is set in the project. | |
Import | Imports a *.libraryprofile file. If the import contains existing placeholder entries, a prompt appears asking whether TwinCAT should overwrite them. |
Export | Exports an xml file with the extension “.libraryprofile”, which contains the assignments of the selected placeholder entries. You can limit the selection to a single entry from a compiler version. |
Converted TwinCAT 2 libraries in the Library Repository
The Library Repository contains converted TwinCAT 2 libraries (Tc2_<LibraryName>) and new TwinCAT 3 libraries (Tc3_<LibraryName>), which are not available in TwinCAT 2.
These libraries enable conversion of a TwinCAT 2 project, which uses TwinCAT 2 libraries, to a TwinCAT 3 project, which uses compatible TwinCAT 3 libraries, without the need for major changes in the PLC code. The Tc2_<LibraryName> libraries are therefore converted TC2 libraries. The naming of the libraries in TwinCAT 3 is similar to that in TwinCAT 2. To simplify matters, some libraries were combined. The project converter automatically assigns the TC2 libraries of a TwinCAT 2 .pro file to the TC3 libraries in a TwinCAT 3 project.
A list of PLC library assignments TC2 library → TC3 library is stored in the TwinCAT options and can be expanded there:
Tools\Options\TwinCAT\PLC Environment\Libraries
Older libraries must be replaced before a project is converted (i.e. MC → MC2, COMlib → COMlibv2, PLCSYSTEM → TcSystem, ...).