Внутренние регистры WebHMI/en — различия между версиями

Материал из WebHMI Wiki
Перейти к: навигация, поиск
(Новая страница: «== DOx - Digital Output registers == <p>Registers of external dry contacts. When writing to the register, the corresponding dry contact will be closed.</p> <p>Wit…»)
Строка 82: Строка 82:
  
 
== DOx - Digital Output registers ==
 
== DOx - Digital Output registers ==
<p>Registers of external dry contacts. When writing to the register, the corresponding dry contact will be closed.</p>
+
<p>Registers of external solid-state relays (SSRs). When writing to the register, the corresponding SSR will be closed.</p>
<p>With the help of dry contacts it is possible to organize control of external devices or to transmit signals but external systems. For example, you can connect a security or fire system and send them alarm signals.</p>
+
<p>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.</p>
 
<table border="1" cellspacing="0">
 
<table border="1" cellspacing="0">
 
<tr><td>Register</td><td>Description</td><td>Ubits</td><td>Data type</td><td>Read/Write</td></tr>
 
<tr><td>Register</td><td>Description</td><td>Ubits</td><td>Data type</td><td>Read/Write</td></tr>
<tr><td>DO0</td><td>Dry contact number 1</td><td></td><td>Bit</td><td>Read/Write</td></tr>
+
<tr><td>DO0</td><td>SSR number 1</td><td></td><td>Bit</td><td>Read/Write</td></tr>
<tr><td>DO1</td><td>Dry contact number 2</td><td></td><td>Bit</td><td>Read/Write</td></tr>
+
<tr><td>DO1</td><td>SSR number 2</td><td></td><td>Bit</td><td>Read/Write</td></tr>
 
</table>
 
</table>
  

Версия 09:07, 13 июля 2017

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

Регистры интервалов. Обычно применяются в условиях событий. Например, если нужно получить событие, которое срабатывает каждые 10 секунд, то можно сравнивать значение регистра I10 c нулем (I10 == 0). Если нужен интервал 2 минуты то нужно использовать регистр I120.

РегистрОписаниеЕдиницы измеренияТип данныхRead/Write
I1Остаток деления текущего времени на 1СекундыDouble Word, Unsigned IntRead/-
I2Остаток деления текущего времени на 2СекундыDouble Word, Unsigned IntRead/-
I3Остаток деления текущего времени на 3СекундыDouble Word, Unsigned IntRead/-
...

Rxxx - Random values

Генератор случайных чисел. Rxxx = rand() % xxx.

Значение регистра с номером xxx это остаток от деления случайного числа на xxx (адрес регистра).

Пример: R123 будет возвращать случайные числа в диапазоне от 0 до 122 включительно.

РегистрОписаниеЕдиницы измеренияТип данныхRead/Write
R2Случайное целое в интервале от 0 до 1 (включительно).Double Word, Unsigned IntRead/-
R3Случайное целое в интервале от 0 до 2 (включительно).Double Word, Unsigned IntRead/-
R4Случайное целое в интервале от 0 до 3 (включительно).Double Word, Unsigned IntRead/-
...

Lx - Linux-related registers

Некоторые наиболее важные метрики операцинной системы.

РегистрОписаниеЕдиницы измеренияТип данныхRead/Write
L0Свободная памятьKiBWord, Unsigned IntRead/-
L1Свободная память плюс память занятая буферами ОСKiBWord, 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

Регистры из условий. Если условие Х, у которого id = Y, сейчас выполняется, то можно читать некоторые его значения из регистров вида EY.xxx. Только чтение.

Читать можно те значения, которые добавлены в таблицу отчета. Для удобства, каждое такое значение подписано прямо в редакторе условий.

Event registers.png

На этом экране видны регистры E1.0, E1.1, E1.2. Когда условие выполняется то в них будут содержаться соответствующие значения из отчета с id = 1. В данном примере в регистре E1.0 будет время начала выполнения условия в формате [UnixTime], в E1.1 время его завершения либо 0 если оно еще не завершилось, в E1.2 - значение из регистра "Рецепт" на момент начала события.

ESxxx - Event State

Регистры состояния условий.

Например, единица в регистре ES2 означает что событие с id=2 сейчас выполняется. Если в регистре ES2 ноль то это это значит что условие не выполняется.

РегистрОписаниеЕдиницы измеренияТип данныхRead/Write
ES1Состояние условия с id=1BitRead/-
ES2Состояние условия с id=2BitRead/-
ES3Состояние условия с id=3BitRead/-
...

ELxxx - Event Length

Регистры длительности событий.

Например, в регистре EL2 будет содержаться длительность в секундах выполнения события с id=2 при условии что это событие сейчас выполняется. Если в регистре EL2 ноль то это это значит что условие не выполняется или его длительность меньше 1 секунды.

РегистрОписаниеЕдиницы измеренияТип данныхRead/Write
EL1Длительность события с id=1СекундыDouble WordRead/-
EL2Длительность события с id=2СекундыDouble WordRead/-
EL3Длительность события с id=3СекундыDouble WordRead/-
...

Sxxx - String

Начиная с версии 1.11.0.3478 в WebHMI добавился новый тип данных - строки. Строки доступны как внутренние регистры Sxxx. Всего доступно 200 таких регистров S1...S200.

РегистрОписаниеТип данныхRead/Write
S1Переменная типа строка 1StringRead/Write
S2Переменная типа строка 2StringRead/Write
S3Переменная типа строка 3StringRead/Write
...
S200Переменная типа строка 200StringRead/Write

TRxxx - Title of recipe

Начиная с версии 2.7 в WebHMI добавился новый тип внутренних регистров TRxx. В них содержатся названия рецептов с указанным ID.

