Внутренние регистры WebHMI/en — различия между версиями
(Новая страница: «== B0 - Sound alert register == <p>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 regi…») |
(Новая страница: «== 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> | + | <p>Registers of external dry contacts. When writing to the register, the corresponding dry contact will be closed.</p> |
− | <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> |
<table border="1" cellspacing="0"> | <table border="1" cellspacing="0"> | ||
− | <tr><td> | + | <tr><td>Register</td><td>Description</td><td>Ubits</td><td>Data type</td><td>Read/Write</td></tr> |
− | <tr><td>DO0</td><td> | + | <tr><td>DO0</td><td>Dry contact number 1</td><td></td><td>Bit</td><td>Read/Write</td></tr> |
− | <tr><td>DO1</td><td> | + | <tr><td>DO1</td><td>Dry contact number 2</td><td></td><td>Bit</td><td>Read/Write</td></tr> |
</table> | </table> | ||
Версия 09:05, 13 июля 2017
The following internal registers are available in WebHMI (for version 1.5 and higher):
Содержание
- 1 Cx - Communication registers
- 2 CDxxx - Connection Disabled registers
- 3 Dxxx - Data registers
- 4 DSxxx - Data static registers
- 5 Tx - Time registers
- 6 Hx - Hardware-related registers
- 7 B0 - Sound alert register
- 8 DOx - Digital Output registers
- 9 Ixxx - Intervals
- 10 Rxxx - Random values
- 11 Lx - Linux-related registers
- 12 Exxx.xxx - Event registers
- 13 ESxxx - Event State
- 14 ELxxx - Event Length
- 15 Sxxx - String
- 16 TRxxx - Title of recipe
- 17 WCxxx - Weather Condition registers
- 18 WFxxx - Weather Forecast registers
- 19 WSxxx - Sunset/Sunrize registers
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 Int | Read/- |
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 |
... | ... | ... |
Dxxx - Data registers
Register | Описание | 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. | Byte, Word, Double Word | Read/Write | |||
... | ||||||
DS1999 | Non-volatile register for user needs. | 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.
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. | Милисекунды | Double Word, Unsigned Int | 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. | Милисекунды | 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/- |
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 | Bit | Read/- | |
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 | Вольты | Double word, float 32 | Read/- |
H4 | Battery 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/- |
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 dry contacts. When writing to the register, the corresponding dry contact will be closed.
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.
Register | Description | Ubits | Data type | Read/Write |
DO0 | Dry contact number 1 | Bit | Read/Write | |
DO1 | Dry contact number 2 | Bit | Read/Write |
Ixxx - Intervals
Регистры интервалов. Обычно применяются в условиях событий. Например, если нужно получить событие, которое срабатывает каждые 10 секунд, то можно сравнивать значение регистра I10 c нулем (I10 == 0). Если нужен интервал 2 минуты то нужно использовать регистр I120.
Регистр | Описание | Единицы измерения | Тип данных | Read/Write | ||
I1 | Остаток деления текущего времени на 1 | Секунды | Double Word, Unsigned Int | Read/- | ||
I2 | Остаток деления текущего времени на 2 | Секунды | Double Word, Unsigned Int | Read/- | ||
I3 | Остаток деления текущего времени на 3 | Секунды | Double Word, Unsigned Int | Read/- | ||
... |
Rxxx - Random values
Генератор случайных чисел. Rxxx = rand() % xxx.
Значение регистра с номером xxx это остаток от деления случайного числа на xxx (адрес регистра).
Пример: R123 будет возвращать случайные числа в диапазоне от 0 до 122 включительно.
Регистр | Описание | Единицы измерения | Тип данных | Read/Write | ||
R2 | Случайное целое в интервале от 0 до 1 (включительно). | Double Word, Unsigned Int | Read/- | |||
R3 | Случайное целое в интервале от 0 до 2 (включительно). | Double Word, Unsigned Int | Read/- | |||
R4 | Случайное целое в интервале от 0 до 3 (включительно). | Double Word, Unsigned Int | Read/- | |||
... |
Некоторые наиболее важные метрики операцинной системы.
Регистр | Описание | Единицы измерения | Тип данных | Read/Write |
L0 | Свободная память | KiB | Word, Unsigned Int | Read/- |
L1 | Свободная память плюс память занятая буферами ОС | KiB | Word, Unsigned Int | Read/- |
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/- |
Exxx.xxx - Event registers
Регистры из условий. Если условие Х, у которого id = Y, сейчас выполняется, то можно читать некоторые его значения из регистров вида EY.xxx. Только чтение.
Читать можно те значения, которые добавлены в таблицу отчета. Для удобства, каждое такое значение подписано прямо в редакторе условий.
На этом экране видны регистры 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=1 | Bit | Read/- | |||
ES2 | Состояние условия с id=2 | Bit | Read/- | |||
ES3 | Состояние условия с id=3 | Bit | Read/- | |||
... |
ELxxx - Event Length
Регистры длительности событий.
Например, в регистре EL2 будет содержаться длительность в секундах выполнения события с id=2 при условии что это событие сейчас выполняется. Если в регистре EL2 ноль то это это значит что условие не выполняется или его длительность меньше 1 секунды.
Регистр | Описание | Единицы измерения | Тип данных | Read/Write | ||
EL1 | Длительность события с id=1 | Секунды | Double Word | Read/- | ||
EL2 | Длительность события с id=2 | Секунды | Double Word | Read/- | ||
EL3 | Длительность события с id=3 | Секунды | Double Word | Read/- | ||
... |
Sxxx - String
Начиная с версии 1.11.0.3478 в WebHMI добавился новый тип данных - строки. Строки доступны как внутренние регистры Sxxx. Всего доступно 200 таких регистров S1...S200.
Регистр | Описание | Тип данных | Read/Write | |||
S1 | Переменная типа строка 1 | String | Read/Write | |||
S2 | Переменная типа строка 2 | String | Read/Write | |||
S3 | Переменная типа строка 3 | String | Read/Write | |||
... | ||||||
S200 | Переменная типа строка 200 | String | Read/Write |
TRxxx - Title of recipe
Начиная с версии 2.7 в WebHMI добавился новый тип внутренних регистров TRxx. В них содержатся названия рецептов с указанным ID.
Регистр | Описание | Тип данных | Read/Write | |||
TR1 | Название рецепа с ID=1 | String | Read/Write | |||
TR2 | Название рецепа с ID=2 | String | Read/Write | |||
TR3 | Название рецепа с ID=3 | String | Read/Write | |||
... |
WCxxx - Weather Condition registers
Текущая метеоинформация. Группа регистров, предоставляющих погодную информацию на текущий момент в месте установки WebHMI. Данные обновляются примерно каждые два часа. Для работы сервиса требуется интернет-подключение, учетная запись в Level2 и подписка на метеопрогноз. Регистры доступны начиная с версии 2.5.2400.
Регистр | Описание | Тип данных | Read/Write |
WC0 | Время, для которого получены данные. | Double Word, Unixtime | Read/- |
WC1 | Температура воздуха, градусы Цельсия. | Double Word, Float | Read/- |
WC2 | Давление, hPa. | Word, Int | Read/- |
WC3 | Относительная влажность, %. | Word, Int | Read/- |
WC4 | Скорость ветра, м/с. | Double Word, Float | Read/- |
WC5 | Направление, откуда дует ветер, метрологические градусы. | Double Word, Float | Read/- |
WC6 | Облачность, %. | Word, Int | Read/- |
WC7 | Количество осадков (дождь), мм. | Double Word, Float | Read/- |
WC8 | Количество осадков (снег), мм. | Double Word, Float | Read/- |
WC9 | Текстовое описание текущей погоды | String | Read/- |
Текстовое описание текущей погоды может быть: 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, Unixtime | Read/- |
WF1 | Интервал 1. Температура воздуха, градусы Цельсия. | Double Word, Float | Read/- |
WF2 | Интервал 1. Давление, hPa. | Word, Int | Read/- |
WF3 | Интервал 1. Относительная влажность, %. | Word, Int | Read/- |
WF4 | Интервал 1. Скорость ветра, м/с. | Double Word, Float | Read/- |
WF5 | Интервал 1. Направление, откуда дует ветер, метрологические градусы. | Double Word, Float | Read/- |
WF6 | Интервал 1. Облачность, %. | Word, Int | Read/- |
WF7 | Интервал 1. Количество осадков (дождь), мм. | Double Word, Float | Read/- |
WF8 | Интервал 1. Количество осадков (снег), мм. | Double Word, Float | Read/- |
WF9 | Интервал 1. Текстовое описание текущей погоды | String | Read/- |
WF10 | Интервал 2. Время, для которого получены данные. | Double Word, Unixtime | Read/- |
WF11 | Интервал 2. Температура воздуха, градусы Цельсия. | Double Word, Float | Read/- |
WF12 | Интервал 2. Давление, hPa. | Word, Int | Read/- |
WF13 | Интервал 2. Относительная влажность, %. | Word, Int | Read/- |
WF14 | Интервал 2. Скорость ветра, м/с. | Double Word, Float | Read/- |
WF15 | Интервал 2. Направление, откуда дует ветер, метрологические градусы. | Double Word, Float | Read/- |
WF16 | Интервал 2. Облачность, %. | Word, Int | Read/- |
WF17 | Интервал 2. Количество осадков (дождь), мм. | Double Word, Float | Read/- |
WF18 | Интервал 2. Количество осадков (снег), мм. | Double Word, Float | Read/- |
WF19 | Интервал 2. Текстовое описание текущей погоды | String | Read/- |
... | ... | ... | ... |
WF60 | Интервал 7. Время, для которого получены данные. | Double Word, Unixtime | Read/- |
WF61 | Интервал 7. Температура воздуха, градусы Цельсия. | Double Word, Float | Read/- |
WF62 | Интервал 7. Давление, hPa. | Word, Int | Read/- |
WF63 | Интервал 7. Относительная влажность, %. | Word, Int | Read/- |
WF64 | Интервал 7. Скорость ветра, м/с. | Double Word, Float | Read/- |
WF65 | Интервал 7. Направление, откуда дует ветер, метрологические градусы. | Double Word, Float | Read/- |
WF66 | Интервал 7. Облачность, %. | Word, Int | Read/- |
WF67 | Интервал 7. Количество осадков (дождь), мм. | Double Word, Float | Read/- |
WF68 | Интервал 7. Количество осадков (снег), мм. | Double Word, Float | Read/- |
WF69 | Интервал 7. Текстовое описание текущей погоды | String | Read/- |
Текстовое описание текущей погоды может быть: Clear, Clouds, Rain, Snow, Thunderstorm, Mist.
WSxxx - Sunset/Sunrize registers
Время восхода и заката солнца в текущих сутках. Для работы сервиса требуется интернет-подключение, учетная запись в Level2 и подписка на метеопрогноз. Регистры доступны начиная с версии 2.5.2400.
Регистр | Описание | Тип данных | Read/Write |
WS0 | Время рассветра. | Double Word, Unixtime | Read/- |
WS1 | Время заката. | Double Word, Unixtime | Read/- |
Текстовое описание текущей погоды может быть: Clear, Clouds, Rain, Snow, Thunderstorm, Mist.