Using sigrok-cli with an oscilloscope

From sigrok
Jump to navigation Jump to search

Oscilloscopes can be controlled using a command-line interface through Sigrok-cli. This page provides some example commands for use with the popular Hantek 6022BE USB oscilloscope. For a full list of commands, see the sigrok-cli manual.

Example sigrok-cli commands

Display the capabilities of the device attached

  sigrok-cli --driver hantek-6xxx --show

To show the options of the channel group "CH1"

  sigrok-cli --driver hantek-6xxx --channel-group CH1 --show

Example for collecting 100 samples at 1MHz

  sigrok-cli --driver hantek-6xxx --config samplerate=1m --samples 100

For collecting samples for 100 ms

  sigrok-cli --driver hantek-6xxx --time 100

For collecting 20k samples at 1MHz sample rate and save to a csv file in the sigrok-cli directory. May require admin rights depending on sigrok-cli install location.

  sigrok-cli --driver hantek-6xxx --config samplerate=1m --output-file test.csv --output-format csv --samples 20k

Note: sigrok-cli can only be used with one Hantek 6022BE device at a time.