This is an old revision of the document!
Working with registers
In the world of industrial automation, Registers are understood as units of data that are attributes of automation equipment. They can describe some external parameters of technological processes (the value of temperature, pressure, flow, state of actuators, etc.) or internal states of the devices themselves (parameters of regulators, filters, alarms etc.).
Registers in the WEBHMI project correspond to similar concepts in automation systems - 'tag', 'variable' and indicate what data from the respective devices we are going to work on (read / write), in addition, they have additional attributes controlling how they will be displayed and processed by the system settings of these registers. The registers can be of two types -
Register settings in WebHMI arranged in 6 tabs, which will be explained later in details:
Basic info tab - specifies key addtibutes like name of the register, its connection, memory address etc.
Value - specifies data type (bit, byte, word, etc.), format (integer, with floating point, signed, etc.), units, possible limits, scaling etc
Log - set up how to record the register data in the log and charts
Resources - explicitly sets a special attribute, if the register contains data of a resource meter (heat, electricity etc.). Then the user can use ready tools for analytics in Level2 based on this data.
States - set alarm status (colorising) for registers - off, normal, warning, alert. In this case, visual elements (text, icons) and data in the log change color according to the register's state.
Alerts - if the register has alert bits set, then the system automatically shows alert status and saves them in a alert log.
Cross reference - to quickly find places of usage of a register
Creating a register, basic settings
To create a register, go to the Setup→ Registers menu and click the Add New Register button.
Then in the Basic info tab it will indicate:
Connection the registers belongs to
Title register's name
Address The address in the address space of this connection. While entering value, the address validation is being made. Address assignment formats are described [here].
Description - description field for the register
Category - the name of the group to which the register will be included.
Priority - polling priority. This option is used in conjunction with the Strict scan function. Registers with high priority will be polled first, registers with priority normal in the second turn. If part of the registers with normal priority does not fit during the scan, this part is polled in the next scan, etc. Registers from internal connections are polled last (after registers on external connections) regardless of this setting, since they are read quickly on the local bus of the WebHMI device.
Script alias - This name can be used in lua scripts.
Disable checkbox - disables polling this register.
Communication interval override - Override the default polling time for this register (Setup / Settings menu). Adjustable in steps of 500 ms. Up to 1 hour.
Send real time data to WebHMI cloud checknox - Specifies whether to send data to the cloud-based level2 system.
Value tab settings
Value tab of the register edit page is used to set the type and format of register data. These settings affect how the read binary data from the registers of the connected device are interpreted for display or recording.
The possible options are:
Bit - for reading bits of discrete inputs, outputs, single memory bit etc. However, for internal WebHMI registers bit register will occupy byte.
Word - reading in words
Double word - reading in double words. For double words there is an option to change normal word order to reverse:
Unix time - format used in PHP, is set as Y-m-d H:i:s, e.g., to display the date as day - month - year (DD-MM-YYYY), you set format string like this d-m-Y.
String - the system will treat data in the register as string data. Intended mainly to use with internal Sxx registers.
Specifies the format of the read data. Possible options are:
Fixed point float without sign (range of 0..+1)
Fixed point float with sign (range of -1..+1)
without sign (0…1) (signed / unsigned)
Signed floating point, according to IEEE754 - 32 bit
Singned Floating Point 24 bit(such format is used in OWEN devices e.g.)
Bit mask allows to conviniently check the state of individual bits in a source register.
When setting the bitmask to the register, the value from the register will be compared with the sum of corresponding weights 2^p (p - bit position, starting from 0) of the selected bits.
In the above picture 2 highest bits are selected, so when there is a value greater or equal to 128 (2^7) + 64 (2^6) = 192 in the source register, WebHMI's copy of this register will have 3. Usually this feature is used to check only one bit, so WebHMI register has either 0 or 1 value clearly indicating if certain bit in the source register is reset or set.
But sometimes it is neccessary to write a defined mask (group of bits) to the end device. In this case remember how the number in WebHMI register is obtain. E.g. to set 7th and 6th bit (started from 0) in the source register, 3 value has to be written in WebHMI register. Or if 7th and zero bits were checked in the mask, 129 would have to be written to set these bits.
Allows you to convert register data into increment or derivative.
In the first case (delta value), the register will be equal to the difference of the current subtracted value and the previous one. In the second (Delta value / Delta time) - delta value, divided by the time between polls, i.e. Derivative with respect to time.
Display as time duration
Show the number in seconds in the format of the length of the time interval (hours, days, etc.). The format is useful, for example, when displaying the duration of events.
Contains the enumeration of pairs 'value, text word(s)', when you select a dictionary for the register, the values read from the device are compared with the data of the dictionary and, if the word matches, the word corresponding to the value will be found. If there is a mismatch, the register will contain the value itself. The dictionaries are created and edited in the menu Setup → Dictionary.
If third element in a row is set (e.g. “1, ON, client:dashboards.divider.on”), Level2 cloud system can interpret it like a tag and use its own dictionary with multilanguage support.
Units of measurement
Indication of engineering units for the register data. The string specified in the field will be displayed after the text string with the register value on dashboards.
Show the result of the formula:
result = value_read х multiplier + shift value
Scaling value with offset in the register to convert raw value from ADC to engineering units. The result is shown with the set precision.
Min/Max Allowed Value For Operator
These fields allow you to limit the min. and max. possible value for the register, which can be changed by the user from the dashboard.
Min/Max Reasonable Value
These fields allow to designate a zone of unreliable values of the register, thus it is possible to judge the sensor failure. When reading the value outside the zone, a nil will be written to the register, which in turn can be defined as a 'failed state'.
Log tab settings
Contains settings affecting how register values are saved in a database.
Graph data setup
Simplest way is to set up register write at regular intervals of time and view them on graphs. Then it is enough to enable this option, select color and choose time intervals:
This method suitable for slowly changing parameters like temperature, pressure, humidity etc. which are the most typical parameters in a system monitored with WebHMI.
But sometimes there is a need to track values more precisely, e.g. to view signal transitions, rising or falling edges of the discrete signals etc. Then there is an option to use log data.
Writing registers to the log
In this section 'Log' means a separate part of a database which saves register values and:
it can be a source of data for graphs
has special analytic tool to view when and how register changed. After selecting the option 'Enable Log', you can track register changes in the menu item Analytics / Registers Log.
Change tolerance -'Tolerance' (absolute value or %) is the difference between new and previous register value, , if exceeded, its value will be written to the log. If the field is left blank, the record will occur upon any change. The recording frequency will be determined by the settings of the following items.
Min log interval - serves as a filter for data, limiting recording frequency to this interval, so that time between two records will not exceed this interval
Max log interval - If the register did not change its value, or the changes were within the 'tolerance', then this setting nevertheless allows writing the register to the log after the interval specified in the input field has expired in seconds.
Max graph interval - Log data can be a source for historical graphs (see register settings for recording on the graph below), then if there was no data within the specified interval, the graph will have a corresponding gap.
WARNING! Leaving 'Change tolerance' field empty will cause register write at ANY change. There is always some noise in
ADC signal, so every WebHMI scan there will be writes to database. If there are many such registers this will
affect system perfomance. Use log settings carefully and adequate to register type
Send log data to Level2 system - allows sending log and graph data to level2
Selection allows to send register value as a resource meter reading to Level2 cloud system and then generatate resource consumption reports.
Allows you to set 4 color alarm states for the corresponding specific values read from the register:
Disabled state - 'Off', the data in the register indicate that the mechanism is off, the sensor is off (or an open circuit, for example, for a signal of 4..20mA is less than 4mA), there is no working pressure, etc. The default alarm color is gray
Normal state - 'Norm', the value corresponding to normal operation. The default alarm color is green
Warning state- 'Warning', the parameter approaches the dangerous boundary. The default alarm color is yellow
Alert state - 'Emergency' - the alarm status of the parameter. The default alarm color is red.
With states defined, the dashboard elements having colorize opion set, will relfect register value with corresponding color.
When no states are defined or the value is outside of the defined ranges for states, it will be displayed in black
(and dashboard element linked with this register too).
The value range can be defined in two ways -
With static (default) setting, the range of register state values is determined by the formula:' 'Min ⇐ (register value)
With dynamic setting Min. and Max. are also parameters specified in the form of other registers, and thus, for example, depending on the recipe of the produced product, the warning and emergency zones will change.
Here an example of static settings, min. and max. are constants:
With dynamic state settings end points of range are floating (Delta values are constants which are added or subtracted to dynamic margins):
All states have identical settings.
This tab allows to define alerts that will occur when certain bits of the register is set. See more about them here
To overview places where the register is used.
Working with a list of connections and registers
The list of registers is multi-level, when you minimize the list with the > signs, only the list of connections and categories is displayed.
Format of the register list:
Interval - polling interval for the register
Address -Address of the register according to the protocol used (for connection - network address)
Alias - Variable name for use in Lua scripts
Type - Register data type (for connection - protocol type)
State - The poll of this register (connection) by the driver is enabled or disabled. By clicking on this icon, you can enable or disable polling for this connection or register. To the left of the status sign is the priority of the poll (dash - normal, up arrow - high, R - read on demand). In the screenshot above, the elements has following states:
register #1 - Read On Demad (to read the value click the (R) icon)
register #56 - polling enabled and high polling priority is set
register #57 - polling enabled and normal priority is set
connection #2 - is disabled
Value - Displaying the current state of the register, a convenient function for debugging - you can immediately see the correctness of the setting and the presence of a connection
Edit, Delete, Clone buttons - corresponds to editing, deleting or cloning register(connection).
Working with selections
When the cursor hovers over the connection, a checkbox appears to the right of it for selecting or deselecting all registers in the connection.
There are some group operations inside Tools sub-menu for selected register - see below.
Export registers - export selected register in a *.csv file to have a template or make some bulk modification using convenient spreadsheet editor
Disable - disable polling of the selected register
Enable - enable polling of the selected register
Delete - delete selected register
Change connection - move selected register to another connection or category
Import registers makes reverse to export operation with csv - file containing prepared list of register.
Overwrite existent registers - If the option is selected, if there are already registers with the given ID when importing the list in the project, they will be overwritten, otherwise registers with matching IDs from the list will receive new IDs.
Changing order of reading connections
The order of reading connections can differ from the order in which they are shown in Connection / Register list. Some serial devices may not “like” co-existing with certain devices in adjacent polls. With this tool you can sort the devices in the polling list.
Internal register map
With this tool you can make a overview of current memory map of the internal WebHMI registers.
Sometimes after intensive work with bulk import and export operation due to errors made during edition some register might be placed into wrong addresses and cause overlapping. (shown red in the above picture)
Another possible use for map is to quickly find some internal register in a list, using browser hotkey F3 or Crtl-F. And quickly follow the link to view register's settings.