User Tools

Site Tools


webhmi_internal_registers

This is an old revision of the document!


WebHMI Internal Registers

Through internal register it is possible to access user memory areas, WebHMI hardware related data etc. The following internal registers are available in WebHMI (for version 1.5 and higher):

User data registers


Dxxx - Data registers

Register Description Units Data type Read/Write
D0 A common register for user needs. Bit, Byte, Word, Double Word Read/Write
D1999 A common register for user needs. Bit, Byte, Word, Double Word Read/Write

The data in these registers are NOT stored after the reboot.

The user can access 2000 bytes of RAM. The register address is the address of the beginning of the fragment in the memory block.

Depending on the selected data type, a different number of bytes is required per register. So, you can access the register with address D12 as byte. In this case, there will be a reference to one byte in memory. If you access the register with the address D12 as a word (Word), then physically there will be access to two bytes with addresses D12 and D13 of which the word will be composed. In this way, you can access the individual bytes in the desired word or double word. The system does not check the register addresses for intersections or overlays. This control must be performed by the user.

DSxxx - Data static registers

Register Description Units Data type Read/Write
DS0 Non-volatile register for user needs. Bit, Byte, Word, Double Word Read/Write
DS1999 Non-volatile register for user needs. Bit, Byte, Word, Double Word Read/Write

The data in these registers are stored after rebooting. The user can access 2000 bytes in non-volatile memory. The register address is the address of the beginning of the fragment in the memory block.

Depending on the selected data type, a different number of bytes is required per register. So, you can access the register with the DS12 address as a byte. In this case, there will be a reference to one byte in memory. If you access the register with DS12 as the word (Word), then physically it will access two bytes with DS12 and DS13 addresses of which the word will be composed. In this way, you can access the individual bytes in the desired word or double word. The system does not check the register addresses for intersections or overlays. This control must be performed by the user.

Nonvolatile memory is implemented in the hardware revision platform V5.34 and higher.

Sxxx - String

Since version 1.11.0.3478 in WebHMI, a new data type has been added-strings. The strings are available as internal Sxxx registers. A total of 200 such registers are available S1 … S200.

Register Description UnitsData type Read/Write
S1 String variable 1 String Read/Write
S2 String variable 2 String Read/Write
S200 String variable 200 String Read/Write

TRxxx - Title of recipe

Since version 2.7 in WebHMI, a new type of internal registers TRxx has been added. They contain the names of recipes with the specified ID.

RegisterDescription UnitsData type Read/Write
TR1 Title of recipe with ID=1 String Read/Write
TR2 Title of recipe with ID=2 String Read/Write

Special data registers


Tx - Time registers

Register Description Units Data type Read/Write
T0 Current time Seconds [UnixTime] Read/-
T1 The time taken to exchange data with all the registers in the previous cycle. Milliseconds Double Word, Unsigned Read/-
T2 Time spent on data exchange, processing of all events, scripts, writing to the database, writing new values ​​to the devices in the previous cycle. In fact, this is a complete cycle without taking into account the pause between cycles. Milliseconds Double Word, Unsigned Int Read/-
T3 The total actual time of the previous cycle, taking into account the pause between cycles. Milliseconds Double Word, Unsigned Int Read/-

Exxx.xxx - Event registers

Registers of events. If the event X, for which id = Y, is now being executed, then some of its values ​​from registers of the form EY.xxx can be read. Only reading.

You can read the values ​​that are added to the report table. For convenience, each such value is signed directly in the condition editor.

On this screen threre are registers E1.0, E1.1, E1.2. When the event is now on, the register will store respective values from the report with id = 1. In this example the E1.0 register will store event start time [UnixTime], E1.1 - event end time or 0 if event not finished yet, E1.2 - the value from register “Recipe” at the moment of event start.

ESxxx - Event State

Event state registers.

For example, value “1” in the ES2 register means that the event with id = 2 is now running. If the register ES2 = “0”, then event is not active.

Register Description Units Data type Read/Write
ES1 Event state with id=1 Bit Read/-
ES2 Event state withid=2 Bit Read/-
ES3 Event state with id=3 Bit Read/-

ELxxx - Event Length

Event length registers. For example, the EL2 register will contain the duration in seconds of the event with id = 2, provided that this event is currently running. If the register EL2 is zero, then this means that the condition is not met or its duration is less than 1 second.

Register Description Units Data type Read/Write
EL1 Duration of the event with id=1Seconds Double Word Read/-
EL2 Duration of the event with id=2 SecondsDouble WordRead/-
EL3 Duration of the event with id=3 SecondsDouble WordRead/-

Ixxx - Intervals

Interval registers. Usually used in the event conditions. For example, if you want to receive an event that fires every 10 seconds, you can compare the value of I10 with zero (I10 == 0). If you need an interval of 2 minutes then you need to use the I120 register.

Register Description Units Data type Read/Write
I1 The remainder of the current time division by 1 Seconds Double Word, Unsigned Int Read/-
I2 The remainder of the current time division by 2 Seconds Double Word, Unsigned Int Read/-
I3 The remainder of the current time division by 3 Seconds Double Word, Unsigned Int Read/-

Rxxx - Random values

Random number generator. Rxxx = rand() % xxx.

The value of the register with the number xxx is the remainder of the division of the random number by xxx (register address).

Example: R123 will return random numbers in the range from 0 to 122 inclusive.

