How it is with the templates thing?

However the Merbon IDE may be intuitive and easy to use, one of the critical crosspaths which may stop the engineer’s steps are definitions of web pages in the PLC and graphic or text templates for the terminals. Let’s have a look at them and see how to go to achieve the aims fast and without trouble.

First, the tree structure in a Solution should be considered only as a way to organize data hierarchically (similar to folders in a PC). It does not provide information about bindings and dependencies between a template (as a definition of a HMI) and a device to which a template is uploaded. HMI projects are only „containers“ for templates, and allow us creating, editing, and copying of templates.

When creating a web template, there are two different scenarios: either a template is defined to display data from a single PLC only (and other PLCs are virtually invisible to it), or a template may display data from more PLCs – data from different PLCs may be displayed in a single panel (web page).

Template for a single PLC

Each PLC has an independent web server. The web servers do not „see“ each other, every web server is accessed using the IP address of the respective PLC. A web server only displays data from its own PLC (unless there is a SSCP communication between the PLCs, which is feasible for a limited amount of variables only, such as heat demands or outside temperature; and surely not for a complete HMI design).

In Merbon IDE there is a graphic template of PLC type (plc.graph) to be defined. Its name in the Solution will then be ...plc.graph. Right away, it has to be defined for which PLC within the Solution it will be created. This defines the variables which will be available for assigning to template gadgets.

There may be more templates defined in a project for the same PLC. For example, each template may represent another language version, development version, or customized design for an OEM partner. In the PLC Properties then a particular template is to be selected for upload to the PLC. Of course, it will be only one of the templates.

The relation between a PLC and a plc.graph type template may then be depicted like this:

Green arrow: assignment of a PLC to the template so that corresponding variables from a particular PLC can be selected in the gadgets. The assignment is done when the template is created. Another PLC can be assigned later in the template context menu.

Red arrow: assignment of a template to PLC, so that Merbon IDE knows which template has to be uploaded to the PLC (in case we have more templates).

Finally, these are the steps to be executed to define a web in the PLC:

  • create a graphic teplate of type plc.graph,
  • in this template select the PLC for which the template has to be designed,
  • in the PLC, select the template to be uploaded to the PLC.

Template for more PLCs

That kind of template may contain data from more PLCs. The web server topology then looks as follows:

Unlike the template for a single PLC, the template for more PLCs does not have a PLC assigned in the template properties. There is a special item for this, a Terminal. A Terminal is a generalised HMI device: it may be a web server for more PLCs, a graphic or text operator unit (HT200, HT104), a mobile phone with the Merbon Visual app, Merbon Visual running on a PC, etc. In case of a web server for more PLCs, the server runs on one of the PLCs. This PLC must have resources enough for this, and this is why only some platforms support this function (e.g. mark220, mark320, markMX, wMX...).

When a new terminal is created in the System context menu, it has to be specified what type it will be – this affects some of the terminal properties:

  • Controller as external webserver: web server in the PLC for one or more PLCs according to the topology above. If it is used even for a single PLC (rather than the plc.graph template) – and the hardware capabilities of the PLC allow this – more advanced web functionality can be used, such as user policies, history and logs, etc.
  • External: Definition of graphics or / and text menu (template of type terminal.graph) for the Merbon Visual app, be it for a mobile phone or a PC. „External“ means that the target platform is a non-Domat hardware.
  • HT104: A text HMI device which allows displaying of text templates (of type ...terminal.text).
  • HT200: A graphic HMI device which allows displaying of graphic and combined (graphics + text) templates of type ...terminal.graph.

It is a good idea to give a terminal another name than the default Terminal, e.g. HT200_Chillers.

As we were assigning a PLC to a single-PLC template to specify the variables which the template shall show, similarly it has to be done here. However, as there may be assigned more than one PLC to a template, the PLCs are not assigned as one of the terminal properties anymore. They are contained in a communication channel. The channel may contain one or more PLCs which are defined in the Solution.

In the channel context menu, select one or more PLCs, variables of which will be available for editing in the template. Then the template belonging to the terminal may be edited, and the gadgets may be assigned the PLC variables according to the choice.

Because a terminal, in general, may reside in another logical network than the PLCs, it must be specified how (i.e. over what IP address or URL, and over which TCP port) it shall connect to the PLCs. This is to be set up in the properties of the mapped PLCs in the channel of the terminal. See details to the three options (HwConfiguration, Deploy, and Custom) in the Merbon IDE help. This is mentioned here because there is a difference against the above described configuration of a template for a single PLC. A single PLC template knows that the PLC data are in the same hardware as the template itself, and no extra configuration of communication to the PLC is necessary.

Next, in the terminal properties there must be specified a connection to the terminal, or „where shall  Merbon IDE search for the terminal to upload the template“. Because a terminal is an external device, the connection follows over the SSCP protocol using an IP address or URL, TCP port, user name, and password. (This does not concern the External type terminals – the definition is copied manually as a .zip file into a mobile device.)

There may be more different templates in a project, but one of them to be uploaded to the terminal must be selected in the terminal properties. The relations between the items in a Solution look as follows:

Blue arrow: Logical binding between a „reference“ to a PLC in the terminal definition and a PLC. The SSCP Parameters specify „where the terminal shall find the PLC“, again by selecting from HwConfiguration, Deploy, and Custom.

Red arrow: In the terminal properties there is to be specified which template shall be uploaded to the terminal.

Yellow line: Template properties. The attached terminal can be changed (reassigned) later in the template context menu.

Orange line: Properties of connecting of the terminal to PLCs, as configured in the terminal definition. Each logical connection to each PLC is configured separately in the SSCP parameters of every terminal, because different terminals may connect to a particular PLC in different ways. For example, a terminal in an internal network will connect to a PLC over its local address, while a terminal connected over the Internet will try to reach the PLC over a public IP address, and maybe over another TCP port number, according to NAT mapping.

Violet line: Terminal properties; here is to be configured „where the Merbon IDE shall find the terminal when the template will be uploaded into it“.

In the example above, the IP address of the terminal is and it is supposed that Merbon IDE is on a PC in the local network (in simple terms, the PC with Merbon IDE has an IP address of  192.168.1.x). The terminal is set up so as to take over the IP address and port for connection to the PLC named MyPLC from the hardware configuration of the PLC, i.e. from the settings which are stored in the PLC. Again, this is a typical configuration of devices which all are in a single logical network.

So the required steps are as follows:

  • create a terminal, for a web server in one of the PLCs it will be Controller as external webserver,
  • in the terminal properties, enter the IP address and other data for connection to the terminal:

o   for Controller as external webserver, address of the PLC in which the web server will be,

o   for HT200, address of the touch screen (the HT200 address is configured over the HT200 touch screen menu or configuration web pages),

o   for HT104, address of the text terminal (the HT104 address is configured over the device’s web pages),

o   for External, no settings required (the graphics is copied to the mobile device as a .zip file),

  • in the terminal channel, assign the PLC(s) which the terminal (or web) shall operate,
  • in the terminal channel, in Connection to PLC check if the default setting (HW configuration) is OK for the planned network topology; if not, change the settings here,
  • create a graphic template of type terminal.graph,
  • when creating the template, select the terminal to which the template will be assigned, this specifies the PLC variables which will be available in the template editor,
  • in terminal properties, select the template to be uploaded into the terminal.

There may be more terminals in a Solution; the steps above are to be applied for every of them. A template of type terminal.graph may be used for more terminals at the same time, e.g. for a HT200 and a web server in a PLC. All changes in the template design will then appear in all terminals which use this template, after the template is uploaded to the concerned terminals.