All articles
All articles

Top 10 Free Modbus Simulators

Top 10 free Modbus simulators for RTU and TCP testing — slave and master tools with setup steps, command-line examples, and download links.

9 min · 1,975 words

Key takeaways

  • Top 10 free Modbus simulators for RTU and TCP testing — slave and master tools with setup steps, command-line examples, and download links.
  • Focus protocol: MODBUS — see the reference page for frame format, OSI layer, and port/ethertype details.
  • Related topics: Modbus, Troubleshooting, Diagnostic Tools, Modbus Poll.
  • Read time: 9 · 1,975 words · published .

You're building a SCADA master, configuring a PLC, or bringing up an HMI — but the field devices aren't there yet. The meters, VFDs, sensors, and I/O modules are still on order, or they're sitting at a site you can't reach.

A Modbus simulator fills the gap. It runs on your laptop and answers as if it were a real device. Your master connects, reads holding registers, writes coils, and gets replies — the same exchange it would have on site.

This guide lists 10 free Modbus simulators, slave and master, and shows when to reach for each. Every tool below is genuinely free — no 30-day clocks. At the end you'll set up a full Modbus TCP test bench in about five minutes, plus an RTU one with virtual COM ports.

Slave vs master: which one do you need

Get this straight first, because it decides everything else.

A slave simulator (server) stands in for a field device — a meter, a sensor, a drive. It waits for requests and answers with the register values you set. Use it when you're testing your own master, PLC, or HMI.

A master simulator (client) stands in for the PLC or SCADA. It sends the read and write requests. Use it when you're testing a real slave device or your own slave firmware.

Most of the time you want a slave simulator. Your SCADA or PLC is the master, and it needs something to talk to.

Slave simulatorMaster simulator
Stands in forA field deviceA PLC / SCADA master
Listens or connectsListens on port 502 (TCP) or a COM port (RTU)Connects to port 502 or a COM port
You testYour master / PLC / HMIA slave device or slave firmware
You configureRegister values, coil statesPoll rate, addresses, function codes

Quick comparison tables

Slave simulators (server)

ToolLicenseGUITCPRTUOSStands out for
ModRSsim2Free, open sourceYesWindowsMultiple slave IDs, animation, logging
OpenModSimFree, open sourceYesWindows, LinuxError injection, JavaScript scripting
diagslaveFree (freeware)No (CLI)Windows, Linux, Raspberry PiLightweight, scriptable
ModbusSlaveSimulationFree (MIT)YesWindows, Linux, macOSUDP + ASCII-over-RTU, multiple instances
pyModSlaveFree (LGPL)YesWindows, PythonBuilt-in bus monitor

Master simulators (client)

ToolLicenseGUITCPRTUOSStands out for
modpollFree (freeware)No (CLI)Windows, Linux, Raspberry PiScripting, 32-bit/float support
OpenModScanFree, open sourceYesWindows, LinuxModern ModScan replacement
QModMasterFree, open sourceYesWindows, LinuxBuilt-in bus monitor
pymodbusFree (BSD)No (Python)Any (Python)Custom sims, CI/CD
Node-REDFree (Apache 2.0)Yes (web)Any (Node.js)Visual flows, ties into MQTT/HTTP

Slave simulators

1. ModRSsim2 — the classic

The most widely used free slave simulator, and still a safe default. It handles TCP and RTU, multiple slave addresses at once, live register animation, and a traffic log that decodes frames as they arrive.

FieldDetail
LicenseFree, open source
ProtocolsModbus TCP, RTU, ASCII
Slave addressesMultiple (1–247) at once
Register typesCoils, discrete inputs, input registers, holding registers
OSWindows
Downloadsourceforge.net/projects/modrssim2

Run the exe, pick TCP or RTU, set the slave address, enter some register values, and click Start. Your master can connect on port 502.

2. OpenModSim — modern and scriptable

A newer, actively maintained slave simulator with a clean interface. Its real edge is error injection: you can force specific exception codes to see how your master reacts.

FieldDetail
LicenseFree (GPL, open source)
ProtocolsModbus TCP, RTU
Data simulationRandom, increment, decrement, with limits and step
Error injectionReturn exception codes (Illegal Function, Illegal Data Address, and so on)
ScriptingECMAScript / JavaScript
OSWindows 7+, Linux
Downloadgithub.com/sanny32/OpenModSim

Reach for it when you need to prove your master handles errors, not just clean replies.

3. diagslave — command line, no install

