PLC + ASI Biont: No-Code Industrial Automation with AI via Modbus TCP
Introduction
Industrial Programmable Logic Controllers (PLCs) are the workhorses of factories, power plants, and water treatment facilities. They run 24/7, controlling motors, valves, and sensors with rock-solid reliability. But PLCs have one big weakness: they’re isolated. Getting data out of a PLC into a cloud service or triggering actions based on external events usually requires a SCADA system, custom middleware, or a dedicated IoT gateway. That’s expensive, slow to set up, and requires specialized programming skills.
Enter ASI Biont — an AI agent that connects to PLCs over Modbus TCP without any coding on your part. You simply describe what you want (e.g., “read holding registers 100-105 every 5 seconds and alert me on Telegram if temperature exceeds 80°C”), and the AI writes the integration code on the fly. No Python scripts to maintain, no MQTT brokers to configure, no SCADA licenses to buy.
In this article, I’ll walk you through a real-world example: connecting a generic PLC (any brand that supports Modbus TCP) to ASI Biont, reading data from holding registers, controlling a digital output, and setting up an automated alarm — all through a chat conversation.
Why Modbus TCP?
Modbus TCP is the de facto standard for industrial communication. It’s supported by virtually every PLC (Siemens S7-1200, Allen-Bradley CompactLogix, Schneider M221, WAGO PFC, etc.) and runs over standard Ethernet. No special hardware or proprietary cables required. ASI Biont uses the industrial_command tool with the Modbus/TCP protocol, which under the hood calls the open-source pymodbus library. This means:
- No drivers to install on your PC.
- Works over the network — the AI runs in the cloud and connects directly to the PLC’s IP address.
- Supports all Modbus function codes: read/write holding registers, coils, discrete inputs, and input registers.
Step-by-Step Integration Example
Scenario
We have an industrial PLC (e.g., Siemens S7-1200 with firmware 4.6) at IP 192.168.1.100, configured with:
- Holding register 100: internal temperature sensor (scaled 0-100°C).
- Holding register 101: pressure (bar).
- Coil 0: motor run command (1 = start, 0 = stop).
We want ASI Biont to:
1. Read temperature and pressure every 10 seconds.
2. Log the data to a CSV file (stored in the sandbox).
3. Send a Telegram alert if temperature > 80°C.
4. Allow us to start/stop the motor via chat command.
Step 1: Describe the Task in Chat
You open ASI Biont and type:
"Connect to my PLC at 192.168.1.100 via Modbus TCP. Read holding registers 100 and 101 every 10 seconds. If temperature (register 100) exceeds 80, send me a Telegram message. Also, let me control coil 0 by saying 'start motor' or 'stop motor'."
Step 2: AI Generates and Executes the Code
ASI Biont’s AI agent takes your request and writes a Python script using pymodbus. The script runs in ASI Biont’s sandbox environment (30-second timeout per execution). Here’s what the AI might generate (simplified):
from pymodbus.client import ModbusTcpClient
import time
import csv
import os
from datetime import datetime
PLC_IP = "192.168.1.100"
PLC_PORT = 502
client = ModbusTcpClient(PLC_IP, port=PLC_PORT)
client.connect()
# Read temperature and pressure
result = client.read_holding_registers(100, 2, unit=1) # unit=1 is default slave ID
temp = result.registers[0]
pressure = result.registers[1]
# Log to CSV
with open("plc_data.csv", "a", newline="") as f:
writer = csv.writer(f)
writer.writerow([datetime.now(), temp, pressure])
# Check for alarm
if temp > 80:
# Simulate sending a Telegram message (in reality, AI would use Twilio or Telegram API)
print(f"ALERT: Temperature {temp}°C exceeds 80°C at {datetime.now()}")
print(f"Temperature: {temp}°C, Pressure: {pressure} bar")
client.close()
But wait — how does the AI keep reading every 10 seconds? The sandbox has a 30-second timeout, so a while True: loop would be killed. Instead, ASI Biont uses a scheduled task mechanism: the AI sets up a recurring Python script that runs every 10 seconds via the execute_python tool. The script runs once per invocation, reads the data, logs it, and exits. ASI Biont handles the scheduling internally.
Step 3: Controlling the Motor via Chat
To start the motor, you type:
"Start the motor"
The AI interprets this as a command to write to coil 0. It runs:
from pymodbus.client import ModbusTcpClient
client = ModbusTcpClient("192.168.1.100", port=502)
client.connect()
client.write_coil(0, True, unit=1)
client.close()
print("Motor started")
Similarly, "Stop the motor" writes False to the same coil.
How It All Works: The Architecture
| Component | Role |
|---|---|
| PLC | Industrial controller with Modbus TCP server enabled |
| ASI Biont AI | Understands natural language, generates pymodbus code, schedules tasks |
| Sandbox (Railway) | Executes the Python script with network access to the PLC |
| Telegram (or other channel) | Receives alerts and user commands |
You don’t run any bridge software on your PC for Modbus TCP — the AI connects directly from the cloud to the PLC’s IP address. Important: The PLC must be reachable from the internet (or via VPN). If your PLC is on a local network without public IP, you can use ASI Biont’s Hardware Bridge with a serial connection to the PLC via RS-232/RS-485, but Modbus TCP is simpler when network access is available.
Real-World Use Cases
1. Predictive Maintenance Alarms
A packaging plant in Germany uses a Siemens S7-1200 to monitor vibration (register 200) and temperature (register 201). ASI Biont reads these values every minute and sends an email to the maintenance team if vibration exceeds 10 mm/s for three consecutive readings. The AI also calculates a moving average and predicts when maintenance will be needed.
2. Remote Motor Control
A water pumping station uses an Allen-Bradley MicroLogix 1400. The operator controls pumps via chat: "Turn on pump 2 for 30 minutes". ASI Biont writes to the appropriate coil, starts a timer, and automatically stops the pump after 30 minutes. No SCADA workstation needed.
3. Data Logging for Compliance
A food processing facility must log oven temperature (register 300) every 5 minutes for FDA compliance. ASI Biont reads the register, appends it to a CSV file, and uploads the file to Google Drive weekly via the google-api-python-client library (available in the sandbox).
Comparison with Traditional SCADA
| Feature | Traditional SCADA | ASI Biont + PLC |
|---|---|---|
| Setup time | Days to weeks | Minutes |
| Cost | $5,000–$50,000+ | Free (agent subscription) |
| Customization | Requires developer | Natural language |
| Alerts | Fixed rules | AI can analyze trends |
| Remote access | VPN + client software | Chat on any device |
Pitfalls and How to Avoid Them
- PLC not reachable: Ensure port 502 (default Modbus TCP) is open on your firewall. Test with
telnet 192.168.1.100 502from a machine with internet access. - Unit ID mismatch: Many PLCs use unit ID 1 by default. Check your PLC’s Modbus configuration.
- Register addressing: Some PLCs use 0-based addressing (register 100 is actually address 99). The AI usually assumes 0-based unless you specify otherwise. Always clarify in your chat prompt: "Use 0-based addressing."
- Sandbox timeout: Long-running operations (like polling every second) are not possible. Use scheduled tasks with intervals ≥ 5 seconds.
- Data persistence: The sandbox filesystem is ephemeral. For permanent logging, have the AI upload data to a database (PostgreSQL, MongoDB) or cloud storage.
Why ASI Biont Beats Custom Code
You might think: "I can write a Python script myself." Sure, but consider:
- Maintenance: When the PLC firmware updates or register addresses change, you have to edit the script. With ASI Biont, you just tell the AI: "Register 100 is now temperature, register 101 is humidity." The AI updates the code instantly.
- Complex logic: Want to calculate energy consumption from power and time? The AI can write the formula. Want to send an SMS via Twilio? The AI includes the Twilio library.
- Multi-device: Connect a PLC, a temperature sensor, and a camera — all in one chat. The AI orchestrates them.
Getting Started
- Go to asibiont.com and create an account.
- Start a new chat with the AI agent.
- Describe your PLC: brand, IP address, Modbus parameters.
- Tell the AI what you want to monitor or control.
- Watch as the AI writes and runs the integration code in seconds.
No dashboard to configure, no Python IDE to install, no DevOps skills required. Just your PLC and a chat conversation.
Conclusion
Integrating a PLC with an AI agent via Modbus TCP is no longer a complex engineering project. ASI Biont makes it as simple as asking a colleague to check a sensor reading. Whether you’re a plant manager, a maintenance technician, or an automation engineer, you can now connect your industrial controller to the power of AI without writing a single line of code. Try it today at asibiont.com — your PLC is waiting.
Comments