Trace
On this page
The Trace page records PLC signal values at a fixed cycle and plots them in real time, similar to a scope. It is the right tool when a number in the Watch Table is not enough and you need to see how a signal changes over time: rising edges, overshoot, oscillations, drift or a sequence that goes wrong once in a while.
Opening Trace
Select the Trace icon in the Activity Bar (the line-graph icon on the left edge), and the Trace page opens straight away in the editor area. The Side Bar stays as it is: whatever it showed before keeps showing, and a hidden Side Bar stays hidden. You can also run Trace: Trace from the Command Palette (Ctrl+Shift+P) or pick Trace in the View menu. Opening it again brings the same page to the front.
To record, you need a PLC connected in PLC / OPC UA / MQTT, over OPC UA or S7, or an MQTT broker connected there (see MQTT Topics). When you start a trace or browse for a signal, Trace uses that connection. If several PLCs are connected, it asks which one to use: the list shows the address, the protocol (OPC UA, S7 or MQTT) and the connection name. Two connections to the same address are numbered in the order you opened them, for example opc.tcp://192.168.0.1:4840/ (1) and (2); the number also appears in the Connection column of the signal table and in the signal names of the chart, the trigger dialog and the bit tracks. Saved recordings and configurations keep the number, so when you open one and start again, each signal goes back to the connection with its number. If none is connected, Trace tells you to open PLC / OPC UA / MQTT and connect first.
Select Connection in the toolbar (the plug icon, also Trace: Select Connection... in the Command Palette) picks another connection for the trace at any time while no trace runs. Its tooltip names the connection the trace uses now.
Adding Signals
Use the signal sidebar on the left:
- Signal
Enterin the tag field adds the signal, like Add.- Computed
In Select Signals you can pick several variables at once with Ctrl or Shift; Add reads Add 3 Signals then, and a double click or Enter adds the selection. On an S7 connection the dialog shows the blocks of the PLC (organization blocks, function blocks, functions, data blocks, user data types) with their members; pick a member, or type its symbol path, for example "DB_Conveyor".Speed.
You can also drag variables from the address space tree of the PLC / OPC UA / MQTT editor and drop them anywhere on the Trace page. When the trace has no connection yet, it takes the connection of the dragged variables. Folders are skipped; expand them and drag their variables.
A trace holds up to 64 signals. The same address can be added once per connection, so one trace can compare the same variable on two machines. While a trace runs, stop it before you add signals. The arrow at the top right of the sidebar collapses it to a narrow strip; the arrow on the strip brings it back.
MQTT Topics
A connected MQTT tab of PLC / OPC UA / MQTT appears in the connection list as MQTT with its broker. On such a connection the browse button reads Browse MQTT Topics and opens Select Signals with the topic tree of the tab, and the tag field of the + Signal form reads Topic. You can also drag topics from the topic tree, and Sparkplug B metrics from the Sparkplug tab, onto the Trace page. Trace draws the number of a message, or of one field of its JSON, as steps, and anything that is not a number as a gap. A trace starts only when a subscription of the MQTT tab covers each of its topics, and it ends when the tab disconnects or closes. The details are on the page MQTT.
Toolbar
| Control | Action |
|---|---|
| Start / Stop | Start or stop the trace |
| Mode | Continuous keeps the newest samples in a rolling window; Single Trigger captures one window around a trigger event; Repeat Trigger captures again after every trigger (see Triggers) |
| Cycle Time | How often the PLC is sampled: 1, 2, 5, 10, 20, 50, 100, 200 or 500 ms, 1, 2 or 5 s |
| Live Window | Time span kept while recording (All, or 30 s up to 1 h); a change applies at once, also while the trace runs |
| Configure Trigger | Set the trigger conditions, the pre and post trigger time and the capture limit |
| Captures | Pick one of the captures of a triggered run |
| Glitch Filter for BOOL Signals | Hide pulses shorter than a time you set in BOOL signals of a stopped recording |
| Open Recording | Open one or several saved recordings |
| Export CSV | Export the recording, a time range or a choice of signals |
| Record to File | Write every sample to a file while the trace runs |
| Import Recording from CSV or Text File | Read a CSV or text file of another tool |
| Trace Configuration | Save or load the signals and settings without samples |
| Chart Image, Print and Report | Save, copy or print the chart, or create a report |
| Undo Zoom / Redo Zoom | Step back and forward through your zoom steps |
| Pause View / Go to Now | Freeze the chart while the recording goes on, then follow the newest samples again |
| Time Axis | Label the time axis with seconds since the start, clock time or sample number |
| Show Value Badges | Show or hide the value labels at the pointer |
| One Lane per Signal | Show every signal in its own lane (on by default) or all signals in one shared chart |
| Lane Height | Small, medium or large lanes when many signals are shown |
| Measurement cursors, value cursors, snap | See Cursors |
| Toggle Measurements Panel | Statistics, automatic measurements and limits |
| Find Events, Alarms and Events | Search a recording, show the alarms recorded with it |
| Bookmarks and Notes, Views, Compare with Reference | Mark moments, keep zoom ranges, compare with another recording |
| Select Connection, Auto-Reconnect | Choose the PLC connection; resume after a lost connection |
When the editor is narrow, the toolbar wraps onto a second row. While a trace runs, Mode, Configure Trigger, Record to File and Select Connection are locked, so the settings you see are the ones the recording uses.
Status Line
The line below the signal table shows how the recording is going:
- the state with the sample count and the rate the PLC really delivers, measured from the samples,
- how the samples are read, for example "Subscription: 10 ms, controller time". When the controller grants a slower cycle than the chosen Cycle Time, the line names both, for example "Cyclic read: 100 ms (requested 10 ms), controller time", and its tooltip gives the details. The status line always shows what you get.
- on an MQTT connection "Messages: sampled every 100 ms, local time": each sample holds the last message of every signal, and messages replaced within one sample count as lost samples,
- the number of gaps and lost samples, in the warning color, when there are any,
- on the right, how long the live window holds at this rate and about how much memory it needs, for example "Holds 5 min (3000 samples), about 1.13MB".
A communication break is drawn as a break in the curve, not as a straight line across. With Auto-Reconnect on, a lost connection does not start the recording over: the samples before the drop stay, a break marks the drop, and the recording continues after the reconnect. While the connection is down, the status bar shows Trace: Waiting for Connection. The recording also continues when you connect to the same PLC again with a new connection, for example after closing and reopening PLC / OPC UA / MQTT. With two connections to the same address, the signals of each go back to a connection of their own, in the order you opened them, and the recording waits until all of them are back. If Trace cannot tell which connection a signal belongs to, the recording stops and a message says why. With Auto-Reconnect off, a closed connection ends the recording, and a message names the connection.
One Lane per Signal
The plot shows every signal in its own lane, stacked from top to bottom in the order of the signal list. Each lane is scaled to the values of its own signal, so a counter in the thousands sits next to a speed or an on/off signal and every curve stays readable. A Bool signal is a compact digital track with a filled high level.
- On the left of each lane you see its top and bottom value, in the format of the signal.
- On the right of the plot each lane carries the signal name in the signal color, with its unit, for example
Pressure [bar]. - To fix the range of a lane, enter Min Y and Max Y in the signal table.
When the lanes no longer fit, the plot shows as many as fit and a scroll bar appears on the right; the mouse wheel scrolls lane by lane and the time axis stays at the bottom. Lane Height sets how tall the lanes are at least. Click One Lane per Signal to turn the lanes off: all signals then share one chart with the axes of the scaling groups. Studio remembers your choice.
Several Diagrams and the XY Chart
The Diagram column of the signal table places a signal in Diagram 1 to Diagram 4. The Time tab stacks one diagram per number you use, with one shared time axis: zoom, pan, the cursors and the pointer act on all of them at once.
The XY tab plots one signal against another, for example the X and Y position of an axis. Choose X Signal and Y Signal, the Range (Whole Recording or Between Cursors) and Equal Scale for the same scale on both axes. During a recording the curve follows the live data. On a stopped recording the two measurement cursors appear as markers 1 and 2 on the curve; drag them along the curve, and the time chart and the table follow.
Bit Tracks
Click Show Bits as Tracks in the row of a signal to show single bits of a status word. Choose the Word Width (8, 16, 32 or 64 bit) and switch on the bits you want; bit 0 is the least significant bit. Each bit becomes a compact digital track named after the word, for example Status.3, in the same diagram as its word. Uncheck a bit to remove its track. Bit tracks are saved with the recording, and a trigger or a formula can use them.
Navigating the Chart
| Gesture | Effect |
|---|---|
| Mouse wheel over the plot | Zoom the time axis around the pointer |
Ctrl (or Shift) plus mouse wheel | Zoom the values; in the lanes only the lane under the pointer |
| Mouse wheel over an axis | Zoom only that axis |
| Drag in Rectangle Zoom mode | A wide box zooms the time, a tall box the values, a diagonal one both |
| Drag in Pan mode | Move through the recording |
| Double click | Show the whole recording again |
Undo Zoom and Redo Zoom step through your zoom steps, Fit fits the values to the visible range, Reset View shows everything.
While a trace runs, any zoom or pan pauses the view: the chart keeps the moment you looked at, while the recording goes on in the background and the status line keeps counting. Pause View does the same on purpose. On the paused view you can place cursors and read the values in the table. Go to Now follows the newest samples again.
Time Axis in the toolbar labels the axis with Relative Time (seconds since the first sample), Clock Time (the time of day of each sample, handy next to an alarm log) or Sample Number. The real start time of the recording is shown at the top left of the plot.
Overview Minimap
A compact overview of the whole recording appears beneath the plot once you stop. A shaded rectangle marks the slice you are looking at. Drag the rectangle to move, click the strip to jump there, or drag one of its end handles to narrow or widen the window.
Cursors
Show measurement cursors places the time cursors t1 and t2 in the visible range. Toggle Value Cursors adds two horizontal cursors Y1 and Y2 on one signal. While cursors are shown, a cursor bar above the chart shows:
- t1 (s) and t2 (s), Δt and 1/Δt (the frequency that matches the distance),
- the signal of the value cursors, Y1, Y2 and ΔY.
Type a position into a field and press Enter; a decimal comma works too, and the value fields read the display formats of the signal (for example 16#00FF or TRUE). Center View on Active Cursor brings the cursor into the middle of the view, Place Cursors in View puts both time cursors into the visible range. With Snap Cursors to Samples on (the default), the cursors land on recorded samples.
Drag a cursor in Cursor mode: the pointer turns into a double arrow over a time cursor and into an up-down arrow over a value cursor. Cursors also work while the trace runs. The Y(t1), Y(t2) and ΔY columns of the table show the values of every signal at the cursors.
Reading Values at the Pointer
Move the pointer over the chart and a dot marks every signal at that point in time, with a small label in the signal color showing its value and unit. Show Value Badges in the toolbar hides the labels when you want a clear view of the curves.
Measurements
Toggle Measurements Panel opens a panel below the overview with three tabs. Range chooses what they work on: Between Cursors, Visible Range or Whole Recording.
- Statistics shows per signal the number of samples, minimum, maximum, mean, RMS, peak to peak, integral, rising and falling edges, period and frequency.
- Measurements keeps up to 32 automatic measurements. Add Measurement chooses the signal, the measurement (for example Maximum, RMS, Frequency, Period per Cycle or Duty Cycle per Cycle), the range and an optional lower and upper limit. Each row shows its value and Pass or Fail, the top line the number of passed and failed measurements. For a measurement per cycle, Show Smallest Cycle, Show Largest Cycle and Show First Failing Cycle zoom to that cycle.
- Limits sets a lower and upper limit per signal. The chart draws dashed limit lines, shades the range outside and colors the curve where it leaves the limits; the tab shows the samples and the time outside and the number of excursions, and Show First Excursion zooms there.
Measurements and limits are saved with the recording. When you open a recording that carries its own measurements, they are shown for that recording; Use as My Measurements keeps them as yours.
Triggers
In Single Trigger mode the trace waits for a trigger and records one window around it. In Repeat Trigger mode it arms again after every capture and keeps all captures until Maximum Captures is reached or the Stop Condition is met.
Configure Trigger opens the trigger dialog:
- Start Condition: choose a condition and a signal. Conditions are an edge through a threshold, a BOOL that is TRUE or FALSE, becomes TRUE or FALSE or changes, a value equal to, not equal to, greater or less than a value, inside or outside a range, a bit pattern with a mask (for example
16#00FF), a TRUE or FALSE pulse shorter or longer than a width, or a signal that does not change for a timeout. Where it helps, a Hysteresis keeps noise from firing the trigger again. - Combine With: add a second condition with AND (both) or OR (either). An edge AND a level works as a gate.
- Stop Condition: ends a Repeat Trigger run when it is met.
- Capture: Pre-Trigger Time (ms) and Post-Trigger Time (ms), with the number of samples at the current cycle beside them, a Glitch Filter (ms) that ignores changes shorter than this, and Maximum Captures.
The trigger moment is a marker on the time axis, live and in saved recordings. After a triggered run, the Captures list in the toolbar holds every capture with its trigger time; pick one to show it in the chart, the table, the FFT and the export. The status line counts the captures.
Glitch Filter for BOOL Signals in the toolbar hides short pulses in BOOL signals of a stopped recording, a capture or an opened file, so a bouncing contact reads as one clean switch. The exported data stays unchanged.
Signal Table (below the plot)
Drag the border between the plot and the table to give either of them more room; double-click it to return to the default height. The columns:
- Show: hide a signal from the chart without removing it; it keeps recording.
- The drag handle: drag a row into another place, or press
Alt+Up/Alt+Down. Formulas keep pointing at the same signals. - Color, Name, Tag, and Connection when signals come from two or more PLCs.
- Formula for computed signals (the ? in the header opens Formula Help).
- Unit, Scale and Offset: the value is the raw value times Scale plus Offset, so a signal shows
barinstead of counts. The chart, the labels, the cursors, the triggers, the FFT and the export all use this value. - Format (Decimal, Hex, Binary, Bool, Scientific), Line (Linear or Step), Dash (Solid, Dashed, Dotted, Dash Dot) and Markers (None, Circle, Square, Triangle, Diamond, Cross). Dash and markers tell signals apart without color; markers appear once you zoom in far enough to see single samples.
- Min Y, Max Y, Scaling group, Diagram.
- Y(t1), Y(t2), ΔY at the cursors, Value with the newest value, and a Comment.
- Bring to Front draws one signal on top of the others in the shared chart.
While a trace runs, Scale, Offset and Formula are locked. A changed scale on a stopped or opened recording is applied to the whole recording at once. With many signals the header stays visible and the table scrolls sideways when the editor is narrow.
Scaling Groups
Scaling groups apply when One Lane per Signal is turned off. Signals in the same group share an axis:
- Main: the primary left axis (default for new signals)
- A / B / C / D: four shared right axes
- Own: a dedicated right axis per signal, colored with the signal's own color
The axis titles name the units of their signals.
Computed Signals (Formulas)
A computed signal has no PLC tag of its own. It is calculated from other signals with a formula you type into the Formula column. Formula Help lists the whole language with examples.
$0,$1,$2... refer to the rows of the signal table, counted from 0. A formula may use any other row, also computed signals, as long as the formulas do not refer to each other in a circle.- Arithmetic
+ - * / %, comparisons= <> < <= > >=, logicand,or,xor,not. Comparisons and logic give 1 or 0. - Numbers like
1.5,2e-3,16#FF,2#1010, constantspi,e,true,false. - Math functions such as
abs,sqrt,min,max,clamp,round,sin,log, andif(condition, then, else). - Bits and words:
bit(x, n),band,bor,bxor,shl,shr. - Functions over time:
deriv(x),integ(x),movavg(x, n),delay(x, n),rising(x),falling(x).ncounts samples.
Examples:
$0 * 0.5 + 1.25 # gain and offset
if($0 > 80, 1, 0) # 1 while the temperature is above 80
movavg($0, 10) # moving average over 10 samples
bit($2, 3) and not bit($2, 4) # two bits of a status word
rising($1) # 1 on every rising edge
The formula is checked while you type: an error names the position in the formula, and Add stays disabled until it is valid. A trace needs at least one PLC signal to start.
Finding a Signal
With many signals, run Trace: Focus Signal... from the Command Palette. Pick a signal and the table scrolls to its row and highlights it, and its lane scrolls into view.
Finding Events
Find Events opens a search bar above the chart. Choose the Signal and the Condition: a rising, falling or any edge through a threshold, a value above, below, equal to or not equal to a value, inside or outside a range, or any change. Press Find or Enter; Enter again goes to the next hit, Shift+Enter to the previous one. The hit list shows every hit with its time and value, small triangles mark the hits in the chart, and the view centres on the current one. The search works on a stopped or opened recording and runs again on the next one.
Alarms and Events
While a trace on an OPC UA connection runs, Studio records the alarms and events of the same connection with it. They appear as colored lines with a flag in the chart, colored by severity; hover one to read its message. Alarms and Events in the toolbar opens the list with time, severity, source, message and state; filter it by severity and select a row to jump there. Record with Trace switches the recording of alarms on or off for this trace. The events are saved with the recording.
In Settings > Trace, Record Alarms and Events sets the default, and Event Time Base places the events at the time the controller reported or at the time Studio received them, for a controller whose clock differs from this computer.
FFT
The FFT tab shows the frequency spectrum of the signals. Choose the Range (Whole Recording, Between Cursors or Visible Range), the Window, the handling of the offset (Keep DC, Remove Mean, Remove Linear Trend) and Averaging over 2 to 16 segments for a calmer spectrum. dB and Log Y change the scale, Peaks lists the five strongest frequencies of each signal and marks them in the chart. The info line shows the number of samples, the sample rate and the resolution.
Long Recordings: Record to File
For a shift or a weekend, write the recording to disk. Click Record to File (or run Trace: Record to File...), switch on Write every sample to a file while the trace runs, choose the File with Browse... and set New File After (MB) to a whole number from 1 to 40. Then press Start.
Each start writes a new file named after your file with the date and time of the start, for example press_20261115_080000.csv. A full file continues in a follow-up file (_2, _3 ...). Every file opens on its own. The Trace page itself keeps only the live window, so a long run needs no more memory than a short one. Record to File works with continuous recordings. Alarms and events that arrive during the run are written into the file as well and show again when you open it.
When the trace stops, a message names the files and offers Open Recording, which opens the whole set. A set too large to open at once offers Open Newest Files instead.
Recording in the Background
A trace keeps recording when you close the Trace page or show another editor in its place. The status bar shows Trace: 1200 Samples (or ... to File, or Waiting for Trigger) while a trace runs; click it to return to the Trace page, or use Stop Recording in its hover or Trace: Stop Recording in the Command Palette. When you open the Trace page again, the curve continues where it is.
Closing or reloading the window stops the recording, so Studio asks first. To stop a trace whenever its page closes, turn off Settings > Trace > Record In Background.
Export, Open and Import Recordings
Export CSV opens the export dialog:
- File Format: a trace recording that opens again in Studio, or a table for spreadsheets.
- Time Range: the whole recording, the visible range or the range between the cursors.
- Signals: the signals to export.
- Table Options for the spreadsheet table: column and decimal separator, time columns, and column names as signal names (with their unit, for example
Speed [rpm]) or tags.
A trace recording keeps all display settings: names, colors, formats, units and scaling, line styles, diagrams, bit tracks, formulas, limits and measurements, the view, the cursors, the trigger moment, alarms and events, bookmarks, notes and views. It still opens in a spreadsheet.
Open Recording (or Trace: Open Recording...) opens a saved recording as a stopped recording with all its settings. Select several files to join them in time order, for example the files of a long Record to File run; they need the same signals and must not overlap in time. Stop a running trace before you open a recording.
Import Recording from CSV or Text File reads the CSV or text export of another tool. Studio recognizes the separator, leading lines to skip, the header, a decimal comma and the time column; check the suggestion in the dialog, choose the time format or a fixed interval between rows, pick the signal columns and press Import.
Trace Configurations
Trace Configuration > Save Trace Configuration... saves the signals with all their settings, the cycle time, the mode, the trigger, the live window and the layout as a .json file, without samples. Load Trace Configuration... sets up the trace from such a file, for the next commissioning or another machine. Loading closes a recording that is shown, after asking.
Compare with a Reference
Compare with Reference > Compare with Recording... opens a saved recording as the reference, Use Shown Recording as Reference keeps the shown one. The reference is drawn dashed in the color of each signal over the current recording and stays while you record again, until Remove Reference.
Comparison Settings... chooses the alignment (the starts, the trigger points or cursor 1), an additional offset, a tolerance and whether the difference between the curves is shaded; differences beyond the tolerance are shaded red. Show Comparison Results... lists per signal the compared samples, the largest difference and where it is, the mean and RMS difference and the samples outside the tolerance.
Bookmarks, Notes and Views
Right-click the chart of a stopped or opened recording and choose Add Bookmark Here or Add Note Here... to mark a moment, for example where a fault started. Bookmarks and Notes in the toolbar adds entries at the cursor, lists them and steps from one to the next. They are saved with the recording.
Views keeps named zoom ranges: Save Current View... stores the visible range, the cursors, the layout and the hidden signals, Save View of the Whole Recording... a view of everything. Choosing a saved view shows and hides the signals again as they were when you saved it, and the list tells you how many signals a view hides. Mark one as Use as Standard View, and it is shown whenever the recording opens.
Images, Printing and Reports
Chart Image, Print and Report in the toolbar:
- Save Chart as Image... saves a PNG with a title line and the legend.
- Copy Chart to Clipboard pastes straight into a mail or a document.
- Print Chart... opens the print dialog with the chart on a landscape page.
- Create Report... asks for a title and writes a PDF or HTML report with the recording details, the chart, a table of the signals with minimum, maximum and mean, the cursors, bookmarks and notes, and the comparison results.
Keyboard and Screen Reader
Everything on the Trace page works by keyboard. All keys can be changed in Keyboard Shortcuts.
| Key | Action |
|---|---|
F5 / Shift+F5 | Start / stop the recording |
Ctrl+F6 / Ctrl+Shift+F6 | Next / previous region: toolbar, signals, chart, signal table |
| Arrow keys in the toolbar | Move between the controls |
Left / Right in the chart | Move the selected cursor to the previous / next sample (Shift: 10 samples) |
Home / End | First / last shown sample |
1 / 2 | Select cursor t1 / t2 |
3 / 4, Up / Down | Select value cursor Y1 / Y2 and move it |
C | Show or hide the measurement cursors |
= / - / F / 0 | Zoom in / zoom out / fit the values / reset the view |
Ctrl+Left / Ctrl+Right | Move the view |
V / I | Read the values at the cursor / read a summary of the chart |
Alt+F1 / Alt+F2 | Keyboard help / accessible view of the values |
A screen reader announces the start, the trigger and the stop of a recording, every cursor step with the values, and the shown range after a zoom. High contrast themes draw thicker lines, and colors that would be hard to read on the current theme are drawn with more contrast.
Trace in the AI Chat
You can leave a recording to the AI assistant. Ask it in the chat, for example "Trace the motor current and the speed of conveyor 1 every 10 ms" or "Record these four signals while I start the line". The assistant opens the Trace page, sets up the signals on the connection you name (OPC UA or S7, also several PLCs) and starts the recording; you see the chart run as if you had started it yourself. It can also record the signal table you prepared, with its units, scaling and computed signals. Starting a trace only reads values from the PLC, so it runs without asking you first.
The assistant can use everything described on this page: configure triggers and repeat captures, place cursors and measure, set limits and automatic measurements, zoom and pause, add bit tracks and diagrams, show the XY chart, set units, scaling and formulas, search events, run the FFT, read the alarms, compare with a reference, add bookmarks and views. It reads long recordings page by page and explains what it sees, for example how long a ramp took or where one machine cycle differs from the others.
It asks for your confirmation 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. Files go to your workspace, your Documents folder or your Desktop.
For MQTT topics and Sparkplug B metrics the assistant adds the signals and starts the recording with its MQTT tools (see MQTT Tools in the AI Chat); everything else works as described above.
Trace in the AI chat belongs to AI for PLC / OPC UA / MQTT and needs the Pro+ plan; the free trial unlocks it. A worked example is on the page OPC UA client with AI.