A tiny command-line slave. No GUI, nothing to install — download and run. Perfect for scripts, headless Linux boxes, and a Raspberry Pi on the bench.

FieldDetail
LicenseFree (freeware)
ProtocolsModbus TCP, RTU, ASCII, UDP, RTU over TCP
OSWindows, Linux (x86, ARM), Raspberry Pi, QNX
Downloadmodbusdriver.com/diagslave.html

Start a TCP slave on port 502, address 1:

bash

diagslave -m tcp -a 1 -p 502

Start an RTU slave on COM7, 19200 baud, even parity:

bash

diagslave -m rtu -a 1 -b 19200 -p even COM7

4. ModbusSlaveSimulation — the wide-transport option

A standalone app that covers more transports than most, including UDP and ASCII over RTU. You can set register values before the master connects, and run several instances at once.

FieldDetail
LicenseFree (MIT, open source)
ProtocolsModbus TCP, RTU, UDP, ASCII over RTU
Multiple instancesYes — different ports or addresses
OSWindows, Linux (Mono), macOS (Mono)
Downloadgithub.com/GitHubDragonFly/ModbusSlaveSimulation

Use it when your master speaks one of the less common variants and you need to match it exactly.

5. pyModSlave — GUI slave with a bus monitor

A free Qt-based slave from the developer of QModMaster. It builds all four data blocks (coils, discrete inputs, input registers, holding registers) with random values you can edit, and it ships with a bus monitor so you can watch every frame.

FieldDetail
LicenseFree (LGPL, open source)
ProtocolsModbus TCP, RTU
ExtrasBuilt-in bus monitor, per-register editing
OSWindows (prebuilt exe), or run the Python module anywhere
Downloadpypi.org/project/pyModSlave

A good pick when you want a GUI slave and QModMaster on the master side — same look, same author.

Master simulators

6. modpoll — command-line master

The master-side companion to diagslave, and a de-facto standard for quick checks and scripts. One line reads or writes any register set.

FieldDetail
LicenseFree (freeware)
ProtocolsModbus TCP, RTU, ASCII, UDP, RTU over TCP
Data types16-bit, 32-bit int, float, hex
OSWindows, Linux, Raspberry Pi
Downloadmodbusdriver.com/modpoll.html

Read 10 holding registers from register 500 on a TCP slave:

bash

modpoll -m tcp -r 500 -c 10 192.168.1.100

Read five floats from register 100:

bash

modpoll -m tcp -t 4:float -r 100 -c 5 192.168.1.100

Write 1234 to register 100:

bash

modpoll -m tcp -r 100 192.168.1.100 1234

7. OpenModScan — modern ModScan replacement

A clean, open-source master that rebuilds the old ModScan for today. Poll holding registers and coils, write values, and scan a range of slave addresses to find what's live.

FieldDetail
LicenseFree, open source
ProtocolsModbus TCP, RTU
RoleRead/write registers and coils, address scan
OSWindows, Linux
Downloadgithub.com/sanny32/OpenModScan

Pairs naturally with OpenModSim if you want the same author on both ends.

8. QModMaster — GUI master with a monitor

A free Qt master built on libmodbus. Simple to drive, and its built-in bus monitor lets you poll a device and watch the raw traffic in one window.

FieldDetail
LicenseFree (LGPL, open source)
ProtocolsModbus TCP, RTU
ExtrasBuilt-in bus monitor
OSWindows, Linux
Downloadsourceforge.net/projects/qmodmaster

9. pymodbus — build your own

A Python library, not an app. When you need behavior no GUI gives you — dynamic values, timing games, a slave that misbehaves on purpose — you write it in a few lines.

FieldDetail
LicenseFree (BSD, open source)
ProtocolsModbus TCP, RTU, ASCII, TLS
LanguagePython 3
Installpip install pymodbus
Downloadgithub.com/pymodbus-dev/pymodbus

A TCP slave with 100 holding registers:

python

from pymodbus.server import StartTcpServer
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext
from pymodbus.datastore import ModbusSequentialDataBlock
 
store = ModbusSlaveContext(
    hr=ModbusSequentialDataBlock(0, [0]*100),  # holding registers
    ir=ModbusSequentialDataBlock(0, [0]*100),  # input registers
)
context = ModbusServerContext(slaves=store, single=True)
StartTcpServer(context=context, address=("0.0.0.0", 502))

Best for automated testing, CI/CD, and custom device emulation.

10. Node-RED with Modbus nodes

