A Modbus client writen in JavaScript
Utility script for accessing Modbus devices. Many hobby devices and PLC controllers speak Modbus.
To install, run npm install
if you install from source code, or npm install modbus-cli
.
The -h
flag will print out a help text, that list the command line arguments.
modbus-cli -h
Usage: modbus-cli <command> [options]
Commands:
read Read holding registers
readi Read input registers
force force single coil
Options:
--config Path to JSON config file
-h, --help Show help [boolean]
Examples:
modbus-cli read -u 192.168.1.11 -a 5
Read Holding registers.
modbus-cli read -u 192.168.1.11 -a 5
modbus-cli read -u /dev/ttyUSB0 -a 0 -l 4
Read Holding registers.
modbus-cli readi -u 192.168.1.11 -a 5
modbus-cli readi -u /dev/ttyUSB0 -a 0 -l 4
Force one Coil.
modbus-cli force -u 192.168.1.11 -a 5 -v 0
modbus-cli force -u /dev/ttyUSB0 -a 0 -v 1