-

Library Description Files

This topic contains the following sections:

General information

PLCnext Engineer allows you to provide library description files with the POUs and data type worksheets contained in your released libraries.

For this purpose, the 'Release As Library' dialog offers an area for selecting and removing description files at the top right (in the input area for the metadata of the library to be published). The 'Add file(s)' button allows you to select one or more description files and then lists them in the field. 'Remove file' deletes the description file selected in the field.

The library description file is a file in XML format which has a pre-defined structure and content (see below). The description file contains the following information:

For library description files, the following applies:

Notes on POUs and data type worksheets

Content of the library description file

The following example shows the format of the XML file that defines a library description file you can provide with a released library. The example contains all XML elements and attributes that can be used. The XML file must have the structure as shown.

<?xml version="1.0" encoding="UTF-8"?>
<Library>
  <ToolboxCategories>
    <ToolboxCategory Id="Root" Name="" />
    <ToolboxCategory Id="Container" Name="Container" />
    <ToolboxCategory Id="ContainerMonitor" Name="Container\Monitor" />
    <ToolboxCategory Id="ContainerCheck" Name="Container\Check" />
    <ToolboxCategory Id="Robot" Name="Robot" />
    <ToolboxCategory Id="Hidden" IsHidden="true"/>
  </ToolboxCategories>
  <ProgramOrganizationUnits>
    <ProgramOrganizationUnit Name="Container.Container" ToolboxCategoryId="Container" Description="Container Program" />
    <ProgramOrganizationUnit Name="Container.Recording" ToolboxCategoryId="Container" Description="Recording Program" />
    <ProgramOrganizationUnit Name="LadderProgram" ToolboxCategoryId="Hidden" Description="" />
    <ProgramOrganizationUnit Name="Container.ContainerTrend" ToolboxCategoryId="ContainerMonitor" Description="Trend FB" />
    <ProgramOrganizationUnit Name="Container.DrainCheck" ToolboxCategoryId="ContainerCheck" Description="Drain Check FB" />
    <ProgramOrganizationUnit Name="Container.MinMaxCheck" ToolboxCategoryId="ContainerCheck" Description="MinMax Check FB" />
    <ProgramOrganizationUnit Name="Robot.RobotFB" ToolboxCategoryId="Robot" Description="Robot FB" />
    <ProgramOrganizationUnit Name="Robot.Robot" ToolboxCategoryId="Hidden" Description="" />
     <ProgramOrganizationUnit Name="Container.ContainerLevelMonitor" ToolboxCategoryId="ContainerMonitor" Description="Monitor FB" >
        <Methods>
            <Method Name="Reset" Description="Resets monitor" >
                <FormalParameters>
                    <FormalParameter Name="mode" Description="Reset mode"/>
                    <FormalParameter Name="Reset" Description="Success"/>
                </FormalParameters>
            </Method>
        </Methods>
    </ProgramOrganizationUnit>
    <ProgramOrganizationUnit Name="BaseFunction" ToolboxCategoryId="Root" Description="Setting base values" >
        <FormalParameters>
            <FormalParameter Name="value" Description="Setting of depth level"/>
            <FormalParameter Name="BaseFunction" Description="Error code"/>
        </FormalParameters>
    </ProgramOrganizationUnit>
  </ProgramOrganizationUnits>
  <DataTypeWorksheets>
    <DataTypeWorksheet Name="Container" ToolboxCategoryId="Container" Description="Container Types" />
    <DataTypeWorksheet Name="Robot" ToolboxCategoryId="Root" Description="Robot Types" />
  </DataTypeWorksheets>
</Library>

The following figure shows the library description in PLCnext Engineer as defined in the example XML file above:

XML elements and attributes

The following table describes the XML elements and attributes that are used to the define the library description file.

Element/AttributeTypeDescription
ToolboxCategoriesElementIntroduces the definition of the categories (folders) under which the function/function block POUs and data type worksheets shall appear in the COMPONENTS area.
ToolboxCategoryElementCategory (folder) under which the function/function block POUs and data type worksheets shall appear in the COMPONENTS area.
IdAttributeUnique identifier that identifies the <ToolboxCategory>.

The Id is used in the ToolboxCategoryId attribute of the <ProgramOrganizationUnit> or <DataTypeWorksheet> element (see below) to refer to the category.
With Id="Hidden" and IsHidden="true" (see the following description), the <ToolboxCategory> and all of its elements will be hidden in the COMPONENTS area.
IsHiddenAttributeBoolean attribute that specifies whether the category will be visible ('false') or hidden ('true'). The attribute is only considered in combination with the Id="Hidden" value (see above).
NameAttributeContains the name of the <ToolboxCategory>.

It defines the new folder name inside the components tree. The name can contain also subfolders separated by "\".
ProgramOrganizationUnitsElementIntroduces the definition of the POUs.

(See also the notes below this table.)
ProgramOrganizationUnitElementDefinition of the POU.
NameAttributeContains the name of the <ProgramOrganizationUnit>.
ToolboxCategoryIdAttributeIdentifier of the <ToolboxCategory> under which the POU shall appear inside the COMPONENTS area. (Not used for the definition of FB POU methods.)

If used, the Id must be equal to a value of an Id attribute of the <ToolboxCategory> element.
DescriptionAttributeText that is shown when hovering the mouse over the POU in the COMPONENTS area.
MethodsElementIntroduces the definition of the methods of an FB POU.
MethodElementDefinition of the method of the FB POU.
NameAttributeContains the name of the method.
DescriptionAttributeText that is shown when hovering the mouse over the POU in the COMPONENTS area.
FormalParametersElementIntroduces the definition of the formal parameters of the POU/method.
FormalParameterElementDefinition of the formal parameter of the POU/method.
NameAttributeContains the name of the formal parameter.
DescriptionAttributeText that is shown when hovering the mouse over the formal parameter inside the graphical editor.
DataTypeWorksheetsElementIntroduces the definition of the data type worksheets.
DataTypeWorksheetElementDefinition of the data type worksheet.
NameAttributeContains the name of the data type worksheet as shown inside the COMPONENTS area.
ToolboxCategoryIdAttributeIdentifier of the <ToolboxCategory> under which the data type worksheet shall appear inside the COMPONENTS area.

If used, the Id must be equal to a value of an Id attribute of the <ToolboxCategory> element.
DescriptionAttributeText that is shown when hovering the mouse over the data type worksheet in the COMPONENTS area.

Tip: When providing an own library description file, please start with the automatically generated library description file (when not providing an own file) as a base. All necessary entries are generated and can be found in the library file (*.pcwlx). The .pcwlx file is a zipped file which can be opened and extracted with any unzip program. Modify the automatically generated containing LibraryDescription.xml file to your needs and then add the file in the 'Release As Library' dialog.