Yet Another Modbus Simulator
A simulator for Modbus client/server that supports YAML based configuration and behavior definition, with pure Rust.
YAMS supports Modbus device configuration and behavior definition via YAML files. This means one can predefine how the
simulator works before running the simulator, including:
- the device type: Server/Client
- the protocol type: Modbus TCP/RTU
- communication configurations: IP address, baudrate, etc.
- Modbus configurations: device ID etc.
- Modbus server properties:
- supported function codes
- supported registers/coils and their values
- overlapping of coil and register is supported
- support user defined server behavior triggered by register/coil writes:
With this feature enabled: YAMS will share the register/coil data with a user program via data (yaml) files.
Each time a register/coil is updated, the user specified program will be invoked to update the register/coil data
based on user-defined logic, as long as the external program writes the new data back to the files, YAMS will
pick up the new data and continue running.
- Modbus client behaviors:
- requests to send to server(s)
- support repeated request (single/multi request repeat)
- support predefined delay before a request
- Human friendly UI:
- flexible YAML based configuration/request organization
- supports verbose mode showing more details across the wire
- supports print-out of request/response indexes
- set and show measurements in its own type: 32-bit float for example
To support quick testing, Oneshot mode is provided so that one can run YAMS with only arguments from command line,
though it is recommended to run with YAML configuration files to make the most out of YAMS.
Install
- Make sure Cargo is installed. See the install page for details.
- Install YAMS by
cargo install yams
.
Quick Demo:
DEMO
Configurable Items
See YAML based Configurations
Todo: