WebHMI Internal Registers

Материал из WebHMI Wiki
Перейти к: навигация, поиск
Эта страница — перевод страницы Внутренние регистры WebHMI. Перевод выполнен на 100%.

Другие языки:
English • ‎русский

The following internal registers are available in WebHMI (for version 1.5 and higher):

Cx - Communication registers

The presence of communication errors on different connections

RegisterDescriptionUnitsData typeRead/Write
C0The 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 numberWord, Unsigned IntRead/-
C1The 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 numberWord, Unsigned IntRead/-
C2The 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 numberWord, Unsigned IntRead/-
............

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.

RegisterDescriptionData typeRead/Write
CD1Exchange turned on connection with ID = 1.BitRead/Write
CD2Exchange turned on connection with ID = 2.BitRead/Write
CD3Exchange turned on connection with ID = 3.BitRead/Write
.........

Dxxx - Data registers

RegisterОписаниеUnitsData typeRead/Write
D0A common register for user needs.Bit, Byte, Word, Double WordRead/Write
...
D1999A common register for user needs.Bit, Byte, Word, Double WordRead/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

RegisterDescriptionUnitsData typeRead/Write
DS0Non-volatile register for user needs.Byte, Word, Double WordRead/Write
...
DS1999Non-volatile register for user needs.Byte, Word, Double WordRead/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.

Tx - Time registers

RegisterDescriptionUnits Data typeRead/Write
T0Current timeSeconds[UnixTime]Read/-
T1The time taken to exchange data with all the registers in the previous cycle.МилисекундыDouble Word, Unsigned IntRead/-
T2Time 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.МилисекундыDouble Word, Unsigned IntRead/-
T3The total actual time of the previous cycle, taking into account the pause between cycles.MillisecondsDouble Word, Unsigned IntRead/-

Hx - Hardware-related registers

Registers for reading WebHMI on-board hardware status

RegisterDescriptionUnitsData typeRead/Write
H0Flag is the validity of the temperature value. 1 = value is reliable, 0 = value is not reliableBitRead/-
H1Validation flag of power controller registers, 1 = valid values, 0 = values ​​are not reliableBitRead/-
H2RTC IC TemperatureCelsius degreesDouble word, float 32Read/-
H3Input voltage ВольтыDouble word, float 32Read/-
H4Battery voltageВольтыDouble word, float 32Read/-
H5“Power OK” - power is good.BitRead/-
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.BitRead/-
H7Battery 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.BitRead/-
H8System OK. 1 means the system has booted up and running.BitRead/-
H9“External Power Supply”. Working from 24V. 1 means that the system is powered by external power.BitRead/-
H10“Internal Power Supply”. Working from battery. 1 means the system is running on battery power.BitRead/-
H11"Reset enabled" - The timer for the RESET signal is switched on. 1 means the system is about to reboot.BitRead/-
H12“Power OFF enabled”. 1 means the system is going to shut down.BitRead/-

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.

RegisterDescriptionUbitsData typeRead/Write
DO0SSR number 1BitRead/Write
DO1SSR number 2BitRead/Write

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.

RegisterDescriptionUnitsData typeRead/Write
I1The remainder of the current time division by 1SecondsDouble Word, Unsigned IntRead/-
I2The remainder of the current time division by 2SecondsDouble Word, Unsigned IntRead/-
I3The remainder of the current time division by 3SecondsDouble Word, Unsigned IntRead/-
...

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.

RegisterDescriptionUnitsData type/td>Read/Write
R2Random integer in the range from 0 to 1 (inclusive).Double Word, Unsigned IntRead/-
R3Random integer in the range from 0 to 2 (inclusive).Double Word, Unsigned IntRead/-
R4Random integer in the range from 0 to 3(inclusive)..Double Word, Unsigned IntRead/-
...

Lx - Linux-related registers

Some most important metrics of the operating system.

RegisterDescriptionUnitsData typeRead/Write
L0Free memoryKiBWord, Unsigned IntRead/-
L1Free memory plus memory occupied by OS buffersKiBWord, Unsigned IntRead/-
L21 minute [load average]Double Word, Float 32Read/-
L35 minutes [load average]Double Word, Float 32Read/-
L415 minutes [load average]Double Word, Float 32Read/-

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.

Event registers.png

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.

RegisterDescriptionUnitsData typeRead/Write
ES1 Event state with id=1BitRead/-
ES2 Event state withid=2BitRead/-
ES3 Event state with id=3BitRead/-
...

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.

RegisterDescriptionUnitsData typeRead/Write
EL1Duration of the event with id=1СекундыDouble WordRead/-
EL2Duration of the event with id=2СекундыDouble WordRead/-
EL3Duration of the event with id=3СекундыDouble WordRead/-
...

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.

