Skip to content

PLC / OPC UA

An OPC UA client your AI agent can operate

Browse, watch, record and write on the running controller, by hand or by asking the AI agent. It builds the watch table, records whole machine cycles as a trace or to CSV and reads the trace samples to find where a sequence goes wrong. By default, every write waits for your confirmation.

Pro · AI on the controller with Pro+ · OPC UA and S7 · TIA Portal and CODESYS

The whole client workflow, open to the agent

  • Watch tables

    Add variables from the address space, start the live updates and tune sampling per row. The agent fills and configures the same table you see.

  • Trace and Data Logger

    Record signals at a fixed cycle like a scope, or log every value change to CSV for as long as the table is live.

  • Structures and arrays

    Read a whole UDT split into its fields, write single members and nested structures, and write arrays with the array size checked first.

  • PLC / OPC UA Operator

    An agent for the running plant: it connects, observes, records, reads the trace samples and explains what it found.

Contents

AnyAutomation Studio is an agentic engineering IDE for PLC programming with TIA Portal and CODESYS, and it has an OPC UA client built in, right next to your PLC project and your code. You connect to a controller, browse its address space, watch values and record signals without switching tools. The AI agent works with the same client: it sets up the watch table, subscribes to variables, records whole machine cycles as a trace or to CSV and reads the trace samples to find where a sequence deviates. Often AI connections to OPC UA end at reading and writing single values. In Studio the agent has the whole workflow, from browsing and structured reads to recording and analysis.

Connect to the controller

Open PLC / OPC UA from the activity bar. Enter the endpoint URL, click Get Endpoints and pick the endpoint you want from the Available Endpoints table, with the security mode and policy the server offers. You sign in anonymously, with a user name and password or with a user certificate, always with access you are authorised to use. Studio connects with exactly the endpoint you selected.

Every connection gets its own tab, so you can keep several controllers open side by side, OPC UA and S7 alike. OPC UA is vendor-neutral: the client works with OPC UA servers in general and has been tested with Siemens S7-1500 controllers and with CODESYS Control. For OMRON Sysmac Studio projects, Studio also has its own OMRON support.

Browse, read and write

The address space appears as a tree in the side bar. Search it by name, look at the attributes, references and structure fields of a node, and double-click or drag variables into the watch table. A structured variable arrives as one row per member. You read and write single values, whole structures and arrays, call methods with typed arguments and edit two-dimensional arrays in a matrix view.

Watch tables and live monitoring

The watch table shows live values with status and timestamps. Subscribe starts the live updates, and the interval sets how often values arrive. For each row you can set the sampling interval, the queue size and a deadband, so slow analog values do not flood the table and fast signals are not missed. Filter the table, save the whole setup with connections and watch tables as a workspace file and load it again later, or export a snapshot as CSV.

Trace and Data Logger: record to CSV

Studio records in two ways, and both end up as CSV:

The trace records up to 8 OPC UA signals at a fixed cycle and exports the recording as CSV.
  • Data Logger: logs every change of value or status in the watch table to a CSV file, for all rows or only the selected ones. It runs as long as the live updates run, and when a file reaches the size you set, logging continues in a numbered follow-up file. It works for OPC UA and S7.
  • Trace: an oscilloscope for up to 8 OPC UA signals at a fixed cycle from 100 ms to 5 s. You get live charts, a single trigger on an edge with pre- and post-trigger samples, computed signals with derivative and integral, measurement cursors and a CSV export of the recording.

Use the Data Logger when you want every change over a long run, and the trace when you want evenly spaced samples of a few signals to compare cycle by cycle.

What the agent does on the controller

In the AI chat you pick the PLC / OPC UA Operator in the agent picker, or simply ask the main agent. The agent works in the editor you are looking at: a connection it opens becomes a tab, the rows it adds appear in the watch table, and the panels it opens show up around the editor. It can:

  • list your connections and connect to an endpoint; when a password is needed, it can ask you for it in a masked input, so the password never reaches the chat,
  • browse and search the address space and read structures split into their fields,
  • build a watch table, add a whole S7 data block in one step and tune sampling and deadbands per row,
  • watch the table for up to a minute at a time and report every value that changed, with the time of each change,
  • start and stop the Data Logger into your workspace,
  • record a trace, read the latest samples directly and export the recording as CSV,
  • write values, structure members and arrays and call methods,
  • read events, alarms and diagnostics and acknowledge or comment alarms.

