Development without hardware
Start integration work while equipment is being procured. Use simulated devices to develop and check your Modbus client application.
Simulate Modbus TCP and RTU devices while developing and testing your software. Define registers, coils and device responses before the physical equipment is available.
Start integration work while equipment is being procured. Use simulated devices to develop and check your Modbus client application.
Repeat normal and fault scenarios, including timeouts and boundary values that can be difficult to reproduce on physical equipment.
Practise Modbus configuration and troubleshooting on simulated devices without making changes to production equipment.
Use simulated devices in automated regression tests when physical equipment is not available to the build environment.
Simulate devices on an Ethernet network and accept connections from multiple clients.
Serial communication support with automatic CRC calculation and configurable port settings.
Read discrete inputs and registers, and read or write coils and holding registers. Supported operations include:
Configure the size and values of the four Modbus data areas, and update values during simulation.
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();
// 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();
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();
}
}
Performance figures are from internal benchmarks and depend on the host and simulation workload. Check the register map, timing and behaviour of your target device; simulation does not replace final testing with that equipment.
Tell us which devices, register maps and test scenarios you need to simulate. We can discuss suitability, licensing and integration with your test environment.