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
- Quick comparison tables
- Slave simulators
- Master simulators
- Paid options worth knowing
- Set up a Modbus TCP test bench in 5 minutes
- Set up a Modbus RTU test bench
- Test scenarios worth running
- Common problems and fixes
- Which one should you pick
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 simulator | Master simulator | |
|---|---|---|
| Stands in for | A field device | A PLC / SCADA master |
| Listens or connects | Listens on port 502 (TCP) or a COM port (RTU) | Connects to port 502 or a COM port |
| You test | Your master / PLC / HMI | A slave device or slave firmware |
| You configure | Register values, coil states | Poll rate, addresses, function codes |
Quick comparison tables
Slave simulators (server)
| Tool | License | GUI | TCP | RTU | OS | Stands out for |
|---|---|---|---|---|---|---|
| ModRSsim2 | Free, open source | Yes | ✓ | ✓ | Windows | Multiple slave IDs, animation, logging |
| OpenModSim | Free, open source | Yes | ✓ | ✓ | Windows, Linux | Error injection, JavaScript scripting |
| diagslave | Free (freeware) | No (CLI) | ✓ | ✓ | Windows, Linux, Raspberry Pi | Lightweight, scriptable |
| ModbusSlaveSimulation | Free (MIT) | Yes | ✓ | ✓ | Windows, Linux, macOS | UDP + ASCII-over-RTU, multiple instances |
| pyModSlave | Free (LGPL) | Yes | ✓ | ✓ | Windows, Python | Built-in bus monitor |
Master simulators (client)
| Tool | License | GUI | TCP | RTU | OS | Stands out for |
|---|---|---|---|---|---|---|
| modpoll | Free (freeware) | No (CLI) | ✓ | ✓ | Windows, Linux, Raspberry Pi | Scripting, 32-bit/float support |
| OpenModScan | Free, open source | Yes | ✓ | ✓ | Windows, Linux | Modern ModScan replacement |
| QModMaster | Free, open source | Yes | ✓ | ✓ | Windows, Linux | Built-in bus monitor |
| pymodbus | Free (BSD) | No (Python) | ✓ | ✓ | Any (Python) | Custom sims, CI/CD |
| Node-RED | Free (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.
| Field | Detail |
|---|---|
| License | Free, open source |
| Protocols | Modbus TCP, RTU, ASCII |
| Slave addresses | Multiple (1–247) at once |
| Register types | Coils, discrete inputs, input registers, holding registers |
| OS | Windows |
| Download | sourceforge.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.
| Field | Detail |
|---|---|
| License | Free (GPL, open source) |
| Protocols | Modbus TCP, RTU |
| Data simulation | Random, increment, decrement, with limits and step |
| Error injection | Return exception codes (Illegal Function, Illegal Data Address, and so on) |
| Scripting | ECMAScript / JavaScript |
| OS | Windows 7+, Linux |
| Download | github.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.
| Field | Detail |
|---|---|
| License | Free (freeware) |
| Protocols | Modbus TCP, RTU, ASCII, UDP, RTU over TCP |
| OS | Windows, Linux (x86, ARM), Raspberry Pi, QNX |
| Download | modbusdriver.com/diagslave.html |
Start a TCP slave on port 502, address 1:
bash
diagslave -m tcp -a 1 -p 502Start an RTU slave on COM7, 19200 baud, even parity:
bash
diagslave -m rtu -a 1 -b 19200 -p even COM74. 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.
| Field | Detail |
|---|---|
| License | Free (MIT, open source) |
| Protocols | Modbus TCP, RTU, UDP, ASCII over RTU |
| Multiple instances | Yes — different ports or addresses |
| OS | Windows, Linux (Mono), macOS (Mono) |
| Download | github.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.
| Field | Detail |
|---|---|
| License | Free (LGPL, open source) |
| Protocols | Modbus TCP, RTU |
| Extras | Built-in bus monitor, per-register editing |
| OS | Windows (prebuilt exe), or run the Python module anywhere |
| Download | pypi.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.
| Field | Detail |
|---|---|
| License | Free (freeware) |
| Protocols | Modbus TCP, RTU, ASCII, UDP, RTU over TCP |
| Data types | 16-bit, 32-bit int, float, hex |
| OS | Windows, Linux, Raspberry Pi |
| Download | modbusdriver.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.100Read five floats from register 100:
bash
modpoll -m tcp -t 4:float -r 100 -c 5 192.168.1.100Write 1234 to register 100:
bash
modpoll -m tcp -r 100 192.168.1.100 12347. 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.
| Field | Detail |
|---|---|
| License | Free, open source |
| Protocols | Modbus TCP, RTU |
| Role | Read/write registers and coils, address scan |
| OS | Windows, Linux |
| Download | github.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.
| Field | Detail |
|---|---|
| License | Free (LGPL, open source) |
| Protocols | Modbus TCP, RTU |
| Extras | Built-in bus monitor |
| OS | Windows, Linux |
| Download | sourceforge.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.
| Field | Detail |
|---|---|
| License | Free (BSD, open source) |
| Protocols | Modbus TCP, RTU, ASCII, TLS |
| Language | Python 3 |
| Install | pip install pymodbus |
| Download | github.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.
| Field | Detail |
|---|---|
| License | Free (Apache 2.0) |
| Modbus nodes | node-red-contrib-modbus |
| Install | npm install node-red-contrib-modbus |
| OS | Any (Node.js) |
| Download | nodered.org |
Paid options worth knowing
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 5022. Connect the master.
With modpoll:
bash
modpoll -m tcp -a 1 -r 1 -c 10 127.0.0.1That 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 ports2. Start the slave on one port.
bash
diagslave -m rtu -a 1 -b 9600 -p even COM33. Connect the master on the other.
bash
modpoll -m rtu -a 1 -b 9600 -p even -r 1 -c 10 COM4Test scenarios worth running
Don't just prove the happy path. The faults are where real testing pays off.
| Test | What it proves | How |
|---|---|---|
| Basic read | Master reads registers right | Read 10, check they match the slave |
| Basic write | Master writes a register | Write a value, confirm it in the slave |
| Wrong slave address | Master handles no reply | Master on address 5, slave on 1 |
| Bad register address | Slave returns exception 02 | Ask for a register that doesn't exist |
| Bad function code | Slave returns exception 01 | Send FC 04 to a slave that only does FC 03 |
| Multiple slaves | Master polls several IDs | Run several slave instances |
| Timeout | Master handles silence | Stop the slave mid-test |
| Large block | Max register count | Read 125 registers in one request |
| Float decode | 32-bit float handling | Set two registers to a known float |
| CRC error (RTU) | Master shrugs off bad frames | Disconnect/reconnect the serial link mid-transfer |
Common problems and fixes
| Problem | Cause | Fix |
|---|---|---|
| Connection refused on 502 | Slave not running, or wrong port | Start the slave first; confirm port 502 |
| "Port 502 already in use" | Another app holds the port | Close it, or use another port (e.g. 1502) |
| No response | Wrong slave address | Match Unit IDs on both sides |
| All registers read 0 | Values never set | Enter register values before connecting |
| Exception code 02 | Address out of range | Check the register range in the slave |
| Float shows garbage | Wrong byte order | Swap byte order (AB CD vs CD AB) in the master |
| RTU won't talk | Baud or parity mismatch | Make both sides use identical serial settings |
| Firewall blocks 502 | Windows Firewall | Allow 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 situation | Reach for |
|---|---|
| Quick GUI slave on Windows | ModRSsim2 |
| Cross-platform GUI slave | OpenModSim |
| Testing how your master handles errors | OpenModSim (inject exception codes) |
| Command-line, scriptable, or headless | diagslave (slave) + modpoll (master) |
| Odd transports (UDP, ASCII over RTU) | ModbusSlaveSimulation |
| GUI slave with a bus monitor | pyModSlave |
| Simple GUI master | OpenModScan or QModMaster |
| Custom behavior or CI/CD | pymodbus |
| Wiring Modbus to MQTT/HTTP | Node-RED |
| RTU with no hardware | com0com (Windows) or socat (Linux) for virtual ports |