Skip to content

PLC Trace in Commissioning: Six Everyday Jobs

AnyAutomation7 min read

Most questions during commissioning are about time. How long does the conveyor take to reach speed? Does the pulse of the light barrier reach the PLC at all? Did the pressure settle after the last parameter change, or does it still swing? A watch table shows you the value of this moment, and the moment is gone before you have read it. A trace writes the values down at a fixed cycle and gives you a curve you can measure. In AnyAutomation Studio, the agentic engineering IDE for TIA Portal and CODESYS, the Trace page records PLC signals over OPC UA or S7 right next to your project, and the AI agent can run it for you.

The post PLC trace to CSV shows how the agent finds the cycle in which a fault starts. This one is about the everyday measurements of a commissioning day.

Set up once per machine

Connect to the controller in PLC / OPC UA with your own credentials, over OPC UA or S7. Then open Trace and add the signals: browse them in Select Signals, type an S7 symbol path such as "DB_Conveyor".Speed, or drag variables from the address space onto the Trace page. One trace holds up to 64 signals and can read them from several PLCs at once, on one time axis. That also lets you compare the same variable on two identical machines.

Give each signal a Unit, a Scale and an Offset, so the chart shows bar or rpm instead of raw counts. Then save the setup with Trace Configuration > Save Trace Configuration.... On the next machine of the same type, Load Trace Configuration... brings back every signal, the cycle time, the trigger and the layout.

Choose a Cycle Time from 1 ms to 5 s. The status line below the signal table shows the rate the controller really delivers, and when the controller grants a slower cycle than you asked for, it names both. It also counts gaps and lost samples, so you know whether a fast cycle holds before you rely on the curve.

Job 1: measure a ramp or a travel time

Start the drive and stop the trace. Show measurement cursors places t1 and t2, and the cursor bar reads Δt between the start command and the moment the speed is reached. With Snap Cursors to Samples on, the cursors sit on recorded samples, not between them.

For a question about every cycle and not just one, open Toggle Measurements Panel and use Add Measurement, for example Period per Cycle with a lower and an upper limit. Each measurement shows Pass or Fail, and Show First Failing Cycle zooms straight to the cycle that is out of range.

Job 2: catch the event you never see live

A sensor pulse that is a few milliseconds too short, or a step that waits forever for a feedback, rarely happens while you watch. Set the Mode to Single Trigger or Repeat Trigger and open Configure Trigger. Besides an edge through a threshold, the start condition can be a TRUE or FALSE pulse shorter or longer than a width, or a signal that does not change for a timeout. A second condition joined with AND works as a gate, for example "the step is active AND the feedback has not changed for 5 seconds".

Pre-Trigger Time (ms) and Post-Trigger Time (ms) decide how much you see around the event. In repeat mode, every capture lands in the Captures list with its trigger time. The trace keeps recording when you close its page or work in another editor, and the status bar shows Waiting for Trigger until something happens.

Job 3: read status words and sequences

A status word with sixteen bits is hard to read as a number. Show Bits as Tracks turns the bits you choose into compact digital tracks, like a logic analyzer, so you see which bit comes before which. A computed signal adds logic of your own, for example bit($2, 3) and not bit($2, 4) for "ready but not running". Find Events then lists every edge or every value above a threshold in the recording, with its time, and Enter steps from hit to hit.

For a motion, the XY tab plots one signal against another, for example the positions of two axes.

Job 4: find oscillation and noise

When a pressure or a speed does not settle, the Statistics tab gives minimum, maximum, mean, RMS and peak to peak between the cursors or for the whole recording. Limits draws the allowed band and counts the excursions, and Show First Excursion jumps to the first one.

The FFT tab tells you at which frequency the signal swings. Use Remove Mean or Remove Linear Trend to drop the offset, average over several segments for a calmer spectrum, and read the strongest frequencies from Peaks. A peak at the period of a pump or a mechanical part points you to the cause faster than staring at the curve.

Job 5: compare before and after a change

You changed a ramp, a filter time or a controller parameter. Did it help? Record a run before the change and keep it, then open Compare with Reference > Compare with Recording... and record again. The reference is drawn dashed over the new curve, aligned at the start, at the trigger or at cursor 1. Set a tolerance in Comparison Settings..., and differences beyond it are shaded red. Show Comparison Results... lists per signal the largest difference and where it is, the mean and the RMS difference.

Job 6: record a shift and hand over the evidence

Some faults need hours. Record to File writes every sample to a CSV file while the trace runs, for a shift or a weekend, and continues in a follow-up file when a file reaches the size you set. On an OPC UA connection, the alarms and events of the controller are recorded with the trace and appear as markers in the chart. With Auto-Reconnect on, a dropped connection leaves a gap in the curve instead of ending the recording.

Afterwards, mark the interesting moments with Bookmarks and Notes, and use Chart Image, Print and Report > Create Report... for a PDF or HTML report with the chart, the minimum, maximum and mean of each signal, the cursors, the notes and the comparison results. That is a document you can add to your commissioning records.

Leave the trace to the AI agent

Every job above also works from the chat. Ask in plain words:

"Trace the start command, the speed and the motor current of conveyor 1 every 10 ms, and tell me how long the ramp takes in each cycle."

"Trace the light barrier every 2 ms, arm a repeat trigger for pulses shorter than 20 ms, keep the captures and tell me when they happened."

"Compare this run with the reference from this morning and tell me which signals leave the tolerance."

The agent opens the Trace page, sets up the signals on the connection you name, OPC UA or S7, also on several PLCs, and starts the recording. You see the chart run as if you had started it yourself. It can set triggers and captures, place cursors and measure, set limits and automatic measurements, add bit tracks and formulas, search events, run the FFT, read the alarms and compare with a reference. It reads long recordings page by page and explains what it sees, for example how long a ramp took or where one cycle differs from the others.

A trace only reads values, so the agent starts it without asking. Before it writes a file (a CSV export, a configuration, an image, a report or a Record to File run) and before it closes a recording you are looking at, it asks for your confirmation.

Good practice and limits

  • Choose the cycle time with the shortest event in mind. A pulse shorter than the sampling cycle can fall between two samples, and the status line tells you which cycle you really get.
  • Keep one trace configuration per machine type in your workspace, so the next commissioning starts from a ready setup.
  • Alarms and events are recorded on OPC UA connections.
  • The trace has been tested on S7-1500.
  • Only connect to controllers you are authorised to access. A trace only reads values and changes nothing on the controller.

Which plan you need

You work with the trace yourself as part of PLC / OPC UA from the Pro plan. The agent that records, measures and explains for you belongs to AI for PLC / OPC UA in Pro+ and Enterprise. The 30-day trial unlocks both.

The manual describes every function on Trace, including Triggers, Measurements, Compare with a Reference and Trace in the AI chat. How the agent works with the rest of the OPC UA client is on the OPC UA client with AI page.

Try it now

Try AnyAutomation Studio free for 30 days

Try the workflows from these articles in your own TIA Portal or CODESYS project.

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

Questions? support@anyautomation.ch