Modbus RTU Simulator: RS-232/RS-485 Serial Communication Testing
Testing Modbus RTU communication during PLC development, panel commissioning, or industrial automation projects requires access to serial devices connected via RS-232 or RS-485 networks. But when field devices are not yet installed, or you need to test edge cases like CRC errors and communication timeouts without disrupting production equipment, a Modbus RTU simulator provides the solution. It emulates both master and slave devices entirely in software, allowing you to develop and test serial Modbus applications on your desktop without physical hardware.
This comprehensive guide explains what Modbus RTU is, how it uses serial communication, why you need an RTU simulator, and how to set one up in five steps. Whether you are commissioning PLCs, testing SCADA serial interfaces, or troubleshooting RS-485 networks, this guide covers everything engineers need to know about Modbus RTU simulation.
What Is Modbus RTU?
Modbus RTU (Remote Terminal Unit) is the serial variant of the Modbus protocol. Unlike Modbus TCP which uses Ethernet networks, RTU transmits register read/write commands over serial RS-232 or RS-485 connections. RTU is the most common Modbus variant in panel-mounted industrial devices, process controllers, energy meters, and legacy automation systems where Ethernet infrastructure is not available or necessary.
RTU Frame Structure
A Modbus RTU frame consists of these components transmitted serially as a continuous stream of bytes:
| Field | Size (bytes) | Description |
|---|---|---|
| Start (Silent Interval) | 3.5 char times | Idle period before frame (no data transmitted) |
| Slave Address | 1 | Device address (1–247), 0 = broadcast |
| Function Code | 1 | Operation to perform (01-06, 15, 16, etc.) |
| Data | Variable | Register addresses, quantities, values (0-252 bytes) |
| CRC | 2 | CRC-16 error detection (low byte first) |
| End (Silent Interval) | 3.5 char times | Idle period after frame |
The 3.5 character silent interval before and after each frame is critical. It marks frame boundaries since RTU does not use start/stop delimiters like ASCII mode. At 9600 baud with 11 bits per character (1 start + 8 data + 1 parity + 1 stop), 3.5 characters = 4.01ms. Any gap longer than 3.5 characters signals a new frame.
CRC-16 Error Detection
Modbus RTU uses CRC-16 (Cyclic Redundancy Check) to detect transmission errors. The transmitter calculates a 16-bit CRC value from all message bytes (slave ID, function code, and data) using polynomial 0xA001, then appends the CRC as two bytes (low byte first, then high byte). The receiver recalculates the CRC and compares it to the received value. If they match, the frame is accepted. If not, the frame is discarded without responding — silence indicates an error.
CRC-16 detects all single-bit errors, all double-bit errors, all odd numbers of bit errors, and most burst errors up to 16 bits. This makes RTU highly reliable even on electrically noisy industrial serial buses.
Why Use a Modbus RTU Simulator?
Modbus RTU simulators deliver immediate value in these key scenarios:
1. PLC Programming Without Field Devices
When developing ladder logic or structured text programs for PLCs, you need to test serial communication with field devices like temperature transmitters, flow meters, and motor drives. Waiting for all devices to be purchased, installed, and wired before testing your PLC code delays projects by weeks or months. An RTU simulator lets you create virtual slaves with realistic register maps, allowing PLC developers to write and test communication logic immediately.
2. RS-485 Multi-Drop Network Testing
Industrial RS-485 networks often connect 10-30 slave devices on a single multi-drop bus. Testing this requires verifying that each slave responds at the correct baud rate, that bus termination is correct, that the master's polling cycle stays within timeout limits, and that no slaves cause bus collisions. A simulator can create 30 virtual slaves on virtual COM ports, allowing complete network testing on your desktop before panel integration begins.
3. Serial Communication Troubleshooting
When a PLC cannot communicate with a field device, you need to isolate whether the problem is the PLC's serial configuration, the device's settings, or the physical wiring. Connecting an RTU simulator configured to match the device's slave address and baud rate lets you verify the PLC's master configuration works. If the PLC can poll the simulator but not the real device, the device or wiring is faulty. If it cannot poll the simulator either, the PLC configuration is wrong.
4. SCADA Serial Interface Development
SCADA systems that connect to legacy RTU devices via serial ports need extensive testing of serial driver configuration, timeout handling, and multi-device polling. An RTU simulator allows SCADA developers to test against dozens of virtual devices without requiring a lab full of expensive hardware. You can simulate device responses, communication delays, and error conditions to verify your SCADA software handles all scenarios correctly.
5. Training and Education
Learning Modbus RTU requires hands-on practice with framing, CRC calculation, serial parameters, and troubleshooting. An RTU simulator provides a safe environment for students to experiment with different baud rates, parity settings, and register configurations without needing PLC trainers or industrial panels. They can see raw hex frames, observe CRC validation, and understand how master/slave timing works.
RS-232 vs RS-485: Which Serial Standard to Use?
Modbus RTU can run over both RS-232 and RS-485 serial interfaces, but they have very different capabilities:
| Aspect | RS-232 | RS-485 |
|---|---|---|
| Topology | Point-to-point only | Multi-drop bus (up to 32 devices) |
| Distance | 15 meters max | 1200 meters max |
| Signal | Single-ended (referenced to ground) | Differential (A and B lines) |
| Noise Immunity | Poor (susceptible to EMI) | Excellent (differential cancels noise) |
| Baud Rate vs Distance | 115200 bps @ 15m max | 9600 bps @ 1200m, 115200 bps @ 100m |
| Termination | Not required | 120-ohm resistors at both ends |
| Typical Use Cases | PC-to-single device, lab testing | Industrial multi-drop networks, panel wiring |
| Cost | Lower (simple interface chips) | Higher (requires transceivers and cabling) |
Industrial Modbus RTU networks overwhelmingly use RS-485 because of its multi-drop capability and long-distance support. RS-232 is only used for point-to-point connections like PC-to-instrument configuration tools.
Key Features of a Professional Modbus RTU Simulator
When evaluating RTU simulators, look for these essential capabilities:
1. Full Baud Rate Range (1200-115200 bps)
Modbus RTU supports baud rates from 1200 to 115200 bps. While 9600 and 19200 are most common, some devices use 38400, 57600, or even 115200 for faster response times over short distances. Your simulator should support all standard baud rates and allow custom values for non-standard devices.
2. Configurable Parity and Stop Bits
The Modbus specification recommends 8 data bits, even parity, and 1 stop bit (8-E-1), but many devices also support no parity with 2 stop bits (8-N-2) or odd parity (8-O-1). Your simulator must match the exact serial parameters of the devices you are testing.
3. CRC Validation and Generation
Professional simulators automatically calculate and verify CRC-16 checksums for every frame. They should also allow you to manually send frames with incorrect CRCs to test how your master handles corrupted data. Being able to view the calculated CRC values helps when debugging custom Modbus implementations.
4. RTS (Request to Send) Control
RS-485 is a half-duplex bus where only one device can transmit at a time. USB-to-RS485 adapters often require RTS control to switch the transceiver between transmit and receive modes. Your simulator should support automatic RTS toggling with configurable timing (typically RTS goes high before transmission, then low 1-2ms after the last byte).
5. Virtual COM Port Support
For desktop testing without RS-485 hardware, the simulator should work with virtual COM port pairs created by tools like com0com (Windows) or socat (Linux). This allows master and slave to run on the same PC for development and automated testing.
6. Frame Timing Analysis
Seeing the exact timing between characters and frames is essential for diagnosing timing-related issues. The simulator should show inter-character gaps, 3.5-character silent intervals, and total frame transmission times. This helps identify issues like excessive inter-character delays that violate the RTU specification.
7. Multiple Slave Addresses
Real RS-485 networks have multiple slaves. Your simulator should support configuring multiple slave instances on one COM port, each with its own address (1-247) and register map. This allows realistic multi-drop network testing on a single serial port.
How to Set Up a Modbus RTU Simulator (Step-by-Step Tutorial)
Follow this five-step tutorial to configure a Modbus RTU slave simulator and test it with a master:
Step 1: Download and Install the Simulator
Download Modbus Simulator from modbussimulator.com. The software runs on Windows 10/11 and includes both master and slave modes with full Modbus RTU support. After installation, launch the application and navigate to the Slave tab.
Step 2: Configure Serial Port and Parameters
Set up the RTU slave for serial communication:
- Protocol: Select Modbus RTU
- COM Port: Select a physical COM port (if using USB-to-RS485 adapter) or a virtual COM port (if using virtual port pairs for desktop testing)
- Baud Rate: 9600 (Modbus default) or match your master's setting. Common values: 9600, 19200, 38400
- Data Bits: 8 (fixed for Modbus RTU)
- Parity: Even (Modbus default). Some devices use None (then set Stop Bits to 2) or Odd
- Stop Bits: 1 (when using parity), 2 (when parity is None)
- Slave Address: Set between 1–247. Common convention: 1 for the first device
Note: For RS-485 testing without hardware, download com0com (free virtual COM port driver for Windows) from sourceforge.net. Create a virtual port pair (e.g., COM10 and COM11). Configure the slave on COM10 and the master on COM11.
Step 3: Configure RTS Control (RS-485 Only)
If using a USB-to-RS485 adapter, enable RTS control:
- Check Enable RTS option
- Set RTS Mode to Auto (simulator toggles RTS before/after transmission)
- Configure RTS Delay if your adapter requires specific timing (typically 1-5ms)
Virtual COM ports do not need RTS control since they do not have physical transceivers.
Step 4: Configure Register Data
Populate the slave's register memory with test data. For a typical sensor device:
- Holding Register 0: 2350 (temperature in 0.1°C: 235.0°C)
- Holding Register 1: 1013 (pressure in mbar: 1013 mbar)
- Holding Registers 2-3: 32-bit float representing flow rate (e.g., 125.75 L/min)
- Input Register 0: 50000 (cumulative counter)
- Coil 0: ON (pump running)
- Discrete Input 0: OFF (alarm not triggered)
Most simulators support CSV import for devices with hundreds of registers.
Step 5: Start the Slave and Test Communication
Click Start to activate the RTU slave. The status should show "Listening on COM10" or similar. Now test with a master:
- Open the Master tab in the same simulator (or use a separate master tool)
- Set Protocol to Modbus RTU
- Select COM Port: COM11 (the paired virtual port, or the same physical RS-485 bus if using real hardware)
- Set Baud Rate, Parity, Stop Bits to match the slave (9600-8-E-1)
- Set Slave Address: 1 (matching the slave)
- Select Function Code 03 (Read Holding Registers)
- Enter Start Address: 0 and Quantity: 4
- Click Send or Start Polling
The master should display the register values you configured in Step 4 (2350, 1013, and two words of the float). The slave's communication log shows the incoming request with hex bytes, CRC value, and the outgoing response.
Common Modbus RTU Errors and Solutions
Error 1: CRC Mismatch / No Response
Symptom: Master sends request but slave does not respond, or master reports CRC error
Causes:
- Baud rate mismatch (master and slave using different speeds)
- Parity setting mismatch (even vs none vs odd)
- Electrical noise on RS-485 bus causing bit errors
- Missing or incorrect termination resistors (120 ohms at both ends)
Solutions:
- Verify both devices use identical serial parameters (9600-8-E-1)
- Check raw hex bytes in the communication log — corrupted data indicates noise or wrong settings
- For RS-485, verify 120-ohm termination resistors are installed at both ends of the bus
- Reduce baud rate (try 9600 instead of 19200) if long cable runs cause errors
Error 2: Timeout (No Response)
Symptom: Master reports timeout after 1-5 seconds, slave shows no received frames
Causes:
- COM port not open (slave not started or wrong port selected)
- Master and slave using different COM ports (not paired or not on same RS-485 bus)
- Wrong slave address (master polling address 5, slave configured for address 1)
- RTS control issue (RS-485 transceiver stuck in transmit mode, cannot receive)
Solutions:
- Verify slave status shows "Listening" and COM port is open
- Verify master and slave are using the correct paired ports or same physical RS-485 bus
- Set master to poll the exact slave address configured in the slave (addresses must match)
- Check RTS control settings — disable if using virtual ports, enable for USB-RS485 adapters
Error 3: Intermittent Responses
Symptom: Some requests succeed, others timeout or get CRC errors
Causes:
- RS-485 bus contention (multiple slaves transmitting simultaneously)
- Loose cable connections causing intermittent contact
- Electrical noise from motors, VFDs, or high-voltage lines near serial cables
- RTS timing too tight (transceiver switches back to receive before last byte transmitted)
Solutions:
- Verify each slave has a unique address (no duplicates)
- Check all cable terminations, connectors, and screw terminals are tight
- Use shielded twisted-pair cable and route it away from power cables and motors
- Increase RTS delay by 1-2ms to ensure complete frame transmission before releasing the bus
For more troubleshooting guidance, see our comprehensive Modbus troubleshooting guide.
Advanced Modbus RTU Features
Address Scanner for Device Discovery
When commissioning an RS-485 network with unknown slave addresses, an address scanner automatically polls all 247 possible addresses (1-247) and reports which ones respond. This quickly identifies what devices are on the bus without needing to reference device labels or documentation. Professional simulators include built-in address scanning with configurable timeout and retry settings.
Extended Addressing (ENRON/DANIEL)
Some industrial protocols extend Modbus RTU with 32-bit register addressing instead of the standard 16-bit (65535 register limit). ENRON and DANIEL protocols use special function codes (65-72) to access extended register ranges. Professional simulators support these extensions for testing flow computers and custody transfer meters.
Broadcast Messages (Address 0)
Modbus RTU supports broadcast writes where the master sends a write command to address 0, and all slaves execute it without responding (to avoid bus collisions). This is useful for synchronizing clocks or updating configuration across all devices simultaneously. Simulators should support configuring slaves to respond to broadcast writes.
Frequently Asked Questions
What is a Modbus RTU simulator?
A Modbus RTU simulator is a software tool that emulates Modbus RTU communication over serial RS-232 or RS-485 connections without physical devices. It can act as a master (polling device registers) or slave (responding to requests) for testing PLC programs, SCADA systems, and industrial automation equipment during development without requiring actual field hardware.
What baud rate should I use for Modbus RTU?
The most common Modbus RTU baud rate is 9600 bps with 8 data bits, even parity, and 1 stop bit (9600-8-E-1). Higher speeds like 19200, 38400, 57600, and 115200 bps are also supported but may require shorter cable lengths. Industrial devices often default to 9600 bps for maximum compatibility and reliability over long RS-485 bus runs (up to 1200 meters).
What is the difference between RS-232 and RS-485 for Modbus RTU?
RS-232 is a single-ended serial standard supporting only point-to-point connections (one master, one slave) over short distances (15 meters max). RS-485 is a differential standard supporting multi-drop networks (one master, up to 32 slaves on one bus) over distances up to 1200 meters. Industrial Modbus RTU networks almost always use RS-485 for its noise immunity and multi-device capability.
How does CRC work in Modbus RTU?
Modbus RTU uses CRC-16 (Cyclic Redundancy Check) for error detection. The transmitter calculates a 2-byte CRC value from the message bytes (slave ID + function code + data) using the polynomial 0xA001, then appends it to the frame. The receiver recalculates the CRC and compares it. If they match, the frame is valid. If not, the frame is discarded as corrupted. CRC detects most transmission errors caused by electrical noise on serial lines.
Can I test Modbus RTU without RS-485 hardware?
Yes. You can use virtual COM port software like com0com (Windows) or socat (Linux) to create virtual serial port pairs on your PC. Configure your Modbus RTU simulator to use one virtual port and your master application to use the paired port. This allows complete RTU testing without USB-to-RS485 adapters or physical devices. For production deployment, you will still need real RS-485 hardware.
What is the maximum distance for Modbus RTU RS-485?
Modbus RTU over RS-485 supports distances up to 1200 meters (4000 feet) at lower baud rates (9600 bps). Higher baud rates reduce maximum distance: 19200 bps supports about 600m, while 115200 bps may only work reliably over 100-200m. Use shielded twisted-pair cable, proper termination resistors (120 ohms at both ends), and biasing resistors for best performance over long runs.
Download the Best Modbus RTU Simulator
Modbus Simulator includes full Modbus RTU and TCP support, master + slave modes, CRC validation, baud rate 1200-115200 bps, RTS control, and detailed frame logging. Free 30-day trial with all features unlocked.
Download Free Trial