This project presents an advanced industrial simulator built on the OPC-UA (Open Platform Communications Unified Architecture) protocol. Leveraging Python libraries and modern web technologies, the simulator combines real-time data exchange, process automation, and visualization. This tool serves as an innovative platform for research, training, and development within the Industry 4.0 paradigm.
-
OPC-UA Server-Based Simulation
A comprehensive server simulates an industrial plant with chemical reactors, allowing real-time data exchange and process control. -
Interactive SCADA Dashboard
A web-based HMI (Human-Machine Interface) for monitoring and controlling process parameters and actuators. -
API-Based Real-Time Updates
The dashboard dynamically retrieves updated process data via API calls, eliminating the need for page reloads. -
Automatic and Manual Operation Modes
Users can switch between automatic and manual operation modes for reactors. Manual interventions are allowed even in automatic mode. -
Extensive Control Options
Real-time control of actuators (valves, agitators, heaters) and parameters (e.g., agitator speed) directly through the dashboard. -
Responsive Design
Optimized for devices of all sizes, the dashboard ensures accessibility on desktops, tablets, and mobile devices.
- Simulate an industrial plant using an OPC-UA server to handle real-time data exchange and process control.
- Build a SCADA dashboard for process supervision, automation, and manual intervention.
- Integrate API-based updates for seamless real-time visualization of process data.
- Enable dynamic toggling between automatic and manual operation modes.
- Provide tools for debugging, data analysis, and traffic monitoring.
- Backend:
python-opcua
: Implements the OPC-UA server for simulation and real-time communication.Flask
: Hosts the SCADA dashboard and API endpoints.
- Frontend:
- HTML/CSS/JavaScript: Builds the dynamic and interactive dashboard.
- Fetch API: Periodically updates dashboard data without reloading.
- Additional Tools:
- Tools for OPC-UA node scanning, enumeration, and traffic monitoring.
-
OPC-UA Server (
serverB.py
)- Simulates the behavior of chemical plant reactors.
- Models process parameters and actuator states:
- Temperature, pressure, level.
- Actuator states: valves, agitators, heaters.
- Exposes real-time data via OPC-UA nodes.
-
SCADA Dashboard (
dashboard.html
,hmi_server_autoB_api.py
)- Interactive HMI for monitoring and controlling the plant.
- Displays real-time process variables (e.g., temperature, pressure).
- Provides control options for actuators and toggling between operating modes.
- Uses an API (
/api/reattori
) for real-time updates.
-
Operation Modes
- Automatic Mode: Reactors operate autonomously based on predefined cycles.
- Manual Mode: Operators can override automatic controls and directly intervene in process parameters and actuators.
git clone <repository-url>
cd <repository-folder>
Install Python dependencies using the provided requirements.txt
file:
pip install -r requirements.txt
Run the OPC-UA server simulation:
python serverB.py
Launch the Flask-based SCADA dashboard:
python hmi_server_autoB_api.py
Open a web browser and navigate to:
http://localhost:5000
-
Real-Time Monitoring
The dashboard fetches updated process data every 2 seconds from the/api/reattori
endpoint, displaying key parameters and actuator states. -
Automatic and Manual Modes
- Automatic mode executes pre-defined cycles.
- Manual mode allows operators to intervene and override controls.
-
Actuator Control
- Start/stop actuators such as valves, agitators, and heaters.
- Adjust parameters like agitator speed (10–300 RPM).
- Toggle actuator states and operating modes via intuitive controls.
-
Dynamic Styling
The dashboard visually highlights operational states (e.g., active agitators or heating systems) using dynamic CSS.
serverB.py
: Implements the OPC-UA server. Handles simulation of reactors and real-time updates.hmi_server_autoB_api.py
: Hosts the Flask server for the SCADA dashboard and provides API endpoints.
dashboard.html
: The SCADA dashboard interface. Integrates with backend APIs for real-time updates and process control.
This simulator provides an excellent opportunity to analyze OPC-UA protocol traffic in detail. By capturing network packets on the localhost
interface using tools like Wireshark, users can study the OPC-UA communication process.
To facilitate this analysis, the OPC-UA server in this project is configured with Security Policy set to None, allowing all communication to occur in clear text. This enables researchers and students to:
- Examine the structure of OPC-UA requests and responses.
- Explore the details of the data exchange, including node attributes and variable values.
- Gain a better understanding of how the OPC-UA protocol operates in real-time applications.
This configuration is particularly useful for educational purposes, as it simplifies the process of decoding messages and analyzing protocol behavior without the additional complexity of encryption.
To perform the analysis:
- Start the OPC-UA server and dashboard as described in the setup instructions.
- Open Wireshark, select the
lo
interface (localhost), and start capturing. - Apply filters such as
opcua
ortcp.port==4840
to focus on OPC-UA traffic. - Observe and decode the clear-text messages to explore the protocol's operations in depth.
- Simulate an industrial plant using an OPC-UA server to handle real-time data exchange and process control.
- Build a SCADA dashboard for process supervision, automation, and manual intervention.
- Integrate API-based updates for seamless real-time visualization of process data.
- Enable dynamic toggling between automatic and manual operation modes.
- Provide tools for debugging, data analysis, and traffic monitoring.
-
Advanced Analytics
Add predictive analytics and machine learning models for anomaly detection and optimization. -
Expanded Process Simulation
Simulate additional equipment and process scenarios for greater flexibility. -
Data Logging and Visualization
Enable historical data logging and provide advanced visualization tools. -
Multi-User Support
Implement user roles and authentication for collaborative monitoring and control.
This project bridges the gap between academia and industry, providing a robust tool for understanding OPC-UA technologies and SCADA systems. Its flexibility and extensibility make it ideal for research, training, and development in the Industry 4.0 era.