Modbus simulator CLI is a high-performance modbus TCP server with customizable simulation
Please see the project website for documentation
- High performance TCP Server
- 100% Kotlin code - JVM (Multiplatform)
- Ability to associate memory registers with symbols (variable names)
- Ability to create custom simulation which can during runtime set, clear variables, execute math operations over registers, deal with specific timing requirements
- Available as CLI tool or as docker image
The table below shows the supported registers and which datatype and simulation operation can be performed for each register.
Register | Datatype | Operations |
---|---|---|
Coils (0x) | BOOL | Set, IfEqual, IfGreater, IfLess |
Input register (1x) | BOOL | Set, IfEqual, IfGreater, IfLess |
Discrete Input (3x) | INT16 | Set, Add, Sub, Random, Linear, Csv, IfEqual, IfGreater, IfLess |
Holding Registers (4x) | INT16, UINT16, FLOAT32 | Set, Add, Sub, Random, Linear, Csv, IfEqual, IfGreater, IfLess |
- Compile with gradle and generate fat Jar
./gradlew shadowJar
- Run it with "-sr" argument which is the most basic simulation, consisting in generating random values each time a read operation is performed.
java -jar build/libs/modbus-simulator-cli-1.0-SNAPSHOT-all.jar -sr
For customization options check full documentation
- Pull the Modbus Simulator
docker pull paulorb/modbus-simulator-cli
- Run the Modbus Simulator
docker run --rm -p 5002:5002 paulorb/modbus-simulator-cli -sr