Modbus Mbpoll Program Installation

MBPoll is a fantastic command line utility for reading/writing Modbus RTU/TCP registers, the author has made this available for usage from the GitHub page below, please review the license FAQ to ensure it works for your usage.

GitHub Page For MBPoll

Here's the installation process to compile and install it from source :

# cd /root/
# mkdir modpoll
# cd modpoll/
# wget https://github.com/epsilonrt/mbpoll/archive/master.zip
# unzip master.zip
# cd mbpoll-master
# apt-get install build-essential qt4-qmake


# qmake qmake: could not find a Qt installation of '' # find /usr -name qmake | grep qt4 /usr/lib/arm-linux-gnueabihf/qt4/bin/qmake /usr/share/qt4/bin/qmake # alias qmake="/usr/lib/arm-linux-gnueabihf/qt4/bin/qmake" # qmake # make gcc -c -pipe -Wno-unused-parameter -Wno-unused-function -O2 -Wall -W -D_REENTRANT -D_TTY_POSIX_ -DQT_NO_DEBUG -I/usr/share/qt4/mksp ecs/linux-g++ -I. -I/usr/include/qt4 -I3rdparty -I3rdparty/modbus -I. -o obj/mbpoll.o src/mbpoll.c gcc -c -pipe -Wno-unused-parameter -Wno-unused-function -O2 -Wall -W -D_REENTRANT -D_TTY_POSIX_ -DQT_NO_DEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4 -I3rdparty -I3rdparty/modbus -I. -o obj/modbus.o 3rdparty/modbus/modbus.c gcc -c -pipe -Wno-unused-parameter -Wno-unused-function -O2 -Wall -W -D_REENTRANT -D_TTY_POSIX_ -DQT_NO_DEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4 -I3rdparty -I3rdparty/modbus -I. -o obj/modbus-data.o 3rdparty/modbus/modbus-data.c gcc -c -pipe -Wno-unused-parameter -Wno-unused-function -O2 -Wall -W -D_REENTRANT -D_TTY_POSIX_ -DQT_NO_DEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4 -I3rdparty -I3rdparty/modbus -I. -o obj/modbus-tcp.o 3rdparty/modbus/modbus-tcp.c gcc -c -pipe -Wno-unused-parameter -Wno-unused-function -O2 -Wall -W -D_REENTRANT -D_TTY_POSIX_ -DQT_NO_DEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4 -I3rdparty -I3rdparty/modbus -I. -o obj/modbus-rtu.o 3rdparty/modbus/modbus-rtu.c gcc -c -pipe -Wno-unused-parameter -Wno-unused-function -O2 -Wall -W -D_REENTRANT -D_TTY_POSIX_ -DQT_NO_DEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4 -I3rdparty -I3rdparty/modbus -I. -o obj/delay.o 3rdparty/sysio/delay.c gcc -c -pipe -Wno-unused-parameter -Wno-unused-function -O2 -Wall -W -D_REENTRANT -D_TTY_POSIX_ -DQT_NO_DEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4 -I3rdparty -I3rdparty/modbus -I. -o obj/serial.o 3rdparty/sysio/serial.c g++ -Wl,-O1 -o mbpoll obj/mbpoll.o obj/modbus.o obj/modbus-data.o obj/modbus-tcp.o obj/modbus-rtu.o obj/delay.o obj/serial.o -L/usr/lib/arm-linux-gnueabihf -lpthread # make install install -m 755 -p "mbpoll" "/usr/local/bin/mbpoll" strip "/usr/local/bin/mbpoll" # mbpoll mbpoll: device or host parameter missing ! Try -h for help. # mbpoll -h usage : mbpoll [ options ] device|host [ writevalues... ] [ options ] ModBus Master Simulator. It allows to read and write in ModBus slave registers connected by serial (RTU only) or TCP. Arguments : device Serial port when using ModBus RTU protocol COM1, COM2 ... on Windows /dev/ttyS0, /dev/ttyS1 ... on Linux /dev/ser1, /dev/ser2 ... on QNX host Host name or dotted IP address when using ModBus/TCP protocol writevalues List of values to be written. If none specified (default) mbpoll reads data. If negative numbers are provided, it will precede the list of data to be written by two dashes ('--'). for example : mbpoll -t4:int /dev/ttyUSB0 -- 123 -1568 8974 -12 General options : -m # mode (rtu or tcp, TCP is default) -a # Slave address (1-255 for rtu, 0-255 for tcp, 1 is default) for reading, it is possible to give an address list separated by commas or colons, for example : -a 32,33,34,36:40 read [32,33,34,36,37,38,39,40] -r # Start reference (1 is default) -c # Number of values to read (1-125, 1 is default) -u Read the description of the type, the current status, and other information specific to a remote device (RTU only) -t 0 Discrete output (coil) data type (binary 0 or 1) -t 1 Discrete input data type (binary 0 or 1) -t 3 16-bit input register data type -t 3:hex 16-bit input register data type with hex display -t 3:int 32-bit integer data type in input register table -t 3:float 32-bit float data type in input register table -t 4 16-bit output (holding) register data type (default) -t 4:hex 16-bit output (holding) register data type with hex display -t 4:int 32-bit integer data type in output (holding) register table -t 4:float 32-bit float data type in output (holding) register table -0 First reference is 0 (PDU addressing) instead 1 -1 Poll only once only, otherwise every poll rate interval -l # Poll rate in ms, ( > 100, 1000 is default) -o # Time-out in seconds (0.01 - 10.00, 1.00 s is default) Options for ModBus / TCP : -p # TCP port number (502 is default) Options for ModBus RTU : -b # Baudrate (1200-921600, 19200 is default) -d # Databits (7 or 8, 8 for RTU) -s # Stopbits (1 or 2, 1 is default) -P # Parity (none, even, odd, even is default) -4 RS-485 mode (/RTS on after sending) -5 RS-485 mode (/RTS on when sending) -h Print this help summary page -V Print version and exit -v Verbose mode. Causes mbpoll to print debugging messages about its progress. This is helpful in debugging connection...

Contact us now to discuss your project

Ready to order, contact us today for pricing or samples

Contact Us