OPC Expert with Python

Effortless OPC Integration for Python Applications with Real-Time Data Access and Control

OPC Expert with Python is a powerful, lightweight tool that connects Python apps to industrial data quickly. It allows you to read live values, write setpoints, and access historical trends using a simple REST API and clean JSON—no drivers or custom libraries are required.

It supports OPC Classic, OPC UA, MQTT, and Modbus right out of the box. Run it on any platform—from Windows to Raspberry Pi—and generate Python code automatically to get started in minutes. It is perfect for automation, analytics, and IoT projects.

Specifications

REST API for Python Integration

Communicate with OPC servers directly from your Python application using simple HTTP calls—there is no need for OPC-specific SDKs or wrappers.

Automatic Python Code Generation

Skip the boilerplate—OPC Expert generates working Python snippets for read, write, and trend commands, saving time and reducing errors.

Real-Time Read and Write Access

Instantly read live process values or write setpoints to control your systems—critical for responsive monitoring and automation.

Historical Data Access

Retrieve trend data from OPC HDA and OPC UA HA servers for reporting, analysis, and diagnostics without extra tooling.

JSON Data Format

All real-time or historical data is returned in clean, structured JSON, making it easy to consume in any Python script or data pipeline.

Cross-Platform Compatibility

It runs on anything—Windows, Linux, Android, iOS, Raspberry Pi—so you’re not tied to one OS or device type.

Built-In MQTT and Modbus Support

Acts as an MQTT broker/publisher/subscriber and Modbus master/slave, enabling complete IIoT communication out-of-the-box.

No External Drivers or Middleware

Requires zero third-party installs or dependencies. It’s self-contained, simplifying deployment in secure or restricted environments.

Compatible with OPC Classic and OPC UA

Supports legacy (OPC DA/HDA) and modern (OPC UA DA/HA) standards, so you can effortlessly bridge old and new systems.

Simple, Click-to-Configure Interface

Right-click to configure, generate code, and test connections—no scripting or config files are needed, even for complex data access.

Installing Python

OPC Expert supports all Python releases using REST API. In this specific example, we install Python on Microsoft Windows.

  • Download Python from https://www.python.org/downloads
  • Click button “Download Python”
  • Install downloaded file
  • Refer to Windows “Command Prompt” by entering “CMD” in the search menu
  • Enter the following text and press “Enter” on your keyboard

py -3 -m pip install requests

  • To run Python IDLE, find it in Windows Start menu under “Python”

After completing above steps, Python will be ready for OPC Expert

Automatic Code Generation

OPC Expert can automatically generate Python code snippets. You can right-click an item and follow the right-click menu as below. You will then be able to paste the text into your Python environment. You can use this with any Python environment.

The example below illustrates how to automatically generate Python code using OPC Expert:

  • Run OPC Expert (pay attention to the version number in the caption bar to ensure you have the latest release)
  • Ensure to setup OPC Expert’s REST API server by referring to the main menu and selecting option (Tools -> Servers & Services)
  • Ensure to check “OPC Expert UA server” and “REST API server” as below (this will set both up as Windows services) and click button “OK”
  • In OPC Expert, expand “This Computer” and note you are able to see your OPC servers as well as REST API server.
  • Subscribe to an item using OPC Expert
  • Test your setup by right-click above item and selecting “Trend” from right-click menu
  • If you see a trend on the desktop, OPC Expert’s REST API server is working well
  • To generate the Python code snippet, right-click the item, and from the right-click menu, select (REST API Command -> Generate Code Snippet -> Read -> Python) and notice other languages are available as well such as C#, Java, Javascript, VBA, etc)

Python code will now be in Windows Clipboard, you will now have to paste it into Python IDLE as follows:

  • Run Python IDLE from Start menu by entering “IDLE” into Search
  • In Python IDLE main menu, select option (File -> New File)
  • Paste Clipboard contents into the new window
  • In main menu, select option (File -> Save) and give the file a name (“Sample.py” in the example below)
  • In main menu, select option (Run -> Run Module)
  • Python will run (execute) the code above and show something similar to the image below

Technical Walkthrough