Skip to content

Commit 7d81c0f

Browse files
Initial commit
0 parents  commit 7d81c0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+76026
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__pycache__
2+
client_key.pem
3+
client_cert.pem

README.md

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# README: Smart Configuration Utility
2+
3+
Welcome to the Smart Configuration Utility! This PyQt5-based tool helps you discover OPC UA, S7, and Modbus nodes and quickly build PLC4X configuration files for use with Kafka or in a local environment.
4+
5+
Build during an internship at [MTU AeroEngines](https://www.mtu.de) in Digilab.
6+
7+
## Key Features
8+
- **Node Discovery**
9+
Identify nodes by IP for:
10+
- **OPC UA** (including security protocols, credentials, client/server certificates)
11+
- **S7**
12+
- **Modbus**
13+
- **PLC4X Configuration Generation**
14+
Create config files automatically for easy integration with PLC4X.
15+
16+
17+
## Getting Started
18+
19+
### 1. Running with Python
20+
1. Navigate to `source/pyqt5/` and locate **`main.py`**.
21+
2. (Optional) Create a conda environment (suggested for cleanliness):
22+
```bash
23+
conda create -f environment.yml
24+
```
25+
26+
3. Activate it:
27+
```bash
28+
conda activate plc4x_config_tool
29+
```
30+
31+
4. Run the tool:
32+
```bash
33+
python main.py
34+
```
35+
36+
### 2. Running with Executable
37+
38+
Inside `source/pyqt5/dist/`, you’ll find standalone executables. Choose the one for your operating system and launch it directly.
39+
40+
41+
## Usage Instructions
42+
43+
1. Load or Start Fresh
44+
After opening the tool, you can Load config if you already have a configuration file, or begin from scratch.
45+
46+
2. Global Configurations
47+
48+
Provide:
49+
- Source name: the Kafka connector name
50+
- Bootstrap server: the Kafka server’s IP address
51+
- Topic: the existing or new Kafka topic
52+
53+
3. Connection Setup
54+
55+
Pick between:
56+
57+
- Production Connection
58+
59+
Used in Kafka. If certificates are required (for OPC UA security, for example), specify the production-relevant paths here (not your local paths).
60+
61+
- Scrape Connection
62+
63+
Used locally. Include local paths for certificates if security is enabled for OPC UA.
64+
Adjust protocols (OPC UA, S7, Modbus), IPs, ports, security settings, and intervals. For OPC UA with security, you may need to enter username, password, and certificate details in the format supported by PLC4X.
65+
66+
4. Test the Connection
67+
68+
Click “Test” to verify settings. A successful test begins the node discovery phase.
69+
70+
5. Create a Job
71+
72+
Once nodes are discovered, add a new job (usually one job is enough). Give it a name and you’ll see available nodes on the left. Double-click to add them as tags, which are recognized by PLC4X.
73+
74+
6. Generate the Config File
75+
76+
When all tags are set, generate a JSON file that you can immediately use with Kafka. Enjoy!
77+
78+
## Code Structure
79+
80+
- main.py
81+
82+
Controls the main user interface, orchestrating the different modules.
83+
84+
- connection_string_builder.py
85+
86+
Pops up to build connection strings for each protocol (OPC UA, S7, Modbus), whether in production or locally.
87+
88+
- OPC UA Modules
89+
90+
- opcua_client.py: Connects to the target IP with or without security settings.
91+
- opcua_worker.py: Handles asynchronous discovery tasks.
92+
93+
- S7 Modules
94+
95+
- s7_client.py: Fetches nodes securely or non-securely.
96+
- s7_worker.py: Performs asynchronous node discovery.
97+
98+
- Modbus Modules
99+
100+
- modbus_client.py: Connects and retrieves nodes using specified security settings.
101+
- modbus_worker.py: Runs node discovery asynchronously.

0 commit comments

Comments
 (0)