On this page
Session recording and replay
A fault that shows up once every few hours is hard to hand over. Session recording writes every byte every connection sends and receives into a .spulog file, with the time it happened; session replay plays that file back later in a window of its own, at the pace it was recorded — on the same computer or on a colleague's at the office, with no device and no port attached.
A typical case: the engineer on site starts a recording and leaves it running. When the device misbehaves, they press F9 to mark the moment and carry on. Back at the office, someone opens the file, jumps to the bookmark and watches the lead-up to the fault as often as needed, at any speed. Recording is included in Free, so a customer can capture the problem and send it without buying anything.
Everything starts in the main window's File and Tools menus:
- File → Record Session… starts a recording; while one runs, the same item reads Stop Recording;
- File → Add Bookmark (F9) marks the current moment on the focused connection;
- File → Open Recording… opens a
.spulogrecording, or a JSON Lines file saved by File → Export Session…, in a replay window; - File → Replay This Session replays what SPU holds from this session, without saving anything first;
- Tools → Trigger Capture… waits for a fault on a connection and saves the moments around it on its own; see Trigger capture.
A replay only draws. Replayed data never goes to a port, never triggers an auto reply and never enters a bridge, so a recording can be replayed while the same device is connected.
Recording on site
File → Record Session… asks for four things:
- File: where to write the recording. It suggests
SPU-<date>-<time>.spuloginDocuments/SPU Recordingsand remembers the folder you choose. An earlier recording is never replaced without asking. - Start with what SPU already holds from this session: on by default. SPU keeps each connection's recent traffic in memory (2 to 8 MB per connection, 32 MB in all), and the box says how much it holds, for example "2 ports, 3.21 MiB since 13:40". With it on, the fault you saw just before you thought of recording is in the file too.
- Start a new file every 100 MB: a long recording is split into parts (
…-part2.spulog,…-part3.spulog, …), each between 16 and 2048 MB. When a replay reaches the end of a part, a line offers to Open the next one. - Include each port's decoder setup, so the file opens decoded: on by default. The file then carries each connection's decoder, the frame template it uses, its Modbus register map and the plot with its monitored fields, so it opens decoded on any computer; see Opened decoded. Untick it for a recording that goes to someone who should not see how your protocol is described.
Click Start Recording. Every connection in the window is recorded, both directions merged in time order, until you stop. Connections added later join in; a change of settings, a port opening or closing and a connection leaving the window are noted in the file. Opening another project does not stop the recording, and closing SPU ends it properly.
While it runs, the status bar shows a red ● REC with the length and size so far. Click it for Stop Recording, Add Bookmark, Show in Folder and Replay This Recording, which opens the file as written so far.
The file is written every 250 ms. If SPU or the computer stops unexpectedly, at most the last fraction of a second is lost and the file still opens; the replay window says that the recording ends mid-line. If a write fails — a full disk, a USB drive pulled out — the recording stops at once and says why, and what was written stays readable. In the Mac App Store version the recording is always one file, and the save panel asks where to put it each time.
F9 marks the moment on the focused connection. Nothing pops up and there is nothing to type, so the moment is not lost; the bookmarks are called Bookmark 1, Bookmark 2, … and are named later in the replay window. F9 works when nothing is being recorded too: the bookmark stays with the session and goes into a recording started later with "Start with what SPU already holds", into Replay This Session and, as a note, into the connection's session export and diagnostic pack.
Trigger capture
When nobody can sit and watch a device for hours, let SPU wait for the fault instead. Tools → Trigger Capture… (also in the receive view's right-click menu) arms the focused connection. When the first of the conditions you chose happens, SPU saves that connection's traffic from shortly before to shortly after it in a .spulog of its own, with a bookmark at the moment it happened.
Turn on one condition or several; whichever happens first fires:
- Data matches: received data, sent data or either matches a pattern — text, hex (
??is any byte), wildcard or regular expression, written as in Auto reply. A pattern still matches when it arrives in pieces, and each occurrence fires once. - Checksum error: the protocol decoder finds a frame with a wrong CRC, LRC or checksum — Modbus RTU and ASCII, or a frame template with a checksum (see Protocol decode view). While the capture is armed, decoding goes on with the Protocol Decode panel hidden. When the connection cannot see checksum errors — no decoder, Modbus TCP, a template without a checksum, or the SPU Free decoding time used up — the dialog warns, and the strip says that the condition cannot fire and why.
- Connection lost (not when you stop the port): the serial port disappears, a TCP or RFC 2217 client or a Live Relay connection drops after it was up, or a client leaves SPU's TCP server. A dial or reconnect attempt that fails does not count, and UDP has no connection to lose.
- A sequence step fails and A script fails: an expected reply does not come in time, the port refuses the data, or a script fails. A run that you stop, or that ends because the connection went or a Free limit was reached, has not failed.
- No response in time: after SPU sends data matching the request, nothing matching the response (left empty: any received byte) arrives within the time set — 10 ms to 600 s, 1000 ms by default. Sending the request again while SPU waits does not move the deadline, so a device that stops answering a fast poll is still caught. The capture fires at the deadline, with a second bookmark at the request. On a TCP server or UDP, an answer from any client counts.
Keep sets how much is saved: 1 to 300 seconds before the trigger (30 by default) and 0 to 300 seconds after it (10 by default). The time before comes from what SPU still holds of the connection in memory (2 to 8 MB per connection), so on a busy connection it can be less than you asked for.
The strip above the receive view shows where the capture stands:
- Armed: the conditions that are on, and whether SPU already holds all the seconds before a trigger that you asked for or only part of them. It turns amber when they are short, or when a condition cannot fire. Disarm and Settings… are on the strip.
- Triggered: when, and by what; how many seconds are still to be saved, and how many more hits have come. Stop Now ends the capture early and keeps what it has.
- Saved: the file and its size, whether the time before the trigger is complete or how much of it was still held, and the events missed after the trigger, if any. Replay opens it; Show in Folder and Arm Again are next to it.
- Failed: why, for example a folder that cannot be written; and, while the file exists, that what was written can still be read and replayed.
One arming gives one capture: once it is saved, SPU stops watching until you click Arm Again. Hits while it is saving are counted, and the first 20 get a bookmark of their own (Trigger again: …). A capture file holds at most 256 MB; one that reaches the limit ends there and says so. The trigger bookmark also goes into the session's bookmarks and into a recording that is running at the same time, and a line in the receive view marks the moment. Nothing waits on a dialog, so an unattended capture never gets stuck.
Captures are named SPU-capture-<connection>-<date>-<time>.spulog and never replace a file. They go to the Record Session folder (Documents/SPU Recordings unless you changed it) or to the folder chosen with Change…. In the Mac App Store version they stay inside SPU's own folder on the Mac: open one with Replay, and use File → Save a Copy… in the replay window to keep it anywhere. The settings are saved with the connection in the .spu project; whether it is armed is not, so SPU never starts capturing by itself after a restart. When not all the time before the trigger was still held, the replay window says how much of it the file has.
Like a recording, a capture carries the connection's decoder setup; the dialog has the same Include the port's decoder setup box, and turning it off in either dialog turns it off in both. A capture opens in the replay window at its trigger bookmark, with the lead-up drawn above it. One fired by a checksum error also opens the Protocol Decode panel, even if it was hidden while armed; F8 then scans the capture and goes to the damaged frame (see Scanning the whole recording), and Bookmarks → Go to Trigger returns to the trigger.
The replay window
File → Open Recording… opens the recording in a window of its own. Several can be open at once, one per window, and they close with SPU. A large file is read once, with a progress bar; after that any moment in it can be reached straight away.
Each connection in the recording gets a view, side by side; View → Arrange Vertically stacks them. The first four are shown, and View → Ports shows or hides each one. A view's title gives the port and its settings as they were at the playhead.
Each view has its own View ▾ menu: Received and Sent as Hex or Text, Received Encoding and Sent Encoding, Timestamps, Show Sent Data, Zoom In, Zoom Out and Reset Zoom — and two panels that replay on the recording's clock:
- Plot draws the numbers in the data as curves, spaced as they arrived; see Real-time plot;
- Protocol Decode lists the traffic as frames, with the round-trip times of the original; see Protocol decode view. It starts with the decoder the connection had when it was recorded (see Opened decoded); otherwise choose one, from the decoders and the frame templates of the main window.
Right-click in a view for Copy Selection As (C array, hex dump or hex bytes), Save Selection As…, Find… within that view, and Add Bookmark Here.
Under the timeline, a line gives the time at the playhead, the time since the start against the whole length (+00:12:34.567 / 01:05:00.000) and which event of how many is on screen. Times are shown in this computer's time zone; when the recording was made in another one, hovering over the time says where, for example "Recorded in Asia/Shanghai (UTC+08:00)".
Opened decoded
A recording made by SPU 6.6.9 or later remembers, for each connection, the decoder, the frame template it used, the Modbus register map and the plot with its monitored fields. The replay window sets each view up that way before the first byte is drawn, so a colleague who has never seen your protocol gets the same frames, register names and curves that you had. When decoding was switched on part way through the recording, the setup from that moment is used.
- A recorded frame template takes the place of the library's template of the same name, at the top of the list, in that replay window only: the main window's templates are not changed, and SPU Free, which decodes with the first template, decodes with it too.
- A file recorded with Include each port's decoder setup turned off names only a built-in Modbus decoder, if one was used; a frame template, a register map and the plot are left out.
- Older recordings, and older versions of SPU opening newer recordings, replay as before, undecoded until a decoder is chosen.
Playing it back
The toolbar holds Go to Start, Step Back, Play / Pause and Step Forward, then:
- Speed: 0.25x, 0.5x, 1x, 2x, 5x, 10x, 100x or Fastest. At 1x the data appears with the gaps it had on the wire. When the views cannot keep up — 100x on a busy line — the status bar says so and the data is shown as fast as it can be.
- Skip gaps longer than 5 s: on by default. Any silence longer than this plays as that many seconds (1 to 60), so an hour spent waiting for a fault does not have to be sat through again. Turn it off to keep every gap as it was. The speed and this setting are remembered.
The timeline shows how busy the traffic was across the whole recording, the bookmarks as marks above it, and the playhead. Click anywhere to go there; drag to scrub, with the time following the mouse, and release to go. Hover over a mark for the bookmark's name and time; click it to jump. Playback → Go to Time… goes to a clock time, to the millisecond.
After a jump each view is redrawn with the data that led up to that moment, so there is always context; a line -- Showing from … -- marks where the redrawn part begins. Step Forward shows the next piece of data — one read or one send — on the connections shown, and Step Back takes the last one away again.
| Key | In the replay window |
|---|---|
| Space | Play / Pause |
. and , |
Step Forward / Step Back |
| Home | Go to Start |
| Ctrl+G | Go to Time… |
| Ctrl+Shift+F | Find in Recording |
| F9 | Add Bookmark at the playhead |
] and [ |
Next Bookmark / Previous Bookmark |
| F8 and Shift+F8 | Next Problem Frame / Previous Problem Frame |
| Ctrl+S | Save Bookmarks |
| F5 | Reload: read what a growing file has added |
| F11 | Full Screen |
| Ctrl+W | Close |
On macOS, use ⌘ in place of Ctrl. Space goes to a button, box or list that has the focus, as usual.
Find in Recording
The Find in recording box on the toolbar (Playback → Find in Recording, Ctrl+Shift+F) searches the whole file, including the part not played yet, and goes straight to the match: Enter or Next match searches forward from the playhead, Shift+Enter or Previous match backward. The views are drawn up to the end of the match, and the match is highlighted.
- Text is looked for in the receive encoding of the first view shown. Tick Hex to type bytes instead, such as
48 65; Aa matches case. - It searches the connections on show, in both directions, the notes in the recording (a port closing, for example) and the bookmark names.
- A reply that arrived in two reads, as it often does on a serial line, still matches. Data from different ports, directions or TCP clients is never joined into one match.
- A large file is searched in the background, with the progress on the status bar; Esc stops it.
Find… in a view's right-click menu searches only what that view shows.
Scanning the whole recording
A replay decodes what it has played. To find every bad frame in a two-hour recording without playing it, use Decode → Scan Whole Recording (also Scan All in a decode panel and Scan Whole Recording in a view's View ▾ menu). It decodes one connection — the focused one, else the first that has a decoder — from its first byte to its last, with the decoder the connection has now. Idle gaps and request timeouts are taken from the recorded times, so the frames are those playback would give. A connection without a decoder opens its decode panel instead and asks you to choose one.
The Scan Results panel at the bottom (Decode → Show Scan Results) shows a progress bar and Cancel while it runs, then:
- the statistics: frames, frames by status, requests answered and left without a response, the round trip (minimum, average, maximum) and the frame rate; hover over the line for every count;
- Problem Frames: the checksum errors, exceptions, malformed, incomplete and unrecognized frames, and the requests nobody answered. Switch the list to All Frames for every frame; up to a million are listed, and problem frames are always listed.
Select a row, or press F8 / Shift+F8 (Next Problem / Previous Problem), and the replay goes to just after that frame and selects it in the connection's decode panel, where its fields are. F8 goes on from the playhead when no row is selected, and scans first when nothing has been scanned yet. Rescan runs again after you change the decoder or a template. Export writes the frames or the fields of the whole recording as CSV, in the same layouts as the decode panel's export (see Exporting and copying); the file is written as the scan goes, so its size is not limited by the frame table.
A scan covers one file: for a recording in parts, open each part and scan it.
Bookmarks and loops
The Bookmarks list on the right (Bookmarks → Show Bookmark List) gives each bookmark's time, port, name and note. Bookmarks come from F9 on site, from F9 in the replay window (at the playhead, on the view that has the focus) and from Add Bookmark Here in a view's right-click menu (at the line clicked).
- Double-click a Name or a Note to edit it; double-click the time or the port to jump there. Delete removes the bookmarks selected.
]and[go from one to the next. As playback passes a bookmark, it appears as a line in the view.- File → Save Bookmarks (Ctrl+S) saves them into the recording itself, so whoever gets the file gets the bookmarks. The title bar shows
*while there are unsaved changes, and closing the window asks. A file that cannot take them — read-only, still being recorded, or the temporary file of Replay This Session — keeps them through File → Save a Copy… instead.
To play one stretch over and over — for a demonstration, or to watch a fault until it makes sense — select one bookmark in the list (the stretch runs to the next bookmark) or two (the stretch between them) and click Loop Between Bookmarks. Playback goes round it until you click it again, and the stretch is shaded on the timeline. For a room, View → Full Screen (F11) and each view's zoom make it readable on a projector.
This session, and a file still being written
- File → Replay This Session replays what SPU holds in memory from this session — each connection's recent traffic — with the F9 bookmarks made in it. Nothing needs saving first: the replay is a temporary file, removed when its window closes. File → Save a Copy… keeps it as a
.spulog, bookmarks included. - A recording can be opened while it is still being written, with Replay This Recording on the REC menu or with Open Recording. File → Reload (F5) reads what has been added since, and the playhead stays where it was. Save its bookmarks once the recording has stopped, or save a copy.
Sending and exporting
- Send the file. A
.spulogholds everything the connections sent and received, their names and settings, the bookmarks saved into it and, unless you turned it off when recording, each connection's decoder setup: frame templates, register maps and field names describe your protocol. A recording in parts needs all its parts, kept together in one folder. Check what is in a recording before sending it outside your company. - Scripts can read it. A
.spulogis JSON Lines, the same format as the JSON Lines of File → Export Session (see Exporting data and the diagnostic pack). - File → Export Range… saves part of a recording as JSON Lines, CSV or Text: the loop, when one is on; else the stretch between the bookmarks selected in the list (two or more); else the whole recording — always only the connections shown.
- File → Save a Copy… writes the whole file, with its bookmarks, under another name.
Free and SPU Pro
Free covers everything needed to capture a problem and hand it over:
- recording, with parts and F9 bookmarks, with no limit on length or on how often;
- trigger capture, with no limit of its own. A capture keeps at most 300 seconds before and 300 after the trigger, so one of the default length replays in full. The checksum condition decodes the live connection, which counts toward the 120 decoding seconds like any decoding;
- opening recordings, the timeline, bookmarks (naming, notes and saving them) and Find in Recording across the whole file;
- opening a recording decoded as it was recorded, with its own frame template.
In Free, replay plays the first 10 minutes of each recording:
- the timeline shows the whole recording, with the part after 10 minutes hatched; bookmarks there are still listed, and a jump to one stops at the 10-minute mark;
- Find in Recording counts the matches after the 10 minutes without showing them;
- the 10 minutes count from the start of the recording, not of each part, so the later parts of a long recording have none of their own;
- Replay This Session takes the most recent 10 minutes of the session;
- Export Range writes the most recent 500 records of each connection in the range;
- Scan Whole Recording scans the same first 10 minutes and says where it stopped; like playback, it uses no decoding seconds. Exporting the scan's frames or fields as CSV needs SPU Pro, as in the decode panel;
- Plotting and decoding in a replay are not counted: they use none of the 120 plotting seconds or 120 decoding seconds that the live connections have each time SPU starts, so the same data is never charged twice. The limits that use nothing up still apply: the plot draws the first 2 channels, and only the first frame template decodes.
The first time playback reaches the limit, SPU says so once per session; after that a line above the views shows where the limit is, with Learn about SPU Pro.
SPU Pro replays whole recordings and everything SPU holds from the session, and Export Range writes the whole range, up to 64 MB at a time.