12 063
правки
(Новая страница: «We can set the device address we need (for example, 1) with the command <syntaxhighlight lang="bash">root@wirenboard:~# modbus_client --debug -mrtu -pnone -s2 /de…») |
(Новая страница: «'''Using address 0 will reset all addresses to all devices on the bus! Never use this command if more than one device is connected to the RS-485 port!'''») |
||
Строка 22: | Строка 22: | ||
We use the broadcast address 0 ( -a0) and Modbus RTU command WRITE_SINGLE_REGISTER with code 6 ( -t0x06) to write the address. In register 0x80 ( -r0x80) we write the value 1. | We use the broadcast address 0 ( -a0) and Modbus RTU command WRITE_SINGLE_REGISTER with code 6 ( -t0x06) to write the address. In register 0x80 ( -r0x80) we write the value 1. | ||
''' | '''Using address 0 will reset all addresses to all devices on the bus! Never use this command if more than one device is connected to the RS-485 port!''' | ||
<syntaxhighlight lang="bash">root@wirenboard:~# modbus_client --debug -mrtu -pnone -s2 /dev/ttyAPP1 -a0 -t0x06 -r0x80 1 | <syntaxhighlight lang="bash">root@wirenboard:~# modbus_client --debug -mrtu -pnone -s2 /dev/ttyAPP1 -a0 -t0x06 -r0x80 1 |
правки