Command line¶
Everything the app does with a test also works without it: on a test PC
without a screen, in a script, or from a scheduled task. With the Windows
download, use benchloom-cli.exe in the same folder, with the Linux download
benchloom-cli; after pip install, the command is benchloom.
benchloom new my-test # a Lua project with the example
benchloom new my-graph --mode visual # a visual project
benchloom new my-filter --template bode # from a template (example, empty, bode)
benchloom run my-test # run it; the run folder is printed
benchloom gui # the desktop app
benchloom run prints what the test prints, then the run folder and, when the
test made checks, its verdict (PASS: 3 of 3 checks passed). Its exit code
says how the run went, for use in scripts and CI:
| Exit code | Meaning |
|---|---|
| 0 | the test ran to its end, and every check passed (or it made none) |
| 1 | a check failed, or the test failed with an error, or was stopped, or a device could not be shut down |
| 2 | Benchloom could not start the run (no such project, a plugin error) |
The run's run.json has the details: status (ok, error, stopped),
result (pass, fail, none) and shutdown, which says for each device
whether its driver shut it down (done) or reported an error doing so
(failed: …; check that its output is off). done means the driver sent its
commands without an error, not that the output was measured to be off.
benchloom gui my-test opens a project in the app.
Stop a run with Ctrl+C; the outputs are switched off as after a run in the
app. --trust-plugins allows the project's own plugins/ folder to load, now
and in later runs (why).
Instruments¶
benchloom devices # the device types the plugins provide
benchloom describe demo.psu # the commands of one, with arguments and units
benchloom discover # ports and USB instruments; sends nothing
benchloom discover --ask COM17 -v # ask a port what is on it, showing what is sent
benchloom usbgpib # xyphro UsbGpib adapters connected
benchloom usbgpib "!ver?" # a command to the adapter itself
With several adapters connected, --serial <serial number> picks the one a
command goes to.
discover --ask-all asks every serial port except Bluetooth ones, --no-idn
leaves silent GPIB instruments unasked, and --project <folder> leaves the
ports that project uses alone (on a GPIB adapter it uses, just the addresses of
its instruments). See Safety before
asking ports you do not know.
--project <folder> on devices and describe includes that project's own
plugins. devices only reads their manifests. describe loads the driver's
Python code, so, as for a run, it needs the project to be allowed already (in
the app, or by an earlier --trust-plugins), or --trust-plugins now.
Plugins¶
benchloom plugins # every plugin found, on or off
benchloom plugins search rigol # the online plugin list
benchloom plugins install rigol # a listed plugin, by id
benchloom plugins install my-plugin.zip # or a folder; --replace to update
benchloom plugins disable hp # switch off; enable switches on
benchloom plugins remove acme # an installed plugin
benchloom plugins entry my.zip --url URL # the list entry for a plugin you publish
See Writing a plugin and The plugin registry.
Linux¶
benchloom desktop-entry # Benchloom in the app menu, with its icon
benchloom desktop-entry --remove # and out again
benchloom udev-rules # udev rules for USB instruments (print)
benchloom udev-rules --group plugdev # also for that group, e.g. over SSH
desktop-entry writes benchloom.desktop and the icon to ~/.local/share
(or $XDG_DATA_HOME), for your user only. udev-rules prints rules for the
USB instruments the plugins know, the xyphro UsbGpib adapter and any USBTMC
instrument; install them as
Getting started shows.
Settings and folders¶
Benchloom keeps its settings in ~/.benchloom/: installed plugins in
plugins/, and in config.json the plugins switched off, extra plugin
folders, the projects allowed to load their own plugins, and plugin_index,
another plugin list to use. Set the environment variable BENCHLOOM_HOME to
use another folder.
benchloom --version shows the version, the copyright and the licence notice.