The Modbus Simulator is essentially a Modbus Slave Device and provides a Java API for configuration and manipulation of the Device data model. It was intended to be used by the developers and is created with the integration and unit testing in mind. It can be used for manual testing, too, although there are several free Modbus simulators. It can be extended and modified in many different ways.
Deployment Models
Currently there are two versions of the simulator:
As an OSGi bundle
Standalone Java application
They are using the same implementation of the simulator under the hood, but provide different usage options:
The OSGi Bundle can run in the same, or in a different Bosch IoT Gateway Software environment. This includes running on a different machine. When used on two separate Bosch IoT Gateway Software environments, the one running the simulator can be very simplified version of the Bosch IoT Gateway Software. The benefits of the OSGi Bundle is that using this approach the simulator can be controlled programmatically, when used in the same environment and with the console commands, when used in the same or in a different Bosch IoT Gateway Software environment. The json configuration file can be loaded automatically if the System property "modbus.simulator.default.configuration" is provided and points to the absolute file path. If this approach is used, once the Bosch IoT Gateway Software server is Active, the simulator will be running and configured with the specified configuration.
The standalone version is a simple Java application that wraps the Modbus simulator. Unfortunatelly it does not provide access to the simulator API and the only way to control it is stopping the application and starting it again with different configuration. The file path to the json configuration file is provided as first argument when starting the application.
The OSGi bundle is the more sophisticated version. The standalone application can be extended to provide access to the simulator API.
Supported Modbus Methods
The simulator supports the following Modbus methods: