From 1ba1c72dc9a9dd09c0f2c4ae3540204ca0d199a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 5 Mar 2024 09:51:46 +0100 Subject: [PATCH] Update nymea-modbus-cli documentation --- nymea-modbus-cli/README.md | 100 +++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 27 deletions(-) diff --git a/nymea-modbus-cli/README.md b/nymea-modbus-cli/README.md index ae1dea3..a5c1d9a 100644 --- a/nymea-modbus-cli/README.md +++ b/nymea-modbus-cli/README.md @@ -1,33 +1,79 @@ # nymea-modbus-cli -The nymea-modbus-cli tools is a command line tool for tsting modbus TCP communication in the local network. +The nymea-modbus-cli tools is a command line tool for testing modbus TCP/RTU communication. -As of now, the tool allows to establish a modbus TCP connection to a server and read any type of register from the server. +The tool allows to read or write registers in a generic way. Following options are available: - Usage: nymea-modbus-cli [options] - - Tool for testing and reading Modbus TCP registers. - - Copyright © 2016 - 2022 nymea GmbH - - - Options: - -h, --help Displays this help. - -v, --version Displays version information. - -a, --address
The IP address of the modbus - TCP server. - -p, --port The port of the modbus TCP - server. Default is 502. - -m, --modbus-address The modbus server address on - the bus (slave ID). Default is - 1. - -t, --type The type of the modbus - register. Default is holding. - -r, --register The number of the modbus - register. - -l, --length The number of registers to - read. Default is 1. - -d, --debug Print more information. - \ No newline at end of file +``` +Usage: nymea-modbus-cli [options] + +Tool for testing and reading Modbus TCP or RTU registers. + +Copyright © 2016 - 2023 nymea GmbH + +TCP +----------------------------------------- +Example reading 2 holding registers from address 1000: +nymea-modbus-cli -a 192.168.0.10 -p 502 -r 1000 -l 2 + +RTU +----------------------------------------- + +Typical baudrates: +- 1200 +- 2400 +- 4800 +- 9600 +- 19200 +- 38400 +- 57600 +- 115200 + +Example reading 2 holding registers from address 1000: +nymea-modbus-cli --serial /dev/ttyUSB0 --baudrate 9600 -r 1000 -l 2 + + + +Options: + -h, --help Displays help on commandline + options. + --help-all Displays help including Qt + specific options. + -v, --version Displays version information. + -a, --address
TCP: The IP address of the + modbus TCP server. + -p, --port TCP: The port of the modbus TCP + server. Default is 502. + --serial RTU: The serial port to use for + the RTU communication. + --baudrate RTU: The baudrate for the RTU + communication. Default is 19200. + --parity RTU: The parity for the RTU + communication. Allowed values + are [none, even, odd, space, + mark]. Default is none. + --databits RTU: The amount of data bits + for the RTU communication. + Allowed values are [5, 6, 7, 8]. + Default is 8. + --stopbits RTU: The amount of stop bits + for the RTU communication. + Allowed values are [1, 1.5, 2]. + Default is 1. + --list-serials List the available serial ports + on this host. + -m, --modbus-address The modbus server address on + the bus (slave ID). Default is + 1. + -t, --type The type of the modbus + register. Default is holding. + -r, --register The number of the modbus + register. + -l, --length The number of registers to + read. Default is 1. + -w, --write The data to be written to the + given register. + -d, --debug Print more information. +```