-

HMI Configuration Sample

This topic describes how to create an XML configuration file using a simple PLCnext Engineer project as an example.

Note
The example assumes that you are familiar with XML programming and the XML syntax rules. It is recommended to use an XML editor for creating the XML configuration file. The configuration file must conform to the schema provided by Phoenix Contact.

This chapter includes the following sections:

Further Info
For the description of all elements and attributes allowed in the configuration file, see the topic "HMI Configuration File Elements and Attributes". For a description how to use the HMI Configurator, refer to the topic "Working with HMI Configuration Files".

Example PLCnext Engineer project

The example project contains the following items which are used for the generation of the HMI content based on the sample configuration file. The list only contains the project items which are processed using the configuration file; other items shown in the figures can be ignored.

FB 'RobotFB'

User-defined HMI symbol 'Robot'

User-defined HMI symbol 'RobotSmall' with symbol parameter 'Label' and 'Text' dynamic

What we want to do

In the example, we are going to create two HMI pages from the project elements described above: the detail HMI page 'RobotDetail' for the FB 'RobotFB' which contains one 'Robot' symbol instance and the overview HMI page 'RobotOverview' which contains a 'RobotSmall' symbol instance for each 'RobotFB'. The creation of the HMI pages and the HMI symbol instances are all triggered by the existence of the 'RobotFB' instances. To distinguish the two 'RobotSmall' instances on the 'RobotOverview' page, the name of the FB (POU) instances ('Robot1' and 'Robot2') are set for the 'Label' symbol parameter.

HMI page 'RobotDetail' with an instance of the 'Robot' symbol

HMI page 'RobotOverview' with two instances of the 'RobotSmall' symbol and configured symbol parameter

Full XML code

The following shows the full XML code for the sample configuration file. The elements and attributes used are described in the following section.

Description of elements and attributes in the XML file

This section contains an explanation of each element and attribute in the XML configuration file used to create the HMI pages and HMI symbols as described above. The elements and attributes are listed in the order in which they appear in the XML file. For a complete list of the XML elements and attributes you can use in a configuration file, see the topic "HMI Configuration File Elements and Attributes".

Note
All elements and attributes must be written in lowercase.

Element <hmigenerator>

Generating the pages 'RobotDetail' and 'RobotOverview'

Element <generation>

Element <page>

Generating the symbol instances 'Robot' and 'RobotSmall' and assigning symbol styles and data values

Element <symbol>

Element <onfunctionblock>

Element <symbolstyle> (child of <onfunctionblock>)

Element <dataset> (child of <onfunctionblock>)

Defining symbol styles for the symbol instances

Element <symbolstyles>

Element <symbolstyle>

Element <location>

Setting the HMI symbol parameter of the 'RobotSmall' symbol instances

Element <datasets>

Element <dataset>

Element <data>