[go: up one dir, main page]

Skip to content
/ ebench Public

An extensible toolset to control e-instruments

Notifications You must be signed in to change notification settings

jarjuk/ebench

Repository files navigation

ebench - An extensible toolset to control e-instruments $Release:0.0.12-SNAPSHOT$

Problem Statement

  • As an electronics hobbyist need to control diverse electronic instruments
    • to set up instruments in various configurations
    • to collect data in projects for further processing and documentation
  • with the objective to reap benefits
    • ab initio by having configuration setups and data collection actions documented
    • and thenceforth being able to automate setup construction and data collection with the help of scripts
  • with gently sloping adoption curve
    • where instruments can be operated using interactive interface
    • or command line interface
    • and individual tools can be configured to work together in user and API interfaces
    • allowing tool sessions to be exported for scripting for advanced use
  • be prepared for implementation as on-going work to integrate tools created by
    • fellow hobbyists
    • future me
  • to build an electronic instrumentation system characterized by
    • strict focus on instrument setup and data collection
    • ease of use
    • low maintenance
    • high flexibility
    • and high service value

Viability Study in ebench -Toolset

The vision presented in the previous chapter is abstract and it must be materialized for implementation. Meet ebench -toolset, a viability study, which, at this time, comprises following three tools:

  • ebMenu : Menu application using YAML configuration to integrate separate instrument controllers together
  • ebUnit : Tool to control UNIT-T UTG962/932 Waveform generator
  • ebRigol : Tool to control Rigol MSO1104Z osciloscope

ebench -toolset builds on the core idea of providing yet another command line processing framework with a set of infrastructure services.

The objective of the viability study is to validate, whether the benefits of the framework to be able

  • to implement interactive, command line and API interfaces in one go, and
  • to configure user interfaces and API interface of otherwise separate tools together

balance the downside of

  • the need to learn and to use yet another framework, and
  • the lack of features in a generic framework, when compared to a bespoken solution

ebench - uses Python -language and builds on existing libraries for instrument integration and command line configuration.

List of features mainained in FEATURES.org

ebMenu

ebMenu: Menu of ebench toolset

Usage: ebMenu [options] [commands and parameters] 

Commands:

        skooppi  : Rigol osciloscope control
           sgen  : UNIT-T UTG962 signal generator control
       counters  : Read hello.py counters
   counters2csv  : Save hello.py counters to example.csv
              q  : Exit
----------   Other    ----------
              ?  : List commands
             ??  : List command parameters
              !  : Start recording
              .  : Stop recording

ebUnit

ebUnit: Tool to control UNIT-T UTG962/932 Waveform generator

Usage: ebUnit [options] [commands and parameters] 

Commands:

           sine  : Generate sine -wave on channel 1|2
         square  : Generate square -wave on channel 1|2
          pulse  : Generate pulse -wave on channel 1|2
           ramp  : Generate ramp -wave on channel 1|2
            arb  : Upload wave file and use it to generate wave on channel 1|2
             on  : Switch on channel 1|2
            off  : Switch off channel 1|2
          reset  : Send reset to UTG900 signal generator
----------   Record   ----------
              !  : Start recording
              .  : Stop recording
         screen  : Take screenshot
 list_resources  : List pyvisa resources (=pyvisa list_resources() wrapper)'
----------    Help    ----------
              q  : Exit
              ?  : List commands
             ??  : List command parameters

More help:
  ebUnit --help                          : to list options
  ebUnit ? command=<command>             : to get help on command <command> parameters

Examples:
  ebUnit ? command=sine                  : help on sine command parameters
  ebUnit list_resources                  : Identify --addr option parameter
  ebUnit --addr 'USB0::1::2::3::0::INSTR': Run interactively on device found in --addr 'USB0::1::2::3::0::INSTR'
  ebUnit --captureDir=pics screen        : Take screenshot to pics directory (form device in default --addr)
  ebUnit reset                           : Send reset to UTH900 waveform generator
  ebUnit sine channel=2 freq=2kHz        : Generate 2 kHz sine signal on channel 2
  ebUnit sine channel=1 square channel=2 : chaining sine generation on channel 1, and square generation on channel 2

