Modbus Simulation Strategies for Electrical Engineers
Electrical engineers working in power systems, building automation, and industrial control regularly encounter Modbus-connected devices — variable frequency drives, energy meters, protection relays, and programmable controllers. Developing software to communicate with these devices requires either having the physical hardware on your desk or simulating it.
Hardware is expensive, bulky, and often unavailable during early development. Simulation solves this by letting you create virtual Modbus devices that behave exactly like the real thing. This guide covers practical simulation strategies for the devices electrical engineers work with most.
Why Simulation Matters for Electrical Engineers
In traditional workflows, engineers write PLC or SCADA code and then test it during commissioning at the job site. Problems discovered at this stage are expensive to fix — you are on-site, equipment is energized, and schedule pressure is high.
Simulation moves testing earlier in the process:
- Office development: Build and test HMI screens, alarm logic, and control sequences without hardware
- Edge case testing: Simulate fault conditions (overcurrent, communication failure, sensor out-of-range) that are dangerous to reproduce on real equipment
- Integration testing: Verify that your master application correctly reads registers, writes setpoints, and handles error responses
- Training: Teach junior engineers how Modbus works without risking damage to real devices
- Documentation verification: Confirm that a device's register map documentation matches its actual behavior before going to site
Simulating Variable Frequency Drives (VFDs)
VFDs are one of the most common Modbus devices in electrical engineering. Every major manufacturer (ABB, Siemens, Schneider, Danfoss, Yaskawa) supports Modbus RTU or TCP for monitoring and control.
Typical VFD Register Map
| Register | Type | Description | Data Format |
|---|---|---|---|
| 40001 | Holding | Speed Setpoint | 0–50000 (0.00–500.00 Hz) |
| 40002 | Holding | Control Word | Bit field (Run/Stop/Direction/Reset) |
| 40003 | Holding | Acceleration Time | 0–6000 (0.0–600.0 seconds) |
| 40004 | Holding | Deceleration Time | 0–6000 (0.0–600.0 seconds) |
| 30001 | Input | Actual Speed | 0–50000 (0.00–500.00 Hz) |
| 30002 | Input | Motor Current | 0–10000 (0.0–1000.0 A) |
| 30003 | Input | Status Word | Bit field (Running/Fault/Warning/Ready) |
| 30004 | Input | DC Bus Voltage | 0–10000 (0–1000 V) |
Simulation Strategy
Set up a slave simulator with the register map above. The key to realistic VFD simulation is making the input registers respond to changes in the holding registers:
- When the control word Run bit is set and a speed setpoint is written, the actual speed register should ramp up gradually (simulating acceleration)
- Motor current should increase proportionally to the speed setpoint
- The status word should reflect the drive state (Ready → Running → At Speed)
- Writing the Stop bit should cause actual speed to ramp down
For basic testing, static register values are sufficient. For HMI development, you want dynamic values that change over time to verify your trending displays and alarm logic work correctly. A tool like Modbus Simulator lets you set up these register maps and manually adjust values during testing.
Simulating Power Monitoring Devices
Power meters and energy analyzers are critical in electrical distribution systems. Devices like the Schneider PM5000 series, Siemens SENTRON PAC, and ABB M4M use Modbus for exposing measurements to building management and SCADA systems.
Typical Power Meter Register Map
| Register | Type | Description | Data Format |
|---|---|---|---|
| 30001–30002 | Input | Phase A Voltage | 32-bit Float (IEEE 754) |
| 30003–30004 | Input | Phase B Voltage | 32-bit Float |
| 30005–30006 | Input | Phase C Voltage | 32-bit Float |
| 30007–30008 | Input | Phase A Current | 32-bit Float |
| 30013–30014 | Input | Total Active Power (kW) | 32-bit Float |
| 30017–30018 | Input | Power Factor | 32-bit Float (0.0–1.0) |
| 30021–30022 | Input | Frequency | 32-bit Float (49.5–50.5 Hz) |
| 30025–30028 | Input | Total Energy (kWh) | 64-bit Double or 32-bit Float |
Byte Order Challenges
Power meters are notorious for byte order inconsistencies. A 32-bit float value occupies two consecutive 16-bit Modbus registers, but the order of bytes within those registers varies between manufacturers:
- Big Endian (AB CD): Most common in Schneider and ABB devices
- Little Endian (CD AB): Used by some Siemens devices
- Mid-Big Endian (BA DC): Occasionally seen in older devices
- Mid-Little Endian (DC BA): Rare but exists
When simulating a power meter, configure the byte order to match your target device. If you read a voltage value and see 4.59e+30 instead of 230.5, you have a byte order mismatch. Modbus Simulator supports all four byte orders so you can quickly identify the correct setting for your device.
Simulating Building Automation Controllers
Building automation systems (BAS) use Modbus extensively for HVAC control, lighting, and energy management. Devices include programmable thermostats, VAV controllers, chiller controllers, and lighting panels.
Common BAS Register Patterns
- Temperature setpoints (Holding Registers): Room temperature setpoint, cooling setpoint, heating setpoint, occupancy mode
- Sensor readings (Input Registers): Room temperature, outside air temperature, humidity, CO2 level, airflow
- Equipment status (Discrete Inputs): Fan running, compressor running, heating valve open, alarm active
- Control outputs (Coils): Fan enable, cooling enable, heating enable, occupied/unoccupied mode
Building automation simulation is valuable for BMS integrators developing front-end graphics. You can simulate an entire floor of controllers without any hardware, test your graphics against varying conditions (summer vs. winter, occupied vs. unoccupied), and verify alarm routing before the building is operational.
Simulating Protection Relays
Protection relays in power distribution use Modbus for remote monitoring and configuration. Devices like the SEL-751, ABB REF615, and Schneider Sepam expose fault records, trip logs, and device status through Modbus registers.
Key Simulation Points
- Fault registers: Simulate overcurrent, ground fault, and under/over voltage conditions by writing appropriate status bits
- Metering registers: Provide voltage, current, and power readings through input registers (32-bit float)
- Event log: Some relays expose the last N events through a block of registers — simulate by pre-populating with sample fault events
- Configuration: CT ratios, PT ratios, and protection settings are typically in holding registers
Testing relay integration in simulation is especially important because relay communication failures in production can cause missed alarms — a safety risk.
Multi-Device Simulation Setup
Real electrical systems have dozens of Modbus devices on the same network. To simulate a realistic environment:
Modbus TCP
Run multiple slave instances on different TCP ports. For example:
- Port 502: VFD simulation (Slave ID 1)
- Port 503: Power meter simulation (Slave ID 2)
- Port 504: BAS controller simulation (Slave ID 3)
- Port 505: Protection relay simulation (Slave ID 4)
Modbus RTU
Assign different slave IDs on the same serial port (or virtual COM port pair):
- Slave ID 1: VFD at 19200 baud, 8N1
- Slave ID 2: Power meter at 19200 baud, 8N1
- Slave ID 3: BAS controller at 9600 baud, 8E1
Tip: When simulating RTU devices on the same port, all slaves must share the same baud rate and parity settings. If the real devices have different serial settings, you will need separate COM ports (use virtual COM port software like com0com).
Best Practices for Electrical Engineers
- Start from the device manual: Always use the manufacturer's register map documentation as the source of truth for your simulation
- Test error responses: Simulate function code errors (illegal function, illegal data address, slave device failure) to verify your master application handles them gracefully
- Use realistic values: Set register values within the device's actual operating range. A voltage register showing 50,000V will not test your HMI alarm logic effectively
- Verify byte order early: Before building your full application, read a known register and confirm the byte order is correct. A single byte order mistake wastes hours of debugging
- Document your simulation setup: Record which registers you configured and what values they represent. This becomes your test procedure for site commissioning
For a comprehensive introduction to register types, read our register types guide. For troubleshooting communication issues, see our troubleshooting guide.
Simulate Any Electrical Device
Modbus Simulator supports all four register types, Modbus TCP and RTU, 21+ display formats including IEEE 754 float, and 4 byte-order options. Simulate VFDs, power meters, protection relays, and building automation controllers from your desk.
Download Free VersionFrequently Asked Questions
Why do electrical engineers need Modbus simulation?
Electrical engineers need Modbus simulation to develop and test SCADA/HMI interfaces, PLC programs, and control system logic without requiring physical devices like VFDs, energy meters, or RTUs. Simulation eliminates hardware dependency during development, reduces commissioning time on site, and allows engineers to test fault conditions and edge cases that are dangerous or impractical to reproduce with real equipment.
How do I simulate a Modbus-connected VFD?
Set up a Modbus slave simulator with the VFD's register map. Configure holding registers for speed setpoint (typically 0–50000 representing 0.00–500.00 Hz), control word (start/stop/direction bits), and acceleration/deceleration times. Configure input registers for actual speed feedback, motor current, status word, and DC bus voltage. The simulator should respond to FC03 (read holding), FC04 (read input), FC06 (write single), and FC16 (write multiple) function codes.
What register types are used in power monitoring?
Power monitoring devices use input registers (FC04, read-only) for measurement data like voltage, current, power, and energy. These are typically 32-bit IEEE 754 floating point values across two consecutive registers. Holding registers (FC03/FC06, read-write) handle configuration: CT ratios, PT ratios, alarm thresholds, and communication settings.
Can I simulate multiple devices on one computer?
Yes. For Modbus TCP, run multiple slave instances on different TCP ports (502, 503, 504, etc.). For Modbus RTU, assign different slave IDs on the same serial port. A tool like Modbus Simulator supports multiple simultaneous slave instances with independent register maps.
What is the best free Modbus simulator for electrical engineering?
ModbusSimulator (modbussimulator.com) offers a free version supporting master and slave simulation, TCP and RTU protocols, all four register types, 21+ display formats including IEEE 754 float, and 4 byte-order options. It is suitable for simulating VFDs, energy meters, protection relays, and building automation controllers.