Documentation
Modbus Simulator
A free tool for exercising Modbus TCP and RTU without real hardware — as a simulated device (slave) or as a polling client (master).
Install
- Download
OpenBench-ModbusSimulator-<version>-win-x64.exefrom the latest release. - It is a single self-contained executable — no installer, no .NET runtime needed. Put it wherever you like.
- On first run, Windows SmartScreen may warn about an unrecognised publisher (the build is not code-signed yet). ChooseMore info → Run anyway, or verify the checksum first:
sha256sum -c SHA256SUMS.txt
Requirements: Windows 10 or 11 (x64). A physical or virtual COM port is only needed for RTU mode.
Quick start — TCP slave
Use this to stand in for a device your SCADA system, PLC program, or integration test expects to connect to.
- Set Role to Slave and Transport to Tcp.
- Set Port (default
502; use a port above 1024 if 502 needs admin rights) and Unit / slave ID. - Click Start. The log shows
Listening on 0.0.0.0:502. - In the register table, pick a table (e.g. HoldingRegisters), set a start address and count, and type values into the Value column.
- Point your Modbus client at
<this machine's IP>:502. Reads return your values; writes update the table and appear in the log.
Quick start — TCP master
Use this to poll a real device (or another simulator) and watch its registers.
- Set Role to Master, Transport to Tcp.
- Enter the device Host and Port, its Unit / slave ID, and a Poll interval.
- Choose the Table, Start address and Count you want to read — that becomes the poll.
- Click Start. The register table fills in and refreshes every interval; each poll is logged.
- Editing a value while running as master sends a write request to the device for that address.
Serial (RTU)
Set Transport to Rtu. The panel then shows serial settings:
- Serial port — click Refresh if you plugged in an adapter after opening the app.
- Baud rate, Parity, Data bits, Stop bits — must match the other end exactly.
For a loopback test on one PC, pair two virtual COM ports (e.g. withcom0com) and run one instance as slave on the first port and another as master on the second.
RTU framing uses an idle-gap timeout. If you see CRC or framing errors at high baud rates on a slow USB adapter, raise the inter-frame gap in the source (SerialOptions.InterFrameGapMs) — a configurable field is planned.
The register table
- Four tables, each spanning the full 0–65535 address space: Coils, DiscreteInputs, HoldingRegisters, InputRegisters.
- Address is the zero-based protocol address. Ref is the conventional reference number (holding register 0 shows as
40001). - Register values are 16-bit (0–65535). The Hex column is read-only.
- Bit tables show an On checkbox instead of a value.
- Discrete inputs and input registers are read-only over the wire, but you can still set them here to simulate device state.
Traffic log & CSV export
Every frame is logged with time, direction (RX/TX), unit ID, function, a decoded detail string, and the raw ADU bytes as hex. Exceptions are flagged with their code.
Export CSV… writes the current log to a file (Timestamp,Direction,UnitId,Function,Address,Quantity,Exception,Detail,RawHex).Clear empties it. The view keeps the most recent 1000 rows.
Troubleshooting
- "Failed to start" on a TCP slave
- Port 502 needs administrator rights, or another process (often a real Modbus service) already holds it. Use a higher port.
- Master logs "response timeout"
- Wrong host/port, wrong unit ID, a firewall in the way, or the device is slower than the response timeout. Raise the timeout and confirm the unit ID.
- Master logs an exception code
- IllegalDataAddress means the address range you asked for does not exist on that device. IllegalFunction means it does not support that function code.
- Serial: nothing happens / CRC errors
- Baud, parity, data bits and stop bits must match on both ends. Confirm the COM port and that no other program has it open.
Building from source
Requires the .NET 10 SDK.
git clone https://github.com/openbench-tools/openbench.git cd openbench/tool-modbus-sim dotnet test ModbusSim.slnx dotnet run --project src/ModbusSim.App -c Release
Full source, issue tracker, and build notes:github.com/openbench-tools/openbench.