Connecting, writing, starting the Data Logger, exporting a file and acknowledging alarms ask for your confirmation first. Reading, observing and starting a trace do not change the controller and run directly. The confirmation card shows what will be changed, and for writes from the watch table and on S7 connections it also says whether the target is a real controller or a PLCSIM Advanced instance. You decide: allow once, allow for the session, always allow or always deny. You choose the model freely, as everywhere in Studio: Claude, GPT, Gemini and other cloud providers, more than 20 in all, with your own key, or a local model via Ollama or LM Studio.

Find faults across machine cycles

A recording turns a vague "the line stops sometimes" into evidence. You let the agent add the relevant signals, start the Data Logger or a trace, and then run the plant through a few start and stop cycles. The agent can start these steps itself by writing commands after your confirmation, ideally on PLCSIM Advanced or another test system. Afterwards it works through the trace samples and sorts out the order of events: which signals changed together, how long a step took in each cycle and where one cycle differs from the others.

Because the recording is a plain CSV file, it stays as evidence after the session, and you can open it in any spreadsheet tool. The blog post Trace a PLC sequence to CSV and let the AI agent find the fault walks through an example.

Alarms, history and diagnostics

Panels below the editor show the Event Log, Alarms, a History Chart, a Performance run and Server Diagnostics. On S7 connections there are panels for CPU identity, protection, memory, cycle time, the diagnostic buffer and alarms. Event Log and history can be exported as CSV, by hand or by the agent.

Requirements and limits

You work with PLC / OPC UA yourself from the Pro plan. The agent on the controller, with its OPC UA, S7 and trace abilities and the PLC / OPC UA Operator, is included in Pro+ and Enterprise. The 30-day trial unlocks both. Prices are on the Studio page.

  • You connect only to controllers you are authorised to access, with your own credentials and the security settings of the server.
  • The trace records OPC UA signals, up to 8 at a time, and keeps up to 10,000 samples per recording, or as many as fit into the time window you choose. For long runs or for S7 connections, use the Data Logger.
  • Connecting, watch tables, the Data Logger and the agent work the same with a CODESYS controller and its OPC UA server. The trace has been tested on S7-1500.
  • The agent observes the watch table in steps of up to one minute. For longer sequences it starts a trace and works through its samples afterwards, or the Data Logger for you to evaluate.
  • When the agent starts the Data Logger, it writes into an open workspace folder or into a file you picked.
  • The History Chart needs a server that keeps history. CODESYS controllers keep no history, and an S7-1500 only for variables enabled for historical access; otherwise use the Data Logger or the trace.
  • CODESYS controllers accept no anonymous sign-in: connect with signing or encryption and a user of the controller.
  • Try sequences that the agent starts by writing commands on PLCSIM Advanced or another test system first.

Every step in detail is in the documentation on PLC / OPC UA, the Data Logger, the OPC UA tools in the AI chat and Trace.

Frequently asked questions

What can the AI agent do with the OPC UA client?

It connects to an endpoint, browses and searches the address space, reads and writes values, structures and arrays, builds and configures watch tables, observes value changes, records sequences with the Data Logger or the trace and works through the trace samples. It also reads events, alarms and diagnostics.

Does the agent write to my PLC without asking?

Not by default. Connecting, writing, starting the Data Logger, exporting a file and acknowledging alarms show a confirmation card first. You decide per step whether to allow it once, for the session or always, or to deny it.

Can the agent record a whole machine cycle and find a fault?

Yes. It records the relevant signals with the trace while the plant runs through its cycles, reads the trace samples and works out the order of events and the cycles that deviate.

Which controllers does the OPC UA client work with?

With OPC UA servers in general, tested with Siemens S7-1500 controllers and CODESYS Control. For Siemens S7-1200 and S7-1500 controllers there is also a native S7 connection with tags by symbol name and CPU diagnostics.

Do I need TIA Portal or CODESYS running to use the client?

No. The client connects to the controller directly. You only need the engineering tool when you also want to work on the PLC project in Studio.

Which plan includes the OPC UA client and the agent?

You use the client yourself from Pro. The agent on the controller is included in Pro+ and Enterprise. The 30-day trial unlocks both.

Where does the CSV recording end up?

The Data Logger writes into the file you choose, with numbered follow-up files when a file reaches the size you set. When the agent starts it, the file lies in an open workspace folder or is a file you picked. The trace exports its recording as a CSV file after you stop it.

Try it now

Let the agent watch your plant

Try AnyAutomation Studio free for 30 days, with every Pro+ feature including the agent on the controller. No credit card.

Free account required: sign in with your email address and a code, then the download starts.

Questions? support@anyautomation.ch