A visual flow tool that speaks Modbus through a community node. You wire master or slave logic with drag-and-drop blocks, which makes it handy for prototyping and for bridging Modbus to MQTT, HTTP, or a database.

FieldDetail
LicenseFree (Apache 2.0)
Modbus nodesnode-red-contrib-modbus
Installnpm install node-red-contrib-modbus
OSAny (Node.js)
Downloadnodered.org

Two commercial tools come up constantly, so it's worth naming them. Modbus Poll and Modbus Slave by ModbusTools are the industry-standard paid pair — up to 100 slave windows, OLE automation for Excel and Python, and polished GUIs. Both run on a 30-day trial, then about $129 each. If you're doing heavy, day-in day-out integration work, they're worth the money. For everything else, the ten free tools above cover it.

Set up a Modbus TCP test bench in 5 minutes

You need: one computer, a slave simulator (ModRSsim2 or diagslave), and a master (your SCADA, a PLC simulator, or modpoll).

1. Start the slave.

With ModRSsim2: run it, pick MODBUS TCP/IP, set Station ID = 1, and it listens on port 502. Set a couple of holding registers (say register 0 = 2301, register 1 = 1456).

Or with diagslave:

bash

diagslave -m tcp -a 1 -p 502

2. Connect the master.

With modpoll:

bash

modpoll -m tcp -a 1 -r 1 -c 10 127.0.0.1

That reads 10 holding registers from register 1 on the local slave. With your SCADA, point a Modbus TCP connection at 127.0.0.1, port 502, Unit ID 1.

3. Check it.

Your master should show the values you set. Change a value in the slave and your master picks it up on the next poll.

Set up a Modbus RTU test bench

For RTU you have no physical RS-485 line, so you make a pair of virtual COM ports.

1. Install virtual COM port software. On Windows, com0com creates linked pairs (COM3 ↔ COM4). On Linux, socat does the same:

bash

socat -d -d pty,raw,echo=0 pty,raw,echo=0
# gives you /dev/pts/3 and /dev/pts/4 — use these as your ports

2. Start the slave on one port.

bash

diagslave -m rtu -a 1 -b 9600 -p even COM3

3. Connect the master on the other.

bash

modpoll -m rtu -a 1 -b 9600 -p even -r 1 -c 10 COM4

Test scenarios worth running

Don't just prove the happy path. The faults are where real testing pays off.

TestWhat it provesHow
Basic readMaster reads registers rightRead 10, check they match the slave
Basic writeMaster writes a registerWrite a value, confirm it in the slave
Wrong slave addressMaster handles no replyMaster on address 5, slave on 1
Bad register addressSlave returns exception 02Ask for a register that doesn't exist
Bad function codeSlave returns exception 01Send FC 04 to a slave that only does FC 03
Multiple slavesMaster polls several IDsRun several slave instances
TimeoutMaster handles silenceStop the slave mid-test
Large blockMax register countRead 125 registers in one request
Float decode32-bit float handlingSet two registers to a known float
CRC error (RTU)Master shrugs off bad framesDisconnect/reconnect the serial link mid-transfer

Common problems and fixes

ProblemCauseFix
Connection refused on 502Slave not running, or wrong portStart the slave first; confirm port 502
"Port 502 already in use"Another app holds the portClose it, or use another port (e.g. 1502)
No responseWrong slave addressMatch Unit IDs on both sides
All registers read 0Values never setEnter register values before connecting
Exception code 02Address out of rangeCheck the register range in the slave
Float shows garbageWrong byte orderSwap byte order (AB CD vs CD AB) in the master
RTU won't talkBaud or parity mismatchMake both sides use identical serial settings
Firewall blocks 502Windows FirewallAllow the simulator through

Stuck on a frame that won't decode? Drop it into the free Modbus Frame Decoder to break out the MBAP header, function code, addresses, and CRC.

Which one should you pick

Your situationReach for
Quick GUI slave on WindowsModRSsim2
Cross-platform GUI slaveOpenModSim
Testing how your master handles errorsOpenModSim (inject exception codes)
Command-line, scriptable, or headlessdiagslave (slave) + modpoll (master)
Odd transports (UDP, ASCII over RTU)ModbusSlaveSimulation
GUI slave with a bus monitorpyModSlave
Simple GUI masterOpenModScan or QModMaster
Custom behavior or CI/CDpymodbus
Wiring Modbus to MQTT/HTTPNode-RED
RTU with no hardwarecom0com (Windows) or socat (Linux) for virtual ports

Related articles