Wb-mqtt-serial templates/en: различия между версиями

Новая страница: «There is an interesting parameter in the settings of the device: <syntaxhighlight lang="JSON"> "max_read_registers": 0,</syntaxhighlight> This parameter descri…»
(Новая страница: «The WB-MS-THLS device is a universal combined Modbus sensor for temperature, humidity, light and sound pressure. The device provides a…»)
(Новая страница: «There is an interesting parameter in the settings of the device: <syntaxhighlight lang="JSON"> "max_read_registers": 0,</syntaxhighlight> This parameter descri…»)
Строка 173: Строка 173:
</div>
</div>


В настройках устройства интересен параметр <syntaxhighlight lang="JSON">    "max_read_registers": 0,</syntaxhighlight> Этот параметр описывает максимальное количество регистров, считываемых с устройства при запросе. Значение по умолчанию — 1, в нашем случае мы указываем считывать все регистры за один проход (bulk read).
There is an interesting parameter in the settings of the device: <syntaxhighlight lang="JSON">    "max_read_registers": 0,</syntaxhighlight> This parameter describes the maximum number of registers that can be read from the device when requested. The default value is 1, in our case we specify to read all registers in one pass (bulk read).
В настройках канала "Temperature" имеются три параметра, на которые стоит обратить внимание:
In the settings of the channel "Temperature" there are three parameters that are worth paying attention to:
<syntaxhighlight lang="JSON">
<syntaxhighlight lang="JSON">
     "format": "s16",
     "format": "s16",
Строка 180: Строка 180:
     "error_value": "0x7FFF"
     "error_value": "0x7FFF"
</syntaxhighlight>
</syntaxhighlight>
Параметр '''"format": "s16"''' указывает на то, что число в регистрах представлено в виде знакового 16-битного целого, '''"scale": 0.1''' — говорит о том, что полученное из регистров значение следует домножить на коэффициент масштабирования 0,1 для получения значения температуры, а параметр '''"error_value": "0x7FFF"''' задает значение, получаемое из регистра, указывающее на то, что при опросе датчика произошла ошибка. Такой параметр будет выделен красным цветом в Web-интерфейсе контроллера. Применять такой параметр следует, если вы знаете, какое значение выдает ваше устройство в случае ошибки.
Parameter'''"format": "s16"''' indicates that the number in the registers is represented as a signed 16-bit integer, '''"scale": 0.1''' — indicates that the value obtained from the registers should be multiplied by the scaling factor 0.1 to obtain the temperature value, and the parameter '''"error_value": "0x7FFF"''' sets the value sent from the register, indicating that an error occurred during the sensor poll. This parameter will be highlighted in red in the web interface of the controller. You should use this option if you know what value your device sends in case of an error.




12 063

правки