RegisterDescriptionData typeRead/Write
S1String variable 1StringRead/Write
S2String variable 2StringRead/Write
S3String variable 3StringRead/Write
...
S200String variable 200StringRead/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.

RegisterDescriptionData typeRead/Write
TR1Title of recipe with ID=1StringRead/Write
TR2Title of recipe with ID=2StringRead/Write
TR3Title of recipe with ID=3StringRead/Write
...


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.

RegisterDescriptionData typeRead/Write
WC0Timestamp of the data received.Double Word, UnixtimeRead/-
WC1 Air temperature, Celsius degrees.Double Word, FloatRead/-
WC2Pressure, hPa.Word, IntRead/-
WC3Relative humidity, %.Word, IntRead/-
WC4Wind speed, м/с.Double Word, FloatRead/-
WC5The direction from where the wind blows, the metrological degrees.Double Word, FloatRead/-
WC6 Cloudiness, %.Word, IntRead/-
WC7Precipitation(rain), mm.Double Word, FloatRead/-
WC8Precipitation (snow), mm.Double Word, FloatRead/-
WC9Textual description of the current weatherStringRead/-

Textual description of the current weather can be on of these: Clear, Clouds, Rain, Snow, Thunderstorm, Mist.

WFxxx - Weather Forecast registers

Weather forecast for the next day with an interval of 3 hours. The forecast is available for seven 3-hour intervals ahead. 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.

The registers are the same as the WCxxx registers. Addresses of registers are constructed in this way: [interval number] * 10 + [register address WCxxx].

Example:
WF1 = Air temperature in the next 3 hours interval.
WF21 = Air temperature in the next 6 hours interval.
WF31 = Air temperature in the next 9 hours interval.
И т.д.

For a more accurate understanding of how long a forecast is built, you can use timestamps in the WFx0 registers.

RegisterDescriptionData typeRead/Write
WF0Interval 1. The time for which the data was received.Double Word, UnixtimeRead/-
WF1Interval 1. Air temperature, degrees Celsius.Double Word, FloatRead/-
WF2Interval 1. Pressure, hPaWord, IntRead/-
WF3Interval 1. Relative humidity, %.Word, IntRead/-
WF4Interval 1. Wind speed, m/s.Double Word, FloatRead/-
WF5Interval 1. The direction from where the wind is blowing, meteorological degrees.Double Word, FloatRead/-
WF6Interval 1. Cloudiness, %.Word, IntRead/-
WF7Interval 1. Precipitation (rain), mm.Double Word, FloatRead/-
WF8Interval 1. Precipitation (snow), mm.Double Word, FloatRead/-
WF9Interval 1. Textual description of the current weatherStringRead/-
WF10Interval 2. The time for which the data was received.Double Word, UnixtimeRead/-
WF11Interval 2. Air temperature, degrees Celsius.Double Word, FloatRead/-
WF12Interval 2. Pressure, hPa.Word, IntRead/-
WF13Interval 2. Relative humidity, %.Word, IntRead/-
WF14Interval 2. Wind speed, м/с.Double Word, FloatRead/-
WF15Interval 2. The direction from where the wind is blowing, meteorological degrees.Double Word, FloatRead/-
WF16Interval 2. Cloudiness, %.Word, IntRead/-
WF17Interval 2. Precipitation (rain), mm.Double Word, FloatRead/-
WF18Interval 2. Precipitation (snow), mm.Double Word, FloatRead/-
WF19Interval 2. Textual description of the current weatherStringRead/-
............
WF60Interval 7. The time for which the data was received.Double Word, UnixtimeRead/-
WF61Interval 7. Air temperature, degrees Celsius.Double Word, FloatRead/-
WF62Interval 7. Pressure, hPa.Word, IntRead/-
WF63Interval 7. Relative humidity, %.Word, IntRead/-
WF64Interval 7. Wind speed, м/с.Double Word, FloatRead/-
WF65Interval 7. The direction from where the wind is blowing, meteorological degrees.Double Word, FloatRead/-
WF66Interval 7. Cloudiness, %.Word, IntRead/-
WF67Interval 7. Precipitation (rain), mm.Double Word, FloatRead/-
WF68Interval 7. Precipitation (snow), mm.Double Word, FloatRead/-
WF69Interval 7. Textual description of the current weatherStringRead/-

Textual description of the current weather can be: Clear, Clouds, Rain, Snow, Thunderstorm, Mist.

WSxxx - Sunset/Sunrize registers

The time of sunrise and sunset in the current day. 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.

RegisterDescriptionData typeRead/Write
WS0Sunrise time.Double Word, UnixtimeRead/-
WS1Sunset time.Double Word, UnixtimeRead/-

A textual description of the current weather can be: Clear, Clouds, Rain, Snow, Thunderstorm, Mist.