Register Description Units Data type Read/Write
R2 Random integer in the range from 0 to 1 (inclusive). Double Word, Unsigned Int Read/-
R3 Random integer in the range from 0 to 2 (inclusive). Double Word, Unsigned Int Read/-
R4 Random integer in the range from 0 to 3(inclusive).. Double Word, Unsigned Int Read/-

Cx - Communication registers

The presence of communication errors on different connections

Register Description Units Data type Read/Write
C0 The presence of communication errors in any of the connections. 0 means there is no communication error. A positive number indicates the connection number in which there is a communication error. Connection number Word, Unsigned IntRead/-
C1 The presence of a communication error in connection with ID = 1. 0 means there are no errors. A positive number means a register ID that can not be read. Register number Word, Unsigned Int Read/-
C2 The presence of a communication error in connection with ID = 2. 0 means there are no errors. A positive number means a register ID that can not be read. Register number Word, Unsigned Int Read/-

CDxxx - Connection Disabled registers

Connection status - enabled / disabled. This register allows you to see whether the exchange is disabled for a specific connection. If the exchange is disabled, the system will return 1. If the exchange is not disabled, it will return 0. Recording to these registers allows you to enable / disable the exchange on the desired connection. To disable the exchange, you need to write 1 to the appropriate register.

Register Description Data type Read/Write
CD1 Exchange turned on connection with ID = 1. Bit Read/Write
CD2 Exchange turned on connection with ID = 2. Bit Read/Write
CD3 Exchange turned on connection with ID = 3. Bit Read/Write

WebHMI system registers


Registers for reading WebHMI on-board hardware status

Register Description Units Data type Read/Write
H0 Flag is the validity of the temperature value. 1 = value is reliable, 0 = value is not reliable BitRead/-
H1 Validation flag of power controller registers, 1 = valid values, 0 = values ​​are not reliable Bit Read/-
H2 RTC IC Temperature Celsius degrees Double word, float 32 Read/-
H3 Input voltage Volts Double word, float 32 Read/-
H4 Battery voltage Voltage Double word, float 32 Read/-
H5 “Power OK” - power is good. Bit Read/-
H6 “Battery Low” - the battery is discharged. 1 means that the battery voltage reached a minimal but still operational voltage, WebHMI will complete its work in a regular manner. Bit Read/-
H7 Battery Critical.The voltage on the battery has reached a minimum value, and if the input voltage does not appear within 10 seconds, the controller will de-energize WebHMI. Bit Read/-
H8 System OK. 1 means the system has booted up and running. Bit Read/-
H9 “External Power Supply”. Working from 24V. 1 means that the system is powered by external power. Bit Read/-
H10 “Internal Power Supply”. Working from battery. 1 means the system is running on battery power. Bit Read/-

H11 “Reset enabled” - The timer for the RESET signal is switched on. 1 means the system is about to reboot. Bit Read/- H12 “Power OFF enabled”. 1 means the system is going to shut down. Bit Read/-

Some most important metrics of the operating system.

Register Description Units Data type Read/Write
L0 Free memory KiB Word, Unsigned Read/-
L1 Free memory plus memory occupied by OS buffers KiB Word, Unsigned IntRead/-
L2 1 minute [load average] Double Word, Float 32 Read/-
L3 5 minutes [load average] Double Word, Float 32 Read/-
L4 15 minutes [load average] Double Word, Float 32 Read/-

B0 - Sound alert register

With the help of this register you can make sounds of the built-in WebHMI buzzer. A value of 1 to 8 must be written to the register. WebHMI will issue a corresponding number of beeps. After the signals sound, WebHMI stops making a sound. To repeat the sound signal, you need to write down the desired number again in this register. You can write to this register using scripts. So, for example, you can make a squeaking when the connection breaks down or when an emergency situation occurs.

When reading from this register, 0 will always return.

DOx - Digital Output registers

Registers of external solid-state relays (SSRs). When writing to the register, the corresponding SSR will be closed.

With the help of SSR it is possible to organize control of external devices or to transmit signals to external systems. For example, you can connect a security or fire system and send them alarm signals.

Register Description Ubits Data type Read/Write
DO0 SSR number 1 BitRead/Write
DO1 SSR number 2 BitRead/Write

Weather registers

WCxxx - Weather Condition registers

Current meteorological information. A group of registers that provide current weather information at the WebHMI installation site. The data is updated approximately every two hours. The service requires an Internet connection, an account in Level2 and a subscription to the weather forecast. Registers are available since version 2.5.2400.

Register Description Data type Read/Write
WC0 Timestamp of the data received. Double Word, Unixtime Read/-
WC1 Air temperature, Celsius degrees. Double Word, Float Read/-
WC2 Pressure, hPa. Word, Int Read/-
WC3 Relative humidity, %. Word, Int Read/-
WC4 Wind speed, м/с. Double Word, Float Read/-
WC5 The direction from where the wind blows, the metrological degrees. Double Word, Float Read/-
WC6 Cloudiness, %. Word, Int Read/-
WC7 Precipitation(rain), mm. Double Word, Float Read/-
WC8 Precipitation (snow), mm. Double Word, Float Read/-
WC9 Textual description of the current weather String Read/-
webhmi_internal_registers.1533196833.txt.gz · Last modified: 2018/08/02 08:00 by emozolyak

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki