ULTRAMEGA
← HomeProducts

Modbus Digital Twin

Simulate Modbus TCP and RTU devices with the register maps and responses you need to test before the physical equipment is available.

Client · transport · virtual device

Test your client against a known register map

Modbus Digital Twin responds as a virtual Modbus device over TCP or RTU. Set its unit ID, data areas and initial values to match the register map your client needs. Then test addressing, data interpretation and writes before the equipment arrives.

Change values while the simulation runs and repeat normal responses, boundary cases, exceptions and timeouts. Use the setup for development, regression testing or training. Still verify the register map, timing and behaviour on the physical device before commissioning.

Your client exchanges Modbus requests and responses with a virtual device YOUR CLIENT HMI, PLC or software TWIN Register map and responses Request Response TCP OVER ETHERNET OR SERIAL RTU
network and serial communication
TCP / RTU
Modbus data areas
4
addresses per area, up to
65,536
runtime on Windows and Linux
.NET 6+
Why switch

Test the client before the equipment arrives

Development before delivery

TodayThe first protocol-level reads and writes have to wait for the physical device.

With Modbus Digital TwinConnect the client to a simulated register map and check protocol handling and data interpretation while the equipment is being procured.

Exceptions and timeouts

TodayFaults rarely occur in the order you need and can be hard to reproduce on the bench.

With Modbus Digital TwinExercise a successful response, a Modbus exception and a timeout separately. Check how the client responds and whether it resumes polling.

Regression in CI

TodayThe job needs an available physical device whose state may depend on the previous test.

With Modbus Digital TwinStart a virtual device with known values in the test job and run the same read and write sequence on each change.

Training and troubleshooting

TodayA client configuration exercise needs access to a test bench or production equipment.

With Modbus Digital TwinPractise diagnosing an incorrect unit ID or register offset against a known setup without changing production equipment.

Features

From connection to device response

Modbus TCP over Ethernet

Standard port 502, concurrent client connections, transaction ID tracking and unit identifier support.

ExampleHave the client application and a separate diagnostic tool read from the same virtual TCP device.

Modbus RTU over a serial port

Set baud rate, parity and stop bits. The simulator handles CRC-16 calculation and inter-frame timing.

ExampleTest unit ID 2 at 9600 baud, with 8 data bits, no parity and 1 stop bit.

Four data areas

Set the size and initial values of coils, discrete inputs, holding registers and input registers. Each area supports up to 65,536 addresses.

ExampleStart with holding register 0 set to 1234 and coil 0 set to 1. They share an offset but belong to separate data areas.

Reads and writes

Read bits or registers and write to coils or holding registers. The simulator also supports Modbus exception responses.

ExampleWrite a single coil with 0x05 and read it back with 0x01 in a regression test.

Values that change during a run

Update registers and coils during simulation. Use custom simulation logic when several signals need to track the same process value.

ExampleUse a holding register for temperature in tenths of a degree and a coil to indicate whether the alarm threshold has been crossed.

Controlled fault scenarios

Test your client with Modbus exceptions and with responses that do not arrive before the client’s timeout.

ExampleCheck that your client distinguishes an address exception from a missing response. They are different failure modes.

Examples

Four test scenarios with known responses

01 / TCP · integration before delivery

Read the first register before the hardware arrives

You are writing a client for a pressure meter. Its documentation uses 40001 for the first holding register and specifies 0.1 kPa per count.

  1. Start a virtual TCP device with unit ID 1 on port 502. Set the holding register at offset 0 to 1234.
  2. Have the client send Read Holding Registers (0x03) to offset 0. Do not send the reference 40001 as the address in the Modbus frame.
  3. Verify that the client receives 1234 and displays 123.4 kPa after scaling.

Outcome You exercise client addressing and scaling against a known raw value before repeating the test on the meter.

The client reads a holding register and scales the raw value to pressureMODBUS TCP · UNIT 1 Client Virtual device 0x03 · read offset 0 Raw value: 1234 CLIENT VALUE 1234 × 0.1 = 123.4 kPa
02 / Register map · boundaries and faults

