npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rigol-dho800

v0.0.5

Published

Node.js bindings for Rigol DHO800

Readme

rigol-dho800

rigol-dho800 is a Node.js library for interfacing with Rigol DHO800 oscilloscopes using NI-VISA. It provides an easy-to-use API for configuring the oscilloscope, setting acquisition parameters, triggering, and retrieving waveform data.

The library is built on top of ni-visa and requires RsVisa to be installed. Alternatively, you can provide a custom path to a dynamic library that supports the NI-VISA standard.

Features

  • Timebase and Channel Configuration: Easily set up acquisition parameters.
  • Trigger Control: Configure edge triggering.
  • Memory Depth Selection: Adjust memory depth based on acquisition needs.
  • Waveform Acquisition: Retrieve waveform data in WORD format for high-resolution captures.
  • Automatic Conversion: Convert raw ADC values into accurate voltage readings.

Requirements

  • RsVisa or another NI-VISA compatible library.
  • Node.js 23+ (for TypeScript support and latest JS features).

Installation

Install the library via npm:

npm install rigol-dho800

Usage

Below is an example demonstrating how to connect to the oscilloscope, configure it, set up a trigger, wait for an acquisition, and retrieve waveform data:

import { VisaInstrument, VisaResourceManager } from 'ni-visa';

import { RigolDho800 } from 'rigol-dho800';

const rm = new VisaResourceManager();

try {
  console.log('Listing available VISA resources...');
  const resources = rm.listResources();
  const usbResources = resources.filter((res) => res.startsWith('USB'));
  if (!usbResources.length) {
    throw new Error('No USB resources found');
  }

  const instr = rm.open(usbResources[0]);
  try {
    await onInstrumentOpened(instr);
  } finally {
    instr.close();
  }
} catch (error) {
  console.error(error);
} finally {
  rm.close();
}

async function onInstrumentOpened(instr: VisaInstrument) {
  const scope = new RigolDho800(instr);

  scope.reset();
  scope.configureTimebase(0.001); // 1ms/div
  scope.configureChannel(1, { verticalScale: 1, probeRatio: 10 });
  scope.configureEdgeTrigger({ source: 'CHAN1', level: 1.0, slope: 'POS' });
  scope.configureMemoryDepth('100k');
  scope.wait();

  scope.singleTrigger();
  scope.wait();

  // Wait up to 5 seconds for trigger
  if (!(await scope.waitTigger(5000))) {
    throw new Error('Timeout waiting for trigger');
  }

  const { samples } = scope.readWaveform(1);
  console.log('Waveform data:', samples);
}

API Reference

RigolDho800

General Methods

  • new RigolDho800(instr: VisaInstrument): Initializes the oscilloscope instance.
  • reset(): void: Resets and clears the oscilloscope.
  • wait(): void: Blocks execution until the oscilloscope completes an operation.

Configuration Methods

  • configureTimebase(scale: number = 0.001): void: Sets the timebase scale (default: 1ms/div).
  • configureChannel(ch: number, config: Partial<RigolDho800Channel>): void: Configures a channel’s probe ratio, scale, offset, coupling, and display.
  • configureMemoryDepth(depth: string): void: Sets the oscilloscope’s memory depth (e.g., 'AUTO').
  • configureEdgeTrigger(config: RigolDho800TriggerEdge): void: Configures an edge trigger.

Acquisition & Triggering

  • singleTrigger(): void: Arms the oscilloscope for a single acquisition.
  • run(): void: Starts continuous acquisition.
  • stop(): void: Stops acquisition.
  • waitTigger(timeout: number): Promise<boolean>: Waits for a trigger event (returns false if timeout occurs).

Waveform Acquisition

  • readWaveform(ch: number): { samples: number[], params: RigolDho800WaveformParameters }
    • Retrieves waveform data from the specified channel and converts it to voltage.
  • queryWaveformParameters(): RigolDho800WaveformParameters
    • Queries the oscilloscope for waveform preamble information.
  • createWaveformXLabels(params: RigolDho800WaveformParameters, inMs = false): number[]
    • Generates time labels for the waveform data.

Custom Dynamic Library Path

If using a custom VISA library, specify the path when initializing VisaResourceManager:

const rm = new VisaResourceManager('/path/to/your/library');

Running the Examples

The example above is available in the repository. To run it:

npm install
node run start

Contributing

Contributions are welcome! If you find any issues or have suggestions, open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Support

If you have questions or need assistance, open an issue on the GitHub repository.