Skip to main content
Loading...
Free Command Line Windows / Linux

modpoll - Command-Line Modbus Master

Lightweight command-line Modbus master simulator supporting RTU, TCP and UDP protocols. All standard function codes. Ideal for automation scripts, batch testing and CI/CD integration.

Version

3.16

File Size

206 KB (ZIP)

Platform

Windows / Linux

Type

CLI (Command Line)

Overview

modpoll is a lightweight command-line Modbus master tool that supports all three Modbus transport protocols: RTU (serial), TCP (Ethernet) and UDP. Its small footprint (under 200KB) and command-line interface make it the ideal choice for automated testing, batch processing, and integration into scripts and CI/CD pipelines.

Unlike GUI-based tools, modpoll can be called from batch files, shell scripts, Python programs, or any automation framework. The tool returns meaningful exit codes, making it easy to build reliable automated test sequences.

Key Features

⚙ RTU / TCP / UDP

Full support for all three Modbus transport protocols. Switch between serial RTU and Ethernet TCP/UDP with a single command flag.

📦 Ultra Lightweight

Under 200KB executable. No installation, no dependencies, no runtime. Just extract and run on any Windows or Linux system.

💻 Scriptable

Designed for automation. Call from batch files, shell scripts, Python, or any language. Exit codes indicate success or failure.

🔎 All Function Codes

Supports FC01-06 and FC15-16 for reading/writing coils, discrete inputs, holding registers and input registers.

Command Reference

Basic Syntax

# General syntax modpoll [options] <communication-port> # Modbus RTU example modpoll -m rtu -b 9600 -p none -a 1 -r 100 -c 10 COM1 # Modbus TCP example modpoll -m tcp -a 1 -r 100 -c 10 192.168.1.100 # Modbus UDP example modpoll -m udp -a 1 -r 100 -c 10 192.168.1.100

Common Options

modpoll Command-Line Options

FlagDescriptionExample
-mProtocol mode: rtu, tcp, udp-m rtu
-aSlave address (1-247)-a 1
-rStart register address-r 100
-cNumber of registers to read-c 10
-bBaud rate (RTU only)-b 9600
-pParity: none, even, odd (RTU)-p even
-tData type: 3=holding, 4=input, 1=coil, 2=discrete-t 3
-1Single poll mode (exit after one read)-1

Automation Examples

Batch File (Windows)

@echo off REM Read 10 holding registers from slave 1 via TCP modpoll -m tcp -a 1 -t 3 -r 0 -c 10 -1 192.168.1.100 if %ERRORLEVEL% EQU 0 ( echo Communication OK ) else ( echo Communication FAILED )

Shell Script (Linux)

#!/bin/bash # Poll Modbus RTU device every 5 seconds while true; do modpoll -m rtu -b 9600 -p even -a 1 -t 3 -r 0 -c 5 -1 /dev/ttyUSB0 sleep 5 done

Compatible with ModulesLink Products

Use modpoll in your commissioning scripts to verify ModulesLink Modbus gateways are responding correctly. Combine with diagslave to create automated test loops that validate both master and slave communication paths.

Frequently Asked Questions

What is modpoll used for?
modpoll is a command-line Modbus master tool used for automated Modbus testing, batch register reading/writing, and integration into scripts and batch files for industrial device commissioning and monitoring. It is ideal for CI/CD pipelines and automated test systems.
How to use modpoll for Modbus RTU?
Run modpoll with the -m rtu flag, specify the COM port with -b for baud rate, set the slave address with -a, and define the register range. Example: modpoll -m rtu -b 9600 -p none -a 1 -r 100 -c 10 COM1
Can modpoll be used in automation scripts?
Yes, modpoll is designed for automation. It can be called from batch files, shell scripts, Python, or any scripting language. The exit code indicates success or failure, making it ideal for automated testing pipelines. Use the -1 flag for single-poll mode.