This document has information on the MQTTspB Simulator configuration and Runtime Behavior. Below you will find more information on the requirements and supported features.
Watch a video on how to use the MQTT Simulator with Tag Provider here. |
On this page:
This simulator application comes with the default installation of product version 9.2. The executable file can be found under the ../9.2/MQTTspBSimulator.exe directory.
Make sure to execute the file from inside this folder to ensure all dependencies are satisfied.
The following features are supported:
The Simulator is Write-Only! You will not be able to subscribe to any topic; only publishing is allowed. |
The DeviceID attributes can be customized using the configuration file, MQTTspBSimulator.exe.config. This file uses an XML syntax that is parsed during the application initialization.
This means that any change that is made requires the application to be restarted in order to be applied.
The file syntax is illustrated below.
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Name" value="Type=string;Sampling=constant;range=;defaultValue=Barcelona" /> <add key="State" value="Type=int;Sampling=variable;range=0,10;defaultValue=" /> <add key="Longitude" value="Type=double;Sampling=constant;range=1.56,2.49;defaultValue=" /> <add key="Latitude" value="Type=double;Sampling=constant;range=41.34,41.71;defaultValue=" /> <add key="PanelPower" value="Type=double;Sampling=variable;range=200,500;defaultValue=" /> <add key="PanelVoltage" value="Type=double;Sampling=variable;range=-220,220;defaultValue=" /> <add key="PanelCurrent" value="Type=double;Sampling=variable;range=-10,10;defaultValue=" /> <add key="TemperaturePort" value="Type=double;Sampling=variable;range=15,35;defaultValue=" /> </appSettings> </configuration> |
Each AppSetting entry have two parameters, Key and Value.
The file name must be the same as the executable file. If one is changed, the other must be as well. |
The Simulator is divided in three tabs: Connection String Parameters, Simulation Settings and Runtime Simulation Settings. More information on each one is available below.
The Simulator does not support SSL Protocols. |
E.g.: NodeId 1, NodeId 2 ... NodeId N.
E.g.: DeviceID 1, DeviceID 2 ... DeviceID N.
Additional Information:
Solution for when the configurations from the XML MQTTspBSimulator-Demo9.2.exe.config are applied and the tags do not appear.
When you are using the demo project fsAssetsMonitor via the MQTTspB Simulator, it's necessary that the file "MQTTspBSimulator-Demo9.2.exe.config" be copied and pasted into the folder along with the project "fxAssetsMonitor.tproj". Upon opening the project, you can verify in Edit>Scripts>Classes, within the class CheckStatus that this class contains a method called StartMqttSimulator(). When running the project this method will fetch some arguments and together with the .config file, and from these configured arguments, the MQTTSpb Simulator will be called to run the values that are configured within this .config. When running the project this will be done automatically, without needing to manually open the simulator.
The original file "MQTTspBSimulator.exe.config" within the product's installation folder comes with default values for simulation and can be modified to generate new simulation values. To add new attributes, you can follow the pattern of the other attributes in the file.