РегистрОписаниеТип данныхRead/Write
TR1Название рецепа с ID=1StringRead/Write
TR2Название рецепа с ID=2StringRead/Write
TR3Название рецепа с ID=3StringRead/Write
...


WCxxx - Weather Condition registers

Текущая метеоинформация. Группа регистров, предоставляющих погодную информацию на текущий момент в месте установки WebHMI. Данные обновляются примерно каждые два часа. Для работы сервиса требуется интернет-подключение, учетная запись в Level2 и подписка на метеопрогноз. Регистры доступны начиная с версии 2.5.2400.

РегистрОписаниеТип данныхRead/Write
WC0Время, для которого получены данные.Double Word, UnixtimeRead/-
WC1Температура воздуха, градусы Цельсия.Double Word, FloatRead/-
WC2Давление, hPa.Word, IntRead/-
WC3Относительная влажность, %.Word, IntRead/-
WC4Скорость ветра, м/с.Double Word, FloatRead/-
WC5Направление, откуда дует ветер, метрологические градусы.Double Word, FloatRead/-
WC6Облачность, %.Word, IntRead/-
WC7Количество осадков (дождь), мм.Double Word, FloatRead/-
WC8Количество осадков (снег), мм.Double Word, FloatRead/-
WC9Текстовое описание текущей погодыStringRead/-

Текстовое описание текущей погоды может быть: Clear, Clouds, Rain, Snow, Thunderstorm, Mist.

WFxxx - Weather Forecast registers

Прогноз погоды на ближайшие сутки с интервалом 3 часа. Доступен прогноз на семь 3-х часовых интервалов вперед. Данные обновляются примерно каждые два часа. Для работы сервиса требуется интернет-подключение, учетная запись в Level2 и подписка на метеопрогноз. Регистры доступны начиная с версии 2.5.2400.

Регистры аналогичны регистрам WCxxx. Адреса регистров строятся таким образом: [номер интервала] * 10 + [адрес регистра WCxxx].

Пример:
WF1 = Температура воздуха в следующем 3-х часовом интервале.
WF21 = Температура воздуха примерно через 6 часов.
WF31 = Температура воздуха примерно через 9 часов.
И т.д.

Для более точного понимания на какое время строится прогноз, можно использовать метки времени в регистрах WFx0.

РегистрОписаниеТип данныхRead/Write
WF0Интервал 1. Время, для которого получены данные.Double Word, UnixtimeRead/-
WF1Интервал 1. Температура воздуха, градусы Цельсия.Double Word, FloatRead/-
WF2Интервал 1. Давление, hPa.Word, IntRead/-
WF3Интервал 1. Относительная влажность, %.Word, IntRead/-
WF4Интервал 1. Скорость ветра, м/с.Double Word, FloatRead/-
WF5Интервал 1. Направление, откуда дует ветер, метрологические градусы.Double Word, FloatRead/-
WF6Интервал 1. Облачность, %.Word, IntRead/-
WF7Интервал 1. Количество осадков (дождь), мм.Double Word, FloatRead/-
WF8Интервал 1. Количество осадков (снег), мм.Double Word, FloatRead/-
WF9Интервал 1. Текстовое описание текущей погодыStringRead/-
WF10Интервал 2. Время, для которого получены данные.Double Word, UnixtimeRead/-
WF11Интервал 2. Температура воздуха, градусы Цельсия.Double Word, FloatRead/-
WF12Интервал 2. Давление, hPa.Word, IntRead/-
WF13Интервал 2. Относительная влажность, %.Word, IntRead/-
WF14Интервал 2. Скорость ветра, м/с.Double Word, FloatRead/-
WF15Интервал 2. Направление, откуда дует ветер, метрологические градусы.Double Word, FloatRead/-
WF16Интервал 2. Облачность, %.Word, IntRead/-
WF17Интервал 2. Количество осадков (дождь), мм.Double Word, FloatRead/-
WF18Интервал 2. Количество осадков (снег), мм.Double Word, FloatRead/-
WF19Интервал 2. Текстовое описание текущей погодыStringRead/-
............
WF60Интервал 7. Время, для которого получены данные.Double Word, UnixtimeRead/-
WF61Интервал 7. Температура воздуха, градусы Цельсия.Double Word, FloatRead/-
WF62Интервал 7. Давление, hPa.Word, IntRead/-
WF63Интервал 7. Относительная влажность, %.Word, IntRead/-
WF64Интервал 7. Скорость ветра, м/с.Double Word, FloatRead/-
WF65Интервал 7. Направление, откуда дует ветер, метрологические градусы.Double Word, FloatRead/-
WF66Интервал 7. Облачность, %.Word, IntRead/-
WF67Интервал 7. Количество осадков (дождь), мм.Double Word, FloatRead/-
WF68Интервал 7. Количество осадков (снег), мм.Double Word, FloatRead/-
WF69Интервал 7. Текстовое описание текущей погодыStringRead/-

Текстовое описание текущей погоды может быть: Clear, Clouds, Rain, Snow, Thunderstorm, Mist.

WSxxx - Sunset/Sunrize registers

Время восхода и заката солнца в текущих сутках. Для работы сервиса требуется интернет-подключение, учетная запись в Level2 и подписка на метеопрогноз. Регистры доступны начиная с версии 2.5.2400.

РегистрОписаниеТип данныхRead/Write
WS0Время рассветра.Double Word, UnixtimeRead/-
WS1Время заката.Double Word, UnixtimeRead/-

Текстовое описание текущей погоды может быть: Clear, Clouds, Rain, Snow, Thunderstorm, Mist.