Distinguish an alarm, an exception and a timeout

The client reads temperature in tenths of a degree from the input register at offset 12. It must raise an alarm above 30.0 °C and waits at most 500 ms for a reply.

  1. Set the register to 299, 300 and 301 in turn. Read with 0x04 and check that only 301 triggers the alarm.
  2. Read an address outside the configured range. Check that the client treats the Modbus exception as an address error.
  3. Repeat a valid read with no response by 500 ms. Check that the client times out and resumes polling when the device responds normally again.

Outcome The test shows that a valid alarm reading, an exception response and a missing reply are handled differently.

Three readings, a Modbus exception and a timeout make five separate test stepsINPUT REGISTER 12 CLIENT OUTCOME 29929.9 °C · normal 30030.0 °C · normal 30130.1 °C · alarm Address outside map Modbus exception No reply by 500 ms Timeout
03 / RTU · serial test bench

Exercise an RTU client with known serial settings

You want to check that a serial client can read a discrete input before connecting the physical I/O module.

  1. Connect the client and simulator ports in your test setup. Set both ends to 9600 baud, 8 data bits, no parity and 1 stop bit (8N1).
  2. Assign unit ID 2 to the virtual device and set the discrete input at offset 7 to 1.
  3. Read the input using 0x02 and verify that the client reports 1. Then set the input to 0 and check that the client updates its value.

Outcome The client has been exercised against a known unit ID, a known input and matching settings at both ends. Run the final test with the physical equipment.

Client and virtual RTU device use the same serial settingsSERIAL RTU · 9600 BAUD · 8N1 Client port Unit 2 0x02 · DISCRETE INPUT Offset 7 → 1 CRC-16 · automatic
04 / CI · automated regression

Make a read and write test part of your build

You want to catch a client change that writes to the wrong coil or reads back the wrong value.

  1. Start a virtual TCP device from the test job. Set the coil at offset 4 to 0 and its neighbours to 1. Wait for a valid response.
  2. Read coil 4 using 0x01 and verify the initial value is 0. Write 1 with 0x05, then use 0x01 to check that coil 4 is now 1.
  3. Use an independent client to verify the expected values at offsets 3, 4 and 5. Stop the virtual device when the test ends.

Outcome Every run starts from the same known state and checks both the protocol exchange and the address the client changes.

The test job reads a known starting value, writes a new value and verifies itONE REGRESSION TEST Start twin Read initial value Write Read back Coil 4 = 0 0x01 → 0 0x05 → 1 0x01 → 1
Specifications

Protocols, addresses and system requirements

Performance figures are internal measurements and depend on the host and the simulation workload. Use your own request pattern to evaluate capacity and timing.

Transport and identification

Modbus TCP
Standard port 502; concurrent connections, transaction IDs and unit identifiers
Modbus RTU
Serial port with configurable baud rate, parity and stop bits; CRC-16 and inter-frame timing

Data areas and addressing

Bits
Coils and discrete inputs; up to 65,536 addresses per area
16-bit registers
Holding registers and input registers; up to 65,536 addresses per area
Address in the frame
Offset 0 to 65,535 within each area. Match offsets to the target device documentation.
State
Configurable sizes and initial values. Values can change during simulation.

Function codes (selected)

0x01 / 0x02
Read coils / discrete inputs
0x03 / 0x04
Read holding registers / input registers
0x05 / 0x10
Write one coil / multiple holding registers
Exceptions
Modbus exception responses are supported

Platform and performance

Application
Standalone application for Windows and Linux
Runtime
.NET 6+
Requests
1,000+ per second
Memory use
< 10 MB
Thread-safe
Yes
Your project

What should your Modbus client be able to handle?

Start with one device. A register map and a sample response give us enough to discuss what to simulate and what to check on the physical equipment.

  1. Note whether the device uses TCP or RTU, its unit ID and the addresses the client needs to read or write.
  2. Pick a normal response, a boundary value and a fault. Describe what the client should show or do in each case.
  3. Identify any timing or behaviour requirements that also need to be tested on the physical device.