MBLogic for an open world in automation
The HMI server is configured by means of a text file. The format and features of that configuration file are described here.
Server configuration is performed through a configuration file. This file holds all the tag names, addresses, and other definitions used by the server. Any tag names or addresses which are not contained in the configuration file are not recognised by the server. The configuration file is defined as follows:
Certain tags are defined as "reserved tags". These include tags for defining the client version and the server id. The configuration system allows "clientversion" and "serverid" to be defined by the server. For "clientversion" there is one item "ver" which defines the version. For "serverid", there is also one item "id" which allows the server id to be defined.
# Client page(s) version. [clientversion] ver=Ver 0.1 Demo # Server ID. [serverid] id=demo test server
Events and alarms are defined in separate sections. The events section is indentified by the name "&events". The alarms section is indentified by the name "&alarms". Since HMI protocol tags cannot start with an "&" character, these will not conflict with any other permitted tag name.
Each of the events and alarms sections has three types of items. The "base" item is used to define an offset (or "base address") in the data table. The "base" address is added to the address configured for each event or alarm. The events and alarms section must each define a base address. This item takes the form "base=(integer)". For example, "base=1024".
The data table address type for alarms and events is fixed as follows:
The second type of item is the associate of each event or alarm tag with a data table address. For any item other than "base" the key is assumed to be a data table address, and the value is assumed to be an event or alarm tag. The data table address is added to the "base" value to give the actual address which is monitored for events or alarms.
The third type of data is the zone list. A "zone" is a tag which is used to identify a group of alarms or events. An event or alarm tag can be assigned to any number of zones. The zone list is consists of any names following the alarm or even tag. Zone names must be separated by commas.
# Event definitions. [&events] base=32300 0=PumpRunning, zone3 1=PumpStopped, zone3 2=Tank1Empty, zone1 3=Tank1Full, zone1, zone2 4=Tank2Empty, zone2 5=Tank2Full, zone2 # Alarm definitions. [&alarms] base=32400 0=PB1Alarm, zone1 1=PB2Alarm, zone2 2=PB3Alarm, zone3
Any section name other than a reserved tag or events and alarms is considered to be an address tag. Each data table address which is to be accessed via the HMI protocol must have an address tag.
Each address tag has a series of items defining the data table type, data table address, and various other characteristics. The number and type of items required will vary depending on the data type.
Data types determine the format for data which transmitted between the server and the client. The system will convert between integer and floating point if necessary. It does not determine server data table storage size or packing. The following data types are recognised:
Address types determine how data is stored in the server data table. This includes the number of storage locations (e.g. registers) and the byte ordering. For numeric address types which occupy multiple registers, the least significant word is stored in the platform's native format. For Intel type CPUs (big endian), the first (lower address) register. For string data types, characters are stored in consecutively increasing addresses.
Address types are inherently protocol dependent. They are what provides the translation between the abstract (and protocol independent) "data types" the HMI screens deal with, and the actual native data types of the protocol. That means that the details of this part of the HMI configuration will inherently be protocol dependent.
The following data types are recognised for Modbus communications:
Address Type | Data Type | Storage Location | # Storage Elements | Extended Data Type |
---|---|---|---|---|
coil | boolean | coil | 1 | No |
discrete | boolean | discrete inputs | 1 | No |
holdingreg | signed 16 bit integer | holding register | 1 | No |
inputreg | signed 16 bit integer | input register | 1 | No |
holdingreg32 | signed 32 bit integer | holding register | 2 | Yes |
inputreg32 | signed 32 bit integer | input register | 2 | Yes |
holdingregfloat | single precision (32 bit) floating point | holding register | 2 | Yes |
inputregfloat | single precision (32 bit) floating point | input register | 2 | Yes |
holdingregdouble | double precision (64 bit) floating point | holding register | 4 | Yes |
inputregdouble | double precision (64 bit) floating point | input register | 4 | Yes |
holdingregstr8 | string | holding register | 2 characters per register | Yes |
inputregstr8 | string | input register | 2 characters per register | Yes |
holdingregstr16 | string | holding register | 1 character per register | Yes |
inputregstr16 | string | input register | 1 character per register | Yes |
Address Type | Data Type | Storage Location | # Storage Elements | Extended Data Type |
---|---|---|---|---|
sbusinput | boolean | inputs | 1 | No |
sbusoutput | boolean | outputs | 1 | No |
sbusflag | boolean | flags | 1 | No |
sbusreg | signed 32 bit integer | registers | 1 | No |
sbusregstr | string | registers | 1 character per register | Yes |
Valid items are:
The data table address type is the primary configuration parameter. If the data type can be determined by the address type, then the data type will automatically default to the correct type and any configured data type will be ignored. Any additional parameters which are not requird for that address type will also be ignored.
When "addrtype" corresponds to a boolean data type, (e.g. "discrete" or "coil"):
When "addrtype" is a selection corresponding to an integer or floating point storage type:
The default integer range is:
When "addrtype" is a selection corresponding to a string storage type:
Review the documentation on the system data table before deciding which registers, coils, or discrete inputs to use. Remember that some registers are used to hold the coils and discrete inputs and should not be used as regular registers. Remember that some coils are reserved for resetting communications faults.
# HMI config file. # 08-Jan-2009. # Client page(s) version. [clientversion] ver=Ver 0.6 Demo # Server ID. [serverid] id=HMI demo server ######################################################### [PB1] addrtype=coil memaddr=0 [PL1] addrtype=discrete memaddr=0 [Tank1Level] addrtype=holdingreg memaddr=32000 datatype=integer range=0, 100 scale=0, 1 [PumpSpeedCmd] addrtype=holdingreg memaddr=32002 datatype=integer range = -1800, 1800 scale = 5, 0.10 [IntegerTagRO2] addrtype=inputreg memaddr=40002 datatype=integer range = -32768, 32767 scale = 0, 1 [FloatTagRW1] addrtype=holdingreg memaddr=40001 datatype=float range = -32768, 32767 scale = 0, 1 ######################################################### # 32 bit integer. [Testholdingreg32] addrtype=holdingreg32 memaddr=20000 datatype=integer range = -2147483648, 2147483647 scale = 0, 1 [Testinputreg32] addrtype=inputreg32 memaddr=20000 datatype=integer range = -2147483648, 2147483647 scale = 0, 1 # Single precision floating point. [Testholdingregfloat] addrtype=holdingregfloat memaddr=20010 datatype=float range = -2147483648, 2147483647 scale = 0, 1 [Testinputregfloat] addrtype=inputregfloat memaddr=20010 datatype=float range = -2147483648, 2147483647 scale = 0, 1 # Double precision floating point. [Testholdingregdouble] addrtype=holdingregdouble memaddr=20020 datatype=float range = -2147483648, 2147483647 scale = 0, 1 [Testinputregdouble] addrtype=inputregdouble memaddr=20020 datatype=float range = -2147483648, 2147483647 scale = 0, 1 # String with 2 characters per register. # The 'datatype' parameter can be omitted. [Testholdingregstr8] addrtype=holdingregstr8 memaddr=20030 datatype=string strlen=8 [Testinputregstr8] addrtype=inputregstr8 memaddr=20030 datatype=string strlen=8 # String with one character per register. # The 'datatype' parameter can be omitted. [Testholdingregstr16] addrtype=holdingregstr16 memaddr=20040 datatype=string strlen=10 [Testinputregstr16] addrtype=inputregstr16 memaddr=20040 datatype=string strlen=9 ######################################################### # Event definitions. [&events] base=32300 0=PumpRunning, zone3 1=PumpStopped, zone3 2=Tank1Empty, zone1 3=Tank1Full, zone1, zone2 4=Tank2Empty, zone2 5=Tank2Full, zone2 # Alarm definitions. [&alarms] base=32400 0=PB1Alarm, zone1 1=PB2Alarm, zone2 2=PB3Alarm, zone3
# MB-HMI config file. # This version is for SBus # Client page(s) version. [clientversion] ver=Ver 0.71 Demo # Server ID. [serverid] id=HMIServer SBus demo ######################################################### # Push buttons. [PB1] addrtype=sbusflag memaddr=0 [PB2] addrtype=sbusflag memaddr=1 [PB4] addrtype=sbusreg memaddr=5000 datatype=integer range=0, 6 scale=0, 1 # Tank level readings. [Tank1Level] addrtype=sbusreg memaddr=5002 datatype=integer # range=0, 100 scale=0, 1 # Tank level numeric readings. [Tank1Number] addrtype=sbusreg memaddr=5002 datatype=float range=0, 250 scale=0, 2.5 [PackedStrDemo] addrtype=sbusregstr memaddr=20030 datatype=string strlen=10 ######################################################### # Event definitions. [&events] base=32300 0=PumpRunning, zone3 1=PumpStopped, zone3 2=Tank1Empty, zone1 3=Tank1Full, zone1, zone2 4=Tank2Empty, zone2 5=Tank2Full, zone2 ######################################################### # Alarm definitions. # We are using the push buttons as triggers for testing purposes. [&alarms] base=32400 0=PB1Alarm, zone1 1=PB2Alarm, zone2 2=PB3Alarm, zone3