12 063
правки
(Новая страница: «Parameter values (address, timeout, function type, etc.) can be specified in both hexadecimal (0x**) and decimal.») |
(Новая страница: «* The first argument '''--debug''' — is arbitrary. It can be specified in any position and enables debugging by displaying the hexadecimal codes of the data bei…») |
||
Строка 38: | Строка 38: | ||
Parameter values (address, timeout, function type, etc.) can be specified in both hexadecimal (0x**) and decimal. | Parameter values (address, timeout, function type, etc.) can be specified in both hexadecimal (0x**) and decimal. | ||
* | * The first argument '''--debug''' — is arbitrary. It can be specified in any position and enables debugging by displaying the hexadecimal codes of the data being sent and received. | ||
* | * The next argument is '''-m'''. It must be specified first on the command line, or second if the first argument is '''--debug''' or the file name of the RS-485 port. The argument specifies the type of Protocol used '''-mrtu''' — Modbus RTU, '''-mtcp''' — Modbus TCP. | ||
* | * The '''-a''' argument specifies the Modbus address of the device we are accessing. If the argument is not used, the default address is 0x01. | ||
* | * The '''-c''' argument determines how many items we request. The default value is one. | ||
* | * The '''-r''' argument specifies the start address for reading or writing. The default value is 100 (0x64). | ||
* | * The-t argument specifies the Modbus function code. They are briefly listed in the modbus_client output, the code values are described in more detail on the [[Special:MyLanguage/Протокол Modbus/en|Modbus Protocol]] page. | ||
* | * The '''-o''' argument specifies a timeout in milliseconds (the default is 1000). | ||
* | * The '''-0''' (zero) argument reduces the address specified by the '''-r''' argument by one. This can be useful when working with devices with non-standard addressing, for example, with the address range 1 — 65536 instead of the usual 0 — 65535. | ||
Затем указываются специфические параметры протокола (Modbus RTU или Modbus TCP). Несмотря на информацию, выводимую в подсказке, эти параметры также начинаются со знака '-' (минус). | Затем указываются специфические параметры протокола (Modbus RTU или Modbus TCP). Несмотря на информацию, выводимую в подсказке, эти параметры также начинаются со знака '-' (минус). |
правки