The trigger's four shapes, arming, forcing an acquisition and hold-off, the event cache with its replay,
compare and accumulate, and searching the buffer for a condition.Martino FerrariTrigger
The trigger watches one signal for a condition and captures a window around it. The
Shape dropdown chooses what counts as an event; the arming, hold-off, pre/post
window and Normal/Single mode are the same for all four shapes. The captured window is
frozen on screen until you re-arm.
How to reach it
The trigger button in the toolbar (t) reveals the trigger panel: the
signal, the level, the shape, the edge (rising, falling, either), the mode (Normal or
Single) and the pre-trigger share.
Arm starts watching; a arms and disarms from the keyboard.
When the pane is locked with its [edit] button — so that it states what the
trigger is set to instead of showing the controls — Arm/Disarm is in its
heading, and the trigger can be armed or disarmed without unfolding the panel. It is
offered only while trigger mode is on, because a trigger that is off has no engine to
arm.
Force takes one acquisition now, with the event window above,
without waiting for the condition to hold — for when the event you are waiting for is not
coming and you want to see what the signal is doing this instant. The capture runs out its
post-trigger share and then freezes, exactly like a latch: the marker sits at the instant
you pressed. In Normal mode the trigger goes back to waiting afterwards; in
Single mode it disarms, because one acquisition is the whole of what that mode
means either way. It needs a signal to be acquired — the trigger cannot watch one that is
switched off — and pressing it while a capture is already filling leaves that capture
alone, since it is the acquisition you asked for.
Search the buffer is at the foot of the same panel.
A held captureevent held in the status bar, the axis pinned to the event, and the
trigger marker at x = 0.
The pre-trigger share is drawn to the left of the marker.
The four shapesEdge
A crossing of the level in the chosen direction, the classic behaviour.
Pulse width
A crossing and its return, qualified by how long the excursion lasted: less than,
greater than, within or outside a pair of widths; the event is timed at the closing
edge.
Window
The signal entering or leaving a band between two levels; the panel keeps the two
levels at least one increment apart, because a zero-width band is not a band: the
condition becomes an exact float-equality test against the level, which an ordinary
signal never satisfies and a signal sitting at the level satisfies on every
transition.
Dropout
The absence of a crossing for longer than a timeout; one event per outage, re-arms
when a crossing returns.
The shape's own rows are the only ones shown; the rest are hidden, so the panel never
offers a pulse width to a window trigger.
Multiple events: keeping the last few acquisitions
multiple events decides how many of the most recent triggered acquisitions stay on
screen at once. It is 1 by default, which is the event alone — the display you get
when you ask for no persistence — and it can be raised to 8. Each older acquisition is drawn
at half the brightness of the one before it (1, 0.5, 0.25, 0.125, …), and they are all aligned
on their own trigger edge, so the pre-trigger part of the event lines up from acquisition to
acquisition and whatever changes between them — jitter, ringing, the occasional glitch — shows
as a faint ghost behind the current trace. That is what a phosphor display does with
successive sweeps.
The older acquisitions are drawn behind the current one and nothing else changes
because of them: the axis still frames the event on screen, the trigger marker still marks
its edge, and the measurements still describe the current frame. Lowering
multiple events back to 1 remembers nothing and frees the retained acquisitions
immediately.
Two things bound how many are drawn, and the panel tells you when one of them bites.
Room in the plot. Each older acquisition is an extra trace in the row that
plots its signal, so it needs a free trace slot there. A row holding four signals — the
layout the app starts with — has room for one older acquisition of each of them; a row per
signal has room for all seven.
Memory. A retained acquisition is a whole window copied out of the ring,
so persistence may hold at most as much again as the buffer (--buffer-mb) does.
On a long window at a high sample rate that bound is reached before the eighth layer.
Persistence: how often the trace has been here
persistence — the switch in the trigger panel's Advanced block — keeps
an image of the last acquisitions instead of their traces. Every acquisition is
accumulated into it, the one on screen included, so a cell's brightness means how many of them
passed through it: the sweep on screen is the brightest, the ones behind it add on top, and
where several agree the ink is brighter still. There is no stroke drawn over the image — the
acquisition on screen is its newest ink — so it fades with the rest in both modes. Each
signal is kept as its own image in that signal's own colour, so where two signals cross the same
place you see both, not one blended line. It is off by default.
Two things make it different from multiple events beside it, and the panel offers
both because they answer different questions. It never runs out of room: each signal's
image is sized to the plot on screen and capped, so a display of a thousand acquisitions costs
what a display of one costs — one image per signal, whatever the plot's trace slots, and a very
wide window does not make it grow — and there is no count to choose. And it fades, in
one of two ways — fades by picks them:
acquisitions: every acquisition keeps
per acquisition of what was there before it (0.5, the default, is the schedule a
phosphor's afterglow has: 1, 0.5, 0.25, …). The display then shows the last few sweeps
whatever the trigger rate.
time: the image fades by time constant s as the display runs —
one constant is the time for it to fall to a third of its ink — so a slow trigger leaves
faint sweeps and a fast one leaves bright ones, and the picture is the same whichever the
stream is doing.
Persistence is a trigger mode display, like the trigger itself: it is drawn while a
captured acquisition is on screen and goes away with the trigger, on a pause, and when you open
a stored waveform. Nothing about it moves the framing — the axis is still the current event's,
the older sweeps only add ink — and it reserves no space in the plot and cannot be clicked, so
it is never in the way of a cursor or a drop.
Both displays live in the trigger panel's Advanced block, together with the
trigger's other settings that are set up once and left alone.
If a depth cannot be shown in full, a notice says how many layers fit, and the panel's
tooltip carries the same rule. Persistence is a display of what has already been captured: it
changes neither what is acquired nor what is measured, and it does nothing while the trigger
is off.
The event cache, replay and compare
Every triggered acquisition is kept. Latches are written to the event cache
(~/.cache/udpscope/events/<source>/) as a .npy of the
event, a .txt of what it was, and a .bmp picture drawn from the
samples. The Events pane on the left — opened from the toolbar's
event-history button, which appears while recording is enabled, and collapsed until you
ask for it — lists the last 32 newest first (time, duration, signals, rate), each row with
its own picture beside the numbers.
Clicking a row replays it: the stored event is loaded exactly like an exported
file, without changing the layout — the rows, the colours, the window, the
cursors and the measurements stay where they are and read the stored data instead. A
replay leaves trigger mode, because a file has no edge to wait for, and the pane stays
open. Drag the pane's edge to resize it. Live goes back to the stream; the
status bar names the file until you do.
Select two or more events in the list and the two buttons under the header act on them:
Compare puts two events in two plots side by side, keeping the layout you have
— one plot per event, the axes synchronised, so zooming a row in one zooms the same row in
the other — and Accumulate overlays up to four of them in the same traces,
translucent, so where they agree the trace is brighter. Your own traces stay where they
are in both. They need events with the same signals and the same length. A single click
selects, a double click replays.
Record events, in the trigger panel with the trigger's other options, is
what decides whether anything is kept. It is off by default — nothing is written
to disk until you ask — and with it off the history button goes with it.
Search the buffer
Search the buffer, at the foot of the trigger panel and collapsed until you open
it, answers the question the trigger answers — where does this condition hold? — over
the whole retained buffer rather than at the live edge. It runs the trigger's own
evaluator over the ring in stream order, so a hit is not a level you point at: it is
an instant the trigger would have fired on, timed the way an acquisition would have
timed it. A pulse-width finding, for instance, is the closing edge of a qualifying excursion,
not the excursion itself.
The condition is the one the rest of the panel is set to — the same signal, shape, level and
options — so there is no second condition to keep in step: change the panel and the next search
asks the new question. Nothing is searched until you ask, and the status line says
not searched.
Set the condition above, then press Search. Covering the whole ring takes a
moment, and the scan runs in chunks so the stream keeps arriving while it does; the status
line counts the ground covered — scanning 1.2 s of 8.0 s, 40 found.
Stop ends a scan early and keeps the hits found so far.
Step through the hits with the arrows either side of the position readout
(3 of 40). The first next goes to the first hit, and the ends do not
wrap — a wrap from the last hit to the first would look exactly like the view not having
moved. Each step pauses on its hit, centred, exactly as the Pause button does, so
what you read is the frozen window cut around that instant; press the pause button again to
go back to the stream.
Every plot row marks the hits that fall in the window, up to sixteen of them. When more
are in view the pane says so and suggests zooming in — 16 of 38 marks shown — zoom in
to see the rest — and when the selected hit has scrolled off the window it says that
instead. A hit the live stream has since overwritten reads no longer in the buffer
beside its position.
How a scan ended is part of the answer: N found in 8.0 s when it covered the whole
ring; N found; the stream overtook the oldest samples when the producer overwrote
samples before the scan reached them, so the count is of what was left; and
N found (the limit) in the newest … when a condition that holds almost everywhere —
an edge on a noisy signal — reached the ten-thousand-hit ceiling. The last is a stop, not a
crash: a hit list nobody could navigate is not worth building.
A result describes the ring it was taken from, so it is dropped when that ring is
replaced: a new CONFIG from the source, or a change to the signal set, re-describes
the stream and clears the hits. The condition above is untouched — only the answer to it
is.
Worth knowing
Arming enables the signal if it was off, because a trigger on a signal
nobody acquires can never fire.
The pre-trigger share is a share of the display window, not of the
ring. A 2 s window at 50% captures 1 s before the edge and 1 s after.
There are four display states, and the status bar names each: armed
(watching, nothing drawn yet), capturing (the edge was accepted and the post
window is filling in view, with the marker at x = 0), event held
(the frozen capture) and disarmed. A held capture is never quietly replaced
by live data.
The first edge after arming is only accepted once the history reaches back a
full pre-trigger window, so a capture may legitimately be shorter than you asked for.
The axis is pinned to what the capture actually got. Force is the one
acquisition that skips that gate — it captures the history that exists, because "now"
is the whole of what you asked for — so on a ring that has just started filling its
left side is short even though the axis still shows only what it got.
Disarming during a capture publishes what the capture got to, so the
picture on screen at that moment stays on screen. No event fired, so the event count
does not move.
The trigger reads the stored signal — decimated and averaged — not the
wire signal. A spike narrower than one decimation group is filtered away rather than
triggering on data the buffer does not contain.
Example
A 1 Hz sine, level 0, rising, 2 s window at 50%, Single. The capture spans
[-1.000 .. 1.000] with n=20001 samples at 10 kS/s — the span
times the real rate, plus one — and the marker sits at x = 0 throughout.