TBS2204B driver
A TypeScript SCPI/TCP driver for Tektronix TBS2204B oscilloscopes. The
instrument's Ethernet SCPI socket uses port 4000.
import { Tbs2204bDriver } from "@stapfel/stabench-gear-tbs2204b";
const scope = new Tbs2204bDriver({ host: "10.0.5.44" });
try {
await scope.connect();
console.log(await scope.identify());
const capture = await scope.capture(["CH1", "CH2"]);
} finally {
await scope.disconnect();
}
capture() freezes acquisition for the duration of a multi-channel read and
restores the acquisition state and waveform-transfer settings afterward.
Waveform samples are scaled to volts; sample times are derived from the
instrument preamble. Captured waveforms also include a snapshot of the
instrument's channel enable/scale/position settings and horizontal
seconds-per-division. getDisplaySettings() reads the same settings without
capturing.
executeScpi(command) sends a single-line text SCPI command and returns its
response for queries. Binary waveform queries are intentionally excluded;
use capture() for waveform data.
The initial implementation uses the scope's current waveform transfer window.
It does not change vertical or horizontal display settings.
Development
Publishing
Run the meta repository's release script from the workspace root. It builds and
tests the package, stages it on npm, then commits, tags, and pushes. For the
first release under a package name, use the current version; for later
releases, pass a version bump such as patch, minor, or major:
.\.tools\release.ps1 -Project stabench-gear-tbs2204b -VersionType current
.\.tools\release.ps1 -Project stabench-gear-tbs2204b -VersionType patch
The script asks for the npm stage-only token with masked input and removes its
temporary npm configuration when it exits. Use -DryRun to check the workflow
without entering a token or staging a package. The staging CLI requires Node.js
22.9 or newer.
Staging does not publish the package publicly. After reviewing the staged
version, approve it with npx --yes npm@11 stage approve <stage-id>; npm will
require your 2FA code. You can list pending versions with
npx --yes npm@11 stage list.