Hint:
  Run reset to synchronize ebUnit -tool with device state. Ref= ?? command=reset
  One-liner in linux: ebUnit --addr $(ebUnit list_resources)


ebRigol

ebRigol: Tool to control Rigol MSO1104Z osciloscope

Usage: ebRigol [options] [commands and parameters] 

Commands:

----------    Init    ----------
        general  : General setup
          setup  : Setup channel
   setupTrigger  : Setup trigger
       timebase  : Setup timebase
       podSetup  : Setup digical channels
         podOff  : Setup digical channels
             on  : Open channel
            off  : Close channel
           stat  : Set statistics
      statClear  : Clear statistics
          reset  : Send reset to Rigol
          clear  : Send clear to Rigol
----------  Measure   ----------
        measure  : Measure
----------   Record   ----------
              !  : Start recording
              .  : Stop recording
         screen  : Take screenshot
----------    Help    ----------
              q  : Exit
              ?  : List commands
             ??  : List command parameters

Documentation references

Hello World example in HELLO.org. The example continues in GENTLE_SLOPE.org as a short story slowly climbing the hill from interactive use, command line use, configuration file use to Python scripting.

A more realistic example of instrument controller for Rigol MSO1104Z: TEMPLATE.org. This example, and the example HELLO.org present a template for instrument controller implementation.

BDD testig document for ebUnit -tool in ebUnit.org.

TBD: Hello World example integrated with ebMenu: EBMENU.org

TBD Architecture

TBD

Installation

Clone repo https://github.com/jarjuk/ebench

Clone repo

git clone https://github.com/jarjuk/ebench

Check ebench VERSION -file

cat ebench/VERSION
0.0.10-pre5

Check release notes

cat ebench/RELEASES.md

Install ebench

Change working directory to ebench

cd ebench

and create distribution package into dist -sub directory

python3 setup.py  sdist  bdist_wheel

Check distribution package files created in dist directory:

ls -ltr dist
total 68
-rw-rw-r-- 1 jj jj 31438 huhti 27 21:54 ebench-0.0.10rc5.tar.gz
-rw-rw-r-- 1 jj jj 36142 huhti 27 21:54 ebench-0.0.10rc5-py3-none-any.whl

To install the latest version found in dist directory run

VERSION_FILE=$(ls -1tr dist/*.tar.gz | tail -1| cut -f2)
echo VERSION_FILE=$VERSION_FILE
python3 -m pip install --user $VERSION_FILE  && echo installed $VERSION_FILE

Check installation

Run

ebMenu _version

and expect to see same version number noticed in VERSION -file above

0.0.10-pre5

Check list resources

Use command _list_resources to list VISA resource found by pyvisa tool

ebMenu  _list_resources

In development environment it returns:

('USB0::26198::2100::1485061822::0::INSTR',)

Use it

ebMenu --debug=1  '?' 

TBD Usage

TDB

Interactive usage

ebench -tools should give usage instructions with ? -command.

For example running

cat <<EOF | ebMenu
?
q
EOF
[?=help, q=quit] > ebMenu: Menu of ebench toolset

Usage: ebMenu [options] [commands and parameters] 

Commands:

        skooppi  : Rigol osciloscope control
           sgen  : UNIT-T UTG962 signal generator control
       counters  : Read hello.py counters
   counters2csv  : Save hello.py counters to example.csv
              q  : Exit
----------   Other    ----------
              ?  : List commands
             ??  : List command parameters
              !  : Start recording
              .  : Stop recording
[?=help, q=quit] > 

Command line usage

<<ebMenu>> ? 

API usage

Fin

About

An extensible toolset to control e-instruments

Resources

Stars

Watchers

Forks

Packages

No packages published