Search/

Request a free quote

Downloads

PC bridge for lab instruments

We typically respond within one business day.

Some instruments need the driver from their maker on the computer, so the page cannot reach them directly. The bridge is a small Python® program that runs on the same computer, talks to the instrument through the software from its maker, and serves it to the simulator page on this computer only.

What it works with

  • Digilent® Analog Discovery 2 and Analog Discovery 3, through WaveForms
  • Analog Devices ADALM2000, through libm2k
  • NI myDAQ, ELVIS II and the USB-6000 family, through NI-DAQmx
  • Red Pitaya STEMlab 125-14 and 125-10, through its SCPI server on your lab network
  • Rigol DS1000Z and DHO scopes and Keysight InfiniiVision scopes, over USB or LAN
  • Boards with the Dreiym firmware on a USB cable, for Safari, which cannot open USB serial devices

Safety first

Low voltage only: batteries or a bench supply of 12 V or less. Never connect anything from these guides to mains (wall outlet) wiring, or to equipment that anyone depends on for safety.

  • Keep every input inside the range in the instrument manual, and join the instrument ground to the circuit ground first.
  • Bench scopes have their probe ground tied to the earth pin of the power cord. Clip it only to the circuit ground.

Install

  1. Install Python® 3.10 or later from python.org. On Windows, tick Add python.exe to PATH in the installer.
  2. Install the software from the maker of your instrument (list below) and check that the app from the maker sees the instrument.
  3. Download dreiym-bench-bridge-1.0.0.zip from this page, check its checksum and unzip it.
  4. Open a terminal in the unzipped folder and start the bridge (on macOS and Linux, type python3 instead of python):
python -m dzbridge
  1. The bridge shows a six digit pairing code in the terminal.
  2. In the simulator, open Bench, tick the safety box, choose PC bridge app and type the six digits. The browser may ask whether the page may reach apps on this device: allow it.
  3. Pick the instrument in the list. Tick Remember this computer for 30 days if you use this computer often.
  4. To stop the bridge, press Ctrl and C in the terminal.
  • dreiym-bench-bridge-1.0.0.zip 46 KB

    PC bridge source (Python® 3.10 or later, standard library only)

    SHA-256 1c0306ec8ff7e5c4e81a9e46257e42807f1c9af76fe45a5cd8efcf49af7fba7f

Software from the instrument makers

  • Analog Discovery 2 or 3: install WaveForms from Digilent®. It carries the library the bridge uses.
  • ADALM2000: install libm2k and its Python® bindings from Analog Devices.
  • NI myDAQ, ELVIS II, USB-6000: install the NI-DAQmx driver from NI, then the nidaqmx package:
python -m pip install nidaqmx
  • Rigol or Keysight scopes: install PyVISA with its pure Python® backend. On Windows, a USB scope may also need the VISA driver from the scope maker.
python -m pip install pyvisa pyvisa-py pyusb
  • Red Pitaya: start the SCPI server from the web page of the board, then give the bridge the address of the board:
python -m dzbridge --redpitaya 192.168.1.50
  • Boards on a USB cable, for Safari: install pyserial.
python -m pip install pyserial

What the bridge does and does not do

  • It listens only on this computer (127.0.0.1, port 47321) and answers only the simulator pages of this site.
  • It asks for the pairing code. After five wrong codes it stops accepting codes for a minute.
  • It serves one page at a time.
  • It cannot run programs, open files or load code from the page.
  • It turns the instrument outputs off 3 seconds after the page stops talking to it, and when the page closes.
  • It sends nothing to any other place, and it updates only when you download a new version.

Example: an RC filter

  • Analog Discovery or ADALM2000: generator W1 drives the circuit input; scope channel 1+ on the input, 2+ on the output; 1- and 2- to ground.
  • NI myDAQ: AO 0 drives the circuit input; AI 0 on the input and AI 1 on the output.
  • Bench scope: CH1 and CH2 on the points you map. Each capture is the record on the scope screen, so use Scope rather than Live.

Raspberry Pi® as a USB device

A Raspberry Pi® Zero 2 W, 4 or 5 with an ADS1115, MCP4725 or INA219 board on its header can appear on the computer like a Pico, with no network.

  1. Use Raspberry Pi® OS Bookworm or later. Copy the unzipped bridge folder to the Pi.
  2. In that folder on the Pi, run the setup script once, then reboot:
sudo bash gadget/setup-gadget.sh
  1. Connect the USB data port of the Pi to the computer: on the Zero 2 W the port marked USB, on the Pi 4 and Pi 5 the USB C power port.
  2. In Bench choose USB cable. The Pi appears in the list like a Pico.
  3. To undo the setup, run the same script with undo and reboot.
sudo bash gadget/setup-gadget.sh undo

The Pi header pins take 0 to 3.3 V and are not 5 V tolerant. A Pi 4 or Pi 5 powered from the computer port may need more current than the port gives; use a powered USB hub if it restarts.

More bench guides

Get your project started

We typically respond within one business day.

Request a free quoteor call (866) 621-6920

Newsletter

Engineering notes from Dreiym

New articles on power systems, corrosion and forensic engineering, by email when we publish. Free account included: keep your calculator work, reports and exports in one place.

Latest article: DC Arc Flash in Battery, UPS and PV Systems: How the Hazard Is Assessed

One email per new article. Unsubscribe in one click.

You are subscribed: new articles come to you by email.

Manage in My account