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
Any section name other than a reserved tag or events, alarms, or erplist 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 for Modbus communications:
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. 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 |
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" is "discrete" or "coil":
When "addrtype" is a selection corresponding to an integer or floating point storage type:
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.
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 coils area of 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 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 coil 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
The ERP list defines which of the HMI address tags are visible to the ERP protocol. All of the tags listed in the ERP list must be existing address tags.
The ERP list is identified by the section "&erplist". There are two items, "read" and "write". The tags referenced by "read" are available to the "read" ERP command. The tags referenced by "write" are available to the "write" ERP command.
[&erplist] read = PL1, PL4, PumpSpeedActual, PumpSpeedCmd, Tank1Level, Tank2Number write = PB1, PumpSpeedCmd
# 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