Virtual Modbus device simulation for industrial testing and development. Create TCP and RTU devices without physical hardware.
Develop and test industrial systems without physical hardware constraints
Build and test Modbus client applications before physical devices are available. Eliminates hardware dependencies in early development phases.
Create reproducible test scenarios including error conditions, edge cases, and timeout situations that are difficult to trigger with real equipment.
Safe, repeatable environment for teaching industrial protocols. Students practice troubleshooting without risking actual equipment.
Automated regression testing for Modbus systems. Virtual devices enable continuous integration pipelines for industrial software.
Complete Modbus TCP and RTU implementation
Full TCP/IP implementation for Ethernet networks with multiple concurrent client connections.
Serial communication support with automatic CRC calculation and configurable port settings.
All standard Modbus function codes for reading and writing coils, discrete inputs, and registers.
Complete Modbus memory model with configurable sizes and real-time data simulation.
Quick start with Modbus Digital Twin
Create a Modbus TCP device for Ethernet network testing
using ULTRAMEGA.Modbus.DTS;
// Create TCP device on port 502
var device = ModbusDeviceFactory.CreateTcpDevice(
deviceId: 1,
port: 502
);
// Set initial values
device.SetHoldingRegister(0, 1234);
device.SetCoil(0, true);
// Start the device
await device.StartAsync();
// Device now responds to Modbus TCP requests
Console.WriteLine("Device running on port 502");
Console.ReadKey();
await device.StopAsync();
Configure a Modbus RTU device for serial communication
// Create RTU device with serial settings
var device = new ModbusRtuDevice(
deviceId: 2,
portName: "COM3",
baudRate: 9600,
parity: Parity.None,
dataBits: 8,
stopBits: StopBits.One
);
// Configure timeouts
device.ResponseTimeout = TimeSpan.FromMilliseconds(500);
// Start the device
await device.StartAsync();
Implement realistic sensor behavior
public class TemperatureSimulator : ModbusTcpDevice
{
private Random random = new Random();
public override void SimulateData()
{
// Simulate 10 temperature sensors
for (int i = 0; i < 10; i++)
{
float temp = 20 + (float)(random.NextDouble() * 15);
SetHoldingRegister(i, (ushort)(temp * 10));
// Set alarm if temperature exceeds threshold
SetCoil(i + 100, temp > 30);
}
base.SimulateData();
}
}
Ready to simplify your Modbus testing workflow?
Contact us to learn more about Modbus Digital Twin and how it can accelerate your industrial software development.