HTML/JS process simulation interacting with a modbus device
This project was created for our workshop on PLC code security at DEFCON 30. The idea is to be able to "see" a physical process when developping PLC code.
To do so, a HTML/JS webpage simulates and displays the state of the process based on values gathered from a Modbus PLC. This can a real PLC or of software PLC, or even a PLC simulator:
A SCADA software can also be added for a more realistic environment. When the PLC is configured adequately, this is how it looks like:
process_simulation2.1.1.mp4
The Python 3 app relies on Flask
, atexit
, pymodbus
and json
modules
Navigate to the project folder and launch python3 -m flask run
Then navigate to http://localhost:5000 with your web browser
I tried my best to have code that is simple to read.
If you want to modify information about the PLC (IP address for example) or the coils & registers associated with the values ==> app.py
If you want to modify the simulation itself (changing the speed of the process, adding new errors...) ==> static/app.js
I would welcome any comment or suggestion on how to make it more realistic, while keeping it fairly simple
This is by far not the first attempt at simulating an industrial process :) You can look at the following alternatives / similar solutions:
- FactoryIO: A commercial 3D process simulation for PLC training
- GRFICSv2: Version 2 of the Graphical Realism Framework for Industrial Control Simulation (GRFICS) by Fortiphyd
- Virtuaplant: A simple Python project to simulates processes (now deprecated)