Sensors Modbus Management/en: различия между версиями

Нет описания правки
 
Строка 554: Строка 554:
Let's check whether it is true that we are connected to the module of the desired type. (Module wb-mqtt-serial needs to be stopped). At address 200, a unique signature of 6 registers is stored. Let's read 6 registers, starting with the address 200, and convert the received hexadecimal answer into a character string:
Let's check whether it is true that we are connected to the module of the desired type. (Module wb-mqtt-serial needs to be stopped). At address 200, a unique signature of 6 registers is stored. Let's read 6 registers, starting with the address 200, and convert the received hexadecimal answer into a character string:


<div class="mw-translate-fuzzy">
<syntaxhighlight lang="bash">echo  -e `modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 \
<syntaxhighlight lang="bash">echo  -e `modbus_client --debug -mrtu -pnone -s2 /dev/ttyAPP1 \
-a1 -t0x03 -r200 -c 6 | \
-a1 -t0x03 -r200 -c 6 | \
grep Data | sed -e 's/0x00/\\\x/g' -e 's/Data://' -e 's/\s//g'` </syntaxhighlight>
grep Data | sed -e 's/0x00/\\\x/g' -e 's/Data://' -e 's/\s//g'` </syntaxhighlight>
</div>


As a result of the command we receive string  '''WBMS'''. The WB-MS module in the example has Modbus address 1.
As a result of the command we receive string  '''WBMS'''. The WB-MS module in the example has Modbus address 1.