This is an HMI QT application. This application is simulating the workings of an offset printing machine in HMI format, and exposes its data through Modbus registers (specifically, Modbus TCP).
If you're interested in how to use the application, refer to the User guide.
If you need to see the mapping of registers this application provides, refer to the Mappings.
Clone the repository:
git clone https://github.com/Wolkabout/offset-printing-machine-simulator-application --recurse-submodules
Run the shell script
. dependencies.sh
For this, there is also a shell script. In the root of the git, run
. build.sh
go to the out
folder, and run the app
./modbus-application
After you start the machine, you can use modpoll to read the registers. Here is an example of how to get registers, that are 0 if the machine is not running, and 1 is the machine is running.
(Read the MAPPINGS.md to find out which registers to target)
./modpoll <IP_ADDRESS> -p 2222 -c 1 -t 0 // read coil 0
./modpoll <IP_ADDRESS> -p 2222 -c 1 -t 1 // read discrete input 0
Create a xdg autostart entry by copying modbus-application.desktop into /etc/xdg/autostart/ If you don't want application to start on boot, set
X-GNOME-Autostart-enabled=false
Mostly, there are a few UI elements, that have defined listeners for machine components, and they receive the data. Next to it, inputs to the machine are also taken through UI elements. Libmodbus is handling modbus connections, and they run in a second thread, where messages that are meant to change states of machine are interpreted and handled.
This sections is for those who intend to edit the source code.
In QT Creator you need to setup the Kit to use the QT 4.8.7 version for this application. After you installed the dependencies, go to Tools/Options/Kits, and add a new one. Set the device to Local PC, device type Desktop, Compiler to use GCC, System GDB for debug, and QT 4.8.7 in PATH for Qt version. When you import the project, choose this as kit for the project.