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

Новая страница: «Here you should pay attention to the fact that the address of the register can be set in hexadecimal form:''' "address": "0x1224" ''', the real scaling factor can…»
(Новая страница: «What is so important in this template? First of all, we specify in the device parameters that no more than 60 registers should be read at the same time, so as no…»)
(Новая страница: «Here you should pay attention to the fact that the address of the register can be set in hexadecimal form:''' "address": "0x1224" ''', the real scaling factor can…»)
Строка 885: Строка 885:
</syntaxhighlight>  
</syntaxhighlight>  


Здесь стоит обратить внимание на то, что адрес регистра может задаваться и в шестнадцатеричном виде: '''"address": "0x1224"''', вещественный коэффициент масштабирования можно задавать в экспоненциальной записи: '''"scale": 3.125e-05''', при считывании значения округлять его до нужного порядка: '''"round_to": 0.0001''', а также учитывать, что число в Modbus-регистрах хранится в порядке от младшего к старшему: '''"word_order": "little_endian"'''.
Here you should pay attention to the fact that the address of the register can be set in hexadecimal form:''' "address": "0x1224" ''', the real scaling factor can be set in the exponential notation:''' "scale": 3.125 e-05'''', when reading the value round it to the desired order:''' "round_to": 0.0001''', and also take into account that the number in the Modbus-registers is stored in order from the youngest to the oldest: '''"word_order": "little_endian"'''. Storage formats for 16-bit Modbus registers are described as follows:
Форматы хранения для 16-битных Modbus регистров описываются следующим образом:
<pre>
<pre>
         big-endian    : ( [0xAA 0xBB] [0xCC 0xDD] => 0xAABBCCDD )  
         big-endian    : ( [0xAA 0xBB] [0xCC 0xDD] => 0xAABBCCDD )  
         little-endian : ( [0xAA 0xBB] [0xCC 0xDD] => 0xCCDDAABB )
         little-endian : ( [0xAA 0xBB] [0xCC 0xDD] => 0xCCDDAABB )
</pre>
</pre>
По умолчанию предполагается формат big-endian.
The default format is big-endian.


Типы переменных, используемых в шаблонах, перечислены в следующей таблице:
Типы переменных, используемых в шаблонах, перечислены в следующей таблице:
12 063

правки