MBPOLL(1)
π MBPOLL(1) β the ModBus(R) Master Simulator, bestie edition β¨
okay so like. hi. you're looking at the manual page for mbpoll, section 1 of the user commands, and honestly? she's iconic. she's a command line utility that talks to ModBus slave devices, both RTU and TCP, and she does it flawlessly. let's get into it π«Ά
πΈ NAME πΈ
mbpoll β ModBus(R) Master Simulator. that's it, that's the whole vibe.
β¨ SYNOPSIS β¨
mbpoll [ options ] device|host [ writevalues... ] [ options ]
yes the options can come before AND after, she's flexible like that π
π DESCRIPTION π
mbpoll is a command line utility to communicate with ModBus slave devices (RTU or TCP). she lets you read and write in ModBus slave registers connected by serial (RTU only) or TCP. no GUI, no drama, just registers.
so what can mbpoll actually do? so much, bestie:
- read discrete inputs
- read and write binary outputs (coil)
- read input registers
- read and write output registers (holding register)
the reading and writing of registers may be in decimal, hexadecimal or floating single precision. three aesthetics, one tool β¨
now, the lore: mbpoll's output syntax and command line option syntax is similar to the original modpoll command line program published by proconX. however β and this is important, no cap β mbpoll is a completely independent project and based on different source code than the original modpoll program. mbpoll is distributed under the GPL license, but the original modpoll program is not covered by the GPL license. different girlies, different source code, we don't mix them up π
π ARGUMENTS π
- device β Serial port when using ModBus RTU protocol. which one though? depends on your whole situation:
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),
mbpollreads data. If negative numbers are provided, precede the list of data to be written by two dashes (--). this is the classic "wait why is it parsing my negative number as a flag" moment, and the fix is right there. for example:
mbpoll -t4:int /dev/ttyUSB0 -- 123 -1568 8974 -12
π GENERAL OPTIONS π
-mmode β Communication mode:rtuortcp. Default istcp.-aaddress β Slave address. Range: 1-255 for RTU, 0-255 for TCP. Default is 1. For reading, it is possible to give an address list separated by commas or colons. For example:
-a 32,33,34,36:40 reads slaves [32,33,34,36,37,38,39,40].
-rreference β Start reference. Default is 1. For reading, it is possible to give a reference list separated by commas or colons.-ccount β Number of values to read (1-125). Default is 1.-uβ Read the description of the type, the current status, and other information specific to a remote device (Report Slave ID). RTU only.-ttype β Data type. the following types are supported, and yes she brought the whole menu:0β Discrete output (coil) data type (binary 0 or 1).1β Discrete input data type (binary 0 or 1).3β 16-bit input register data type.3:int16β 16-bit input register with signed integer display.3:hexβ 16-bit input register with hexadecimal display.3:stringβ 16-bit input register with string (char) display.3:intβ 32-bit integer data type in input register table.3:floatβ 32-bit float data type in input register table.4β 16-bit output (holding) register data type (default).4:int16β 16-bit output (holding) register with signed integer display.4:hexβ 16-bit output (holding) register with hexadecimal display.4:stringβ 16-bit output (holding) register with string (char) display.4:intβ 32-bit integer data type in output (holding) register table.4:floatβ 32-bit float data type in output (holding) register table.
-0β First reference is 0 (PDU addressing) instead of 1.-Wβ Use function code0x10(Write Multiple Registers) for writing a single register, instead of0x06(Write Single Register).-Bβ Big endian word order for 32-bit integer and float.-1β Poll only once, otherwise poll at every poll rate interval.-lrate β Poll rate in milliseconds. Must be greater than 100. Default is 1000.-otimeout β Response time-out in seconds (0.01 - 10.00). Default is 1.00 s.-qβ Quiet mode. Minimum output only.-xβ Print addresses (references) in hexadecimal format.-Qβ Enable MAX_SLAVE quirk (accept slave id 0-255).-Xβ Enable REPLY_TO_BROADCAST quirk (send reply to broadcast).
π MODBUS/TCP OPTIONS π
-pport β TCP port number. Default is 502.
π MODBUS RTU OPTIONS π
-bbaudrate β Baud rate (1200-921600). Default is 19200.-ddatabits β Data bits: 7 or 8. Default is 8 for RTU.-sstopbits β Stop bits: 1 or 2. Default is 1.-Pparity β Parity:none,even, orodd. Default iseven.-R[pin] β RS-485 mode./RTSis on (active low) after sending. An optional parameter specifies the GPIO pin number for RTS (only available when compiled with GPIO RTS support).-F[pin] β RS-485 mode./RTSis on (active low) when sending. An optional parameter specifies the GPIO pin number for RTS (only available when compiled with GPIO RTS support).
β OTHER OPTIONS β
-hβ Print help summary and exit.-Vβ Print version and exit.-vβ Verbose mode. Causesmbpollto print debugging messages about its progress. this is the helpful one for debugging connection problems, she's your emotional support flag π₯Ή-wβ Print warranty information and exit.
π₯ EXAMPLES π₯
Read input registers 1 and 2 from slave 33 via RTU on /dev/ttyUSB2 at 38400 baud:
mbpoll -a 33 -b 38400 -t 3 -r 1 -c 2 /dev/ttyUSB2
Read holding registers 100 to 109 from slave 1 via TCP on host 192.168.1.10:
mbpoll -t 4 -r 100 -c 10 192.168.1.10
Write value 1234 to holding register 100 of slave 1 via TCP:
mbpoll -t 4 -r 100 192.168.1.10 1234
Write 32-bit integer values (including negative) to holding registers via RTU:
mbpoll -t 4:int /dev/ttyUSB0 -- 123 -1568 8974 -12
Read coils 1 to 8 from slave 5, poll only once:
mbpoll -a 5 -t 0 -r 1 -c 8 -1 /dev/ttyUSB0
Read multiple slaves at once:
mbpoll -a 1,2,3 -t 4 -r 1 -c 5 /dev/ttyUSB0
Read a range of non-contiguous registers:
mbpoll -r 1,5,10:15 -t 4 192.168.1.10
Report slave ID of device at address 1:
mbpoll -a 1 -u -m rtu /dev/ttyUSB0
π EXIT STATUS π
0β Success. All frames were received without errors. slay, everything came back clean β¨1β Failure. One or more communication errors occurred. not slay, something fumbled the bag π
π§ DEPENDENCIES π§
mbpoll requires libmodbus(3) version 3.1.7 or later. no old libs, she has standards.
π BUGS π
Report bugs at https://github.com/epsilonrt/mbpoll/issues. please do, she wants to hear it π«Ά
π AUTHOR π
Pascal JEAN https://github.com/epsilonrt/mbpoll β the legend herself.
πΈ COPYRIGHT πΈ
Copyright Β© 2015-2026 Pascal JEAN.
License GPLv3+: GNU GPL version 3 or later https://www.gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
π¦ SEE ALSO π¦
modbus_new_rtu(3), modbus_new_tcp_pi(3), libmodbus(7) β go read these next, they're the friend group π
okay bestie that's the whole page, go forth and poll some registers, and remember: this was mbpoll, February 2026, from the MBPOLL(1) manual β ily, now go write some coils ππβ¨
π¦ where this page comes from
- epel 10: mbpoll 1.5.4-1.el10_2 Β· GPL-3.0-or-later
- fedora 43: mbpoll 1.5.4-1.fc43 Β· GPL-3.0-or-later
- fedora 44: mbpoll 1.5.4-1.fc44 Β· GPL-3.0-or-later
- Copyright (c) 2015-2026 Pascal JEAN, All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms