Introduction to Free Modbus Simulator (ModRSsim2)
Free Modbus Simulator (The latest version is named ModRSsim2) It is a Windows Free on the platform Modbus RTU And TCP From the station (Slave/Server) Simulator, The project is hosted in SourceForge: sourceforge.net/projects/modrssim2.
ModRSsim2 It's the original version "Free Modbus Simulator" A branch of (fork) And extended versions, Maintained by community developers. use Visual Studio C++ 2010 to write, Complete source code open source. It has added more diagnostic functions and script support on the basis of the original version.
Functional characteristics
- Full address space simulation: Support four types Modbus Data type (0xxxx Coil, 1xxxx Discrete input, 3xxxx Input register, 4xxxx Maintain registers) The complete address range
- Multi device simulation: Can simulate multiple different simultaneously Device ID (Slave Address)
- Dual protocol: Simultaneously support Modbus RTU (Serial port) And Modbus TCP (Ethernet)
- Traffic capture: Complete byte level communication capture and logging, Provide manually readable decoding descriptions
- CSV load: From CSV Batch loading of files with initial register values
- Script environment: Support testing scripts, Automatically modify register values
- HTML Custom display: Can be used HTML Template custom data display interface
- Complete source code: C++ The source code is available, Easy for secondary development
Download and install
# from SourceForge Download
# https://sourceforge.net/projects/modrssim2/
# Download the latest version directly EXE installation package,Just run and installStart up after installation ModRSsim2, The main interface provides the following operation areas:
- Top menu bar: to configure, connect, script, Logs, etc
- Left device tree: Manage multiple slave devices for simulation
- Middle data area: Display and edit the values of registers/coils
- Bottom log area: Display communication traffic and decoding information
establish TCP From the station
- Click on the menu bar Connection → TCP/IP
- Set the listening port (Default 502)
- Set the slave station address (Device ID) : 1
- Select in the data area Holding Registers (4xxxx) Label page
- Fill in the desired register value directly in the table
- Click Start Button start simulation
Use Modbus Poll Or Modpoll connect 127.0.0.1:502 Testing, You can read the set value.
establish RTU Serial port slave station
- Click on the menu bar Connection → Serial (RTU)
- Select serial port number (Like COM3)
- Set the baud rate (9600) , Data bits (8) , Checksum (None) , Stop position (1)
- Set the slave station address
- Click Start Start up
⚠️ ModRSsim2 When using a serial port, This serial port will be exclusively used. Do not use other software to open the same serial port at the same time, Otherwise, a "port occupied" error may occur.
Communication logs and diagnostics
ModRSsim2 The communication log function is very detailed, For debugging Modbus Communication issues are very valuable:
- Byte level capture: Display the original hexadecimal communication bytes
- Decoding description: Automatically parsing the meaning of each frame (Like "FC03: Read Holding Registers from address 0, count 10")
- Timestamp: Each record has an accurate timestamp
- Log export: Can be exported as a text file for analysis
CSV Batch loading register values
If you need to simulate a device with dozens or even hundreds of registers, It is unrealistic to manually fill in values one by one. ModRSsim2 support CSV Batch import of files:
# CSV Format Example(holding_registers.csv)
Address,Value,Description
40001,1234,Aphase voltage(mV)
40002,1198,Bphase voltage(mV)
40003,1205,Cphase voltage(mV)
40004,850,Aphase current(mA x100)
40005,830,Bphase current(mA x100)
40006,845,Cphase current(mA x100)
40007,1020,frequency(Hz x100)
40008,500,active power(W)Menu → File → Import CSV → Select file → Import completed.
ModRSsim2 vs Other free simulators
| Tools | Platform | characteristic | Activity level |
|---|---|---|---|
| ModRSsim2 | Windows | Full address space, Communication log, CSVImport, Open source | Low |
| ModbusPal | Cross platform(Java) | PythonScript dynamically generates data | Low |
| Modbus Slave | Windows | Commercial software, The most complete function | Active |
| Unslave | Cross platform | Modern UI, Still under development | In the middle |
Summary
ModRSsim2 Yes Windows The most practical free option on the platform Modbus One of the slave station simulators. Although it does not ModbusPal That way Python Script dynamic data capability, But in static simulation scenarios (Simulate a fixed slave device according to the known data table) More simple and direct. Especially its communication log decoding function and CSV Batch import function, Very suitable for Modbus Conduct joint debugging and testing during the development phase of the main station.
Leave a Reply