Skip to content

A configuration tool designed to simplify the creation of PLC4X Kafka connectors with an interactive interface, featuring automatic discovery of OPC UA, Modbus, and S7 nodes.

Notifications You must be signed in to change notification settings

gustavoschewinski/plc4x-kafka-tool

Repository files navigation

README: Smart Configuration Utility

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.

Build during an internship at MTU AeroEngines in Digilab.

Key Features

  • Node Discovery
    Identify nodes by IP for:
    • OPC UA (including security protocols, credentials, client/server certificates)
    • S7
    • Modbus
  • PLC4X Configuration Generation
    Create config files automatically for easy integration with PLC4X.

Getting Started

1. Running with Python

  1. Navigate to source/pyqt5/ and locate main.py.

  2. (Optional) Create a conda environment (suggested for cleanliness):

    conda create -f environment.yml
  3. Activate it:

    conda activate plc4x_config_tool
  4. Run the tool:

    python main.py

2. Running with Executable

Inside source/pyqt5/dist/, you’ll find standalone executables. Choose the one for your operating system and launch it directly.

Usage Instructions

  1. Load or Start Fresh After opening the tool, you can Load config if you already have a configuration file, or begin from scratch.

  2. Global Configurations

Provide:

  • Source name: the Kafka connector name
  • Bootstrap server: the Kafka server’s IP address
  • Topic: the existing or new Kafka topic
  1. Connection Setup

Pick between:

  • Production Connection

Used in Kafka. If certificates are required (for OPC UA security, for example), specify the production-relevant paths here (not your local paths).

  • Scrape Connection

Used locally. Include local paths for certificates if security is enabled for OPC UA. 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.

  1. Test the Connection

Click “Test” to verify settings. A successful test begins the node discovery phase.

  1. Create a Job

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.

  1. Generate the Config File

When all tags are set, generate a JSON file that you can immediately use with Kafka. Enjoy!

Code Structure

  • main.py

Controls the main user interface, orchestrating the different modules.

  • connection_string_builder.py

Pops up to build connection strings for each protocol (OPC UA, S7, Modbus), whether in production or locally.

  • OPC UA Modules

    • opcua_client.py: Connects to the target IP with or without security settings.
    • opcua_worker.py: Handles asynchronous discovery tasks.
  • S7 Modules

    • s7_client.py: Fetches nodes securely or non-securely.
    • s7_worker.py: Performs asynchronous node discovery.
  • Modbus Modules

    • modbus_client.py: Connects and retrieves nodes using specified security settings.
    • modbus_worker.py: Runs node discovery asynchronously.

About

A configuration tool designed to simplify the creation of PLC4X Kafka connectors with an interactive interface, featuring automatic discovery of OPC UA, Modbus, and S7 nodes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published