The Data Silo Problem in Industrial Automation
Manufacturing plants generate massive amounts of operational data—temperatures, pressures, vibration levels, production counts—all stored in SCADA systems, DCSs, and PLCs via the OPC Unified Architecture (OPC UA) protocol. This data remains locked inside proprietary HMIs and historian databases, rarely used for cross-system intelligence. Meanwhile, downtime costs run thousands of dollars per minute, and manual threshold-based alerts miss early failure signals.
Enter ASI Biont, an AI agent that speaks directly to OPC UA servers. Instead of custom middleware, dashboards, or integration platforms, you simply describe your goal in natural language. The AI writes and executes Python code (using the opcua-asyncio library) to read tags, analyze trends, and trigger actions—all through a chat interface. This article shows exactly how to connect ASI Biont to an OPC UA server, with real code, wiring-agnostic architecture, and a predictive maintenance use case.
What is OPC UA and Why Connect an AI Agent?
OPC UA (IEC 62541) is an open, platform-independent standard for industrial communication. Unlike classic OPC (DA/XML), OPC UA works over TCP/IP, supports security (X.509 certificates, encryption), and provides a browsable address space with methods, events, and historical data. Modern SCADA and DCS systems expose thousands of tags—actual sensor values, setpoints, control commands—through OPC UA servers.
Connecting an AI agent directly to OPC UA brings several advantages:
- Real-time anomaly detection – AI learns normal operating ranges and flags deviations before alarms sound.
- Cross-system correlation – Combine data from multiple OPC UA servers (e.g., line A and line B) to optimize overall equipment effectiveness (OEE).
- Automated corrective actions – Write back to control tags when conditions exceed thresholds, without human delay.
- Zero-code integration – No need for custom scripts or middleware. The AI handles protocol nuances.
ASI Biont uses the opcua-asyncio library (Python asyncua) to connect to OPC UA servers. The connection can be made directly from the cloud sandbox if the server is reachable (via VPN or public endpoint) or through an on-premise bridge when the network is isolated. The AI agent accesses OPC UA through two mechanisms:
industrial_commandtool – For quick read/write operations. Example:industrial_command(protocol='opcua', command='read_variable', params={'node_id': 'ns=2;s=Temperature'}).execute_python– For complex scripts (trend analysis, data logging, integrating with external APIs). The AI writes a Python script that runs in the sandbox with access toasyncua,requests,numpy, etc.
Real-World Scenario: Predicting Bearing Failure in a Paper Mill
A paper mill operates a DCS controlling a large drying cylinder. Key variables: steam pressure (tag ns=2;s=Steam_Pressure), bearing temperature (ns=2;s=Bearing_Temp_Left), and motor current (ns=2;s=Motor_Current). The plant historically suffers unplanned bearing failures every 3 months, costing $50,000 in lost production and repairs.
The Goal
Monitor bearing temperature continuously. If it rises 10°C above baseline within 2 minutes, automatically reduce the cylinder speed by 5% (write to ns=2;s=Speed_Setpoint) and notify the maintenance engineer via Telegram.
How the User Sets It Up
In the ASI Biont chat, the engineer types:
"Connect to OPC UA server at opc.tcp://192.168.1.100:4840 with no security. Read tag
ns=2;s=Bearing_Temp_Leftevery 5 seconds. Also readns=2;s=Bearing_Temp_Baseline(a constant tag). If temperature exceeds baseline+10, write 0.95 tons=2;s=Speed_Setpointand send a Telegram alert to my chat ID 123456 with message 'Bearing temp critical—speed reduced'. Log all data to a SQLite database for later analysis."
What the AI Actually Does
Behind the scenes, ASI Biont generates and executes a Python script (via execute_python) that:
- Connects to the OPC UA server using
asyncua. - Subscribes to data changes on the temperature tag (or polls periodically).
- Maintains a running baseline.
- When threshold is exceeded, uses
asyncuato write to the setpoint tag. - Sends a Telegram message via
requests. - Stores readings in an in-memory SQLite database (sandbox has
sqlite3).
Below is a simplified version of the generated code (actual script includes error handling and async loops):
import asyncio
import sqlite3
import time
from asyncua import Client
import requests
async def monitor():
client = Client("opc.tcp://192.168.1.100:4840")
await client.connect()
try:
# Get baseline (assumed constant)
baseline_node = client.get_node("ns=2;s=Bearing_Temp_Baseline")
baseline = await baseline_node.read_value()
temp_node = client.get_node("ns=2;s=Bearing_Temp_Left")
speed_node = client.get_node("ns=2;s=Speed_Setpoint")
conn = sqlite3.connect(":memory:")
conn.execute("CREATE TABLE temps (ts REAL, temp REAL)")
while True:
current_temp = await temp_node.read_value()
conn.execute("INSERT INTO temps VALUES (?,?)", (time.time(), current_temp))
conn.commit()
if current_temp > baseline + 10:
await speed_node.write_value(0.95)
requests.post(
f"https://api.telegram.org/bot<TOKEN>/sendMessage",
json={"chat_id": 123456, "text": "Bearing temp critical—speed reduced"}
)
await asyncio.sleep(60) # avoid repeated alerts
await asyncio.sleep(5)
finally:
await client.disconnect()
asyncio.run(monitor())
Note: The while True loop ends after 30 seconds in the sandbox by default, but the AI can set a longer runtime using the --timeout flag or use the industrial_command tool for persistent subscriptions. The actual deployment uses the industrial_command with a subscribe feature (not shown here for brevity).
Alternative: Using industrial_command for Ad-Hoc Reads
For quick checks without writing a full script, the AI leverages the industrial_command tool. Example chat command:
"Read the current value of tag
ns=2;s=Bearing_Temp_Leftfrom OPC UA server at 192.168.1.100:4840"
Internally, ASI Biont calls:
industrial_command(
protocol='opcua',
command='read_variable',
params={
'url': 'opc.tcp://192.168.1.100:4840',
'node_id': 'ns=2;s=Bearing_Temp_Left',
'username': '', # if needed
'password': ''
}
)
The tool returns the value immediately. For write operations, use command='write_variable' with value parameter.
Wiring Diagrams? Not Needed—It's All IP
Unlike serial or Modbus RTU, OPC UA runs over Ethernet. There is no physical wiring other than connecting the OPC UA server to the plant network. The ASI Biont agent connects via the internet (if the server is exposed) or through a secure tunnel. For isolated networks, the Hardware Bridge software (bridge.py) can run on a Windows PC inside the plant, forwarding OPC UA commands via WebSocket to the cloud agent. However, the recommended approach is to allow ASI Biont's cloud sandbox to reach the OPC UA server directly through a firewall rule or VPN.
Why This Beats Traditional Integration
| Aspect | Conventional Approach | With ASI Biont |
|---|---|---|
| Setup time | Days to weeks (coding, testing, deploying) | Minutes (describe intent in chat) |
| Adaptability | Requires developer for each new tag or condition | AI adjusts on the fly |
| Data persistence | Must configure external database | AI can log to SQLite, CSV, or cloud DB |
| Alerting | Separate alarm management system | AI integrates with Telegram, Slack, email |
The Bigger Picture: Connecting Any Device
ASI Biont is not limited to OPC UA. If you need to read from a Modbus RTU temperature controller, an MQTT-enabled ESP32, a Siemens S7-1200 via snap7, or a BACnet building management system, the AI writes the appropriate Python code using libraries like pymodbus, paho-mqtt, snap7, or bac0. The user only provides the connection parameters in plain English. This universal execute_python capability means no waiting for vendor support—every protocol becomes instantly connectible.
Getting Started Today
- Get your OPC UA server details – IP address, port (default 4840), security mode (None/Basic256Sha256), and node IDs of tags you want to monitor.
- Log into ASI Biont at asibiont.com.
- Start a new chat and describe your integration: "Connect to OPC UA server at 10.0.0.50:4840, read temperature tag X, and alert me if above 80°C via Telegram. My Telegram bot token is ..."
- Watch it happen – The AI writes, tests, and runs the code within seconds. You can tweak parameters or add conditions just by asking.
Predictive maintenance, automated control, and cross-system intelligence are no longer exclusive to large IT teams. With ASI Biont, any engineer can bridge OT and AI with nothing more than a chat message.
Try it now at asibiont.com and see your OPC UA data come alive.
Comments