Command Line Interface Tools

The following command line tools are available in the when the optional cli dependency is installed.

pip install pybench[cli]

There are two command line tools available:

  • pybenchiio - A command line tool for interfacing with libiio devices.

  • pybench - A command line tool for querying VISA based instruments.

Keysight DMX

One of the main use cases for the CLI pybench tools is to support the Keysight Device Manager eXpert (DMX) software. The DMX software is a tool for managing and configuring Keysight instruments. The pybench CLI tool provides a way for the DMX software to communicate with pybench instruments and devices.

Since the DMX software uses single commands to perform data capture and data generation this required additional infrastructure specifically for IIO based systems. IIO based systems do not maintain persistent buffer when leveraging custom data vectors through DMA channels. Essentially, when the contexts are closed the buffers clear and the IIO based system will revert back to the DDS data generation state. To solve this problem a backend server was implemented to maintain these buffers that is controlled by the pybenchiio CLI tool. See the pybenchiio section for more information.

Reference APIs

pybenchiio

Command line interface for pybench IIO based boards

pybenchiio [OPTIONS] COMMAND [ARGS]...

Options

-u, --uri <uri>

URI of target device/board

capture-data

Capture IQ data to a file in DWTA format

PROPS is a list of property=value pairs to set device properties. These are the properties available in the pyadi-iio class interface for the device.

Example usage with ADALM-PLUTO:

pybenchiio -u ip:analog.local capture_data -f data.csv -d Pluto -c 0 -s 1024 sample_rate=1000000

pybenchiio capture-data [OPTIONS] [PROPS]...

Options

-f, --filename <filename>

Required Name of file to write data to

-d, --device <device>

Required Name of device to configure

-c, --channel <channel>

Required Channel index to capture data from. Starts from 0

-s, --samples <samples>

Required Number of samples to capture

Arguments

PROPS

Optional argument(s)

set-dds

Configure DDS

pybenchiio set-dds [OPTIONS]

Options

-f, --frequency <frequency>

Required Set the frequency of the DDS in Hz

-a, --amplitude <amplitude>

Required Set the amplitude of the DDS in 0->1

-d, --device <device>

IIO device driver name to use

-c, --channel <channel>

Required Set the channel of the DDS

-x, --complex

Use complex mode

start-server

pybenchiio start-server [OPTIONS]

Options

-h, --host <host>

Host to start the server on

-p, --port <port>

Port to start the server on

stop-server

Stop the server

pybenchiio stop-server [OPTIONS]

Options

-p, --server-port <server_port>

Port of the server

transmit-data

Transmit IQ data file to device through backend server

File must be in DWTA format, where the first two lines are sample rate and center frequency, and the rest of the lines are IQ data in the format I, Q per line.

Example usage with ADALM-PLUTO:

pybenchiio -u ip:analog.local transmit_data -f data.csv -d Pluto -c 0 sample_rate=1000000

pybenchiio transmit-data [OPTIONS] [PROPS]...

Options

-f, --filename <filename>

Required Name of file to write data to

-d, --device <device>

Required Name of device to configure

-c, --channel <channel>

Required Channel to capture data from

-s, --server-ip <server_ip>

IP address of the server

-p, --server-port <server_port>

Port of the server

Arguments

PROPS

Optional argument(s)

transmit-data-clear

Clear the transmit buffer on the server

pybenchiio transmit-data-clear [OPTIONS]

Options

-s, --server-ip <server_ip>

IP address of the server

-p, --server-port <server_port>

Port of the server


pybench

Command line interface for pybench VISA based instruments

pybench [OPTIONS] COMMAND [ARGS]...

list

List available devices

pybench list [OPTIONS]