R-testbench

R-testbench is a toolkit written in Python that allows the user to create a software remote test bench to control an actual electronic test bench remotely. It relies on the VISA protocol. The implementation is built on top of PyVISA.

Installation

Get the last version by cloning the repository:

$ git clone https://github.com/Arkh42/rtestbench
$ pip install -r rtestbench/requirements.txt

Quick start

R-testbench is provided under the rtestbench Python package. So, the first step consists in importing rtestbench.

Then, you must instantiate the manager, provided by the RTestBenchManager class.

Afterwards, you can attach any tool to the virtual test bench to start the remote control. You set up your virtual test bench as you set up an actual bench, depending on your application.

Finally, you close the test bench to stop your application properly.

That’s it!

The quick start code example follows here below:

import rtestbench

testbench = rtestbench.RTestBenchManager()
# or, alternatively
testbench = rtestbench.Manager()

instrument = testbench.attach_tool("instrument address here")

# *** your code here ***

testbench.close()

OS supported by R-testbench

R-testbench is a cross-platform python package. However, not every distribution of every OS can be tested.

Existing compatibility tests

Currently, existing tests are:

  • alpha tester;
  • GitHub, an automated workflow for continuous integration with GitHub actions;
  • Travis, an automated workflow for continuous integration with Travis CI.

Exhaustive list of supported OS

Here follows an exhaustive table of the OS and specific distribution that have been tested.

Distributions Versions Tests
Windows 10 N/A alpha tester
Windows Server 2019 CI (GitHub)
Linux Ubuntu 18.04 CI (GitHub)
16.04 CI (GitHub, Travis)
macOS 10.15 CI (GitHub)

Compatible Python versions

Currently, R-testbench is compatible with Python 3.6, 3.7 and 3.8.

Devices implemented in R-testbench

R-testbench performs automatic instrument recognition. Of course, the commands corresponding to the specific model of instrument must be implemented in the package.

What if my instrument is not implemented

Don’t worry, a generic Tool object is instantiated by the package so that you can send command and query data by passing the SCPI commands corresponding to your instrument. Once your script is working, you have two solutions:

  1. extend R-testbench your-self by creating the object corresponding to your instrument (see Contributing to R-testbench);
  2. send your script to a maintainer so that we do not have to start from scratch.

List of instruments implemented

By manufacturers

Keysight Technologies
  • B298x series of electrometers
    • B2981A
    • B2983A
    • B2985A
    • B2987A

By families of instruments

Electrometers
  • Keysight B298x series
    • B2981A
    • B2983A
    • B2985A
    • B2987A

Contributing to R-testbench

Thank you for investing your time in the R-testbench project!

To make the evolution and the history easier to read and to understand, the project follows some rules. Please read them carefully before contributing.

Commit messages

The first rule is keep it as short and simple as possible.

Summarize the main objective of the commit in one line. If a longer description is necessary, leave a blanck between the summary line and the description. Synthesize! You may explain the solution to fix an issue, a specific reason to provide a feature that was not available before, and so on.

Types of commits

Commits can be made for different goals, e.g., organizing the repository or fix a bug. To enhance the readability of the commit messages, they are organized in several categories.

All commit summary line should start if one of the keyword listed in the table below, sorted alphabetically.

KEYWORD Description Required information
CHANGE Modifies an existing feature. Reason for the change.
DOC Modifies the documentation. Part of the documentation that is created or updated.
FIX Fixes a bug or an opened issue. Reference to issue, if any. Idea/concept/solution used to fix it.
NEW Adds a new feature. Description of the proposed feature.
REPO Organizes the repository. Category of organization concerned by the commit.

Template for commit message

A typical commit message is:

KEYWORD one-word goal: summary.

Long description
(if necessary).

Examples

A one-line commit for adding a license:

REPO license: OSL v3.0