Wiki

Clone wiki

subinitial-equipment / Home

Subinitial Equipment Library

The Subinitial Equipment Library allows you to control 3rd-party automated test equipment in Python. This allows equipment to be used alongside Subinitial Stacks and within the Automation Test Framework.

Supported External Test Equipment

The following are drivers written, tested, and integrated into the Subinitial-equipment library. For other equipment, see the Other External Test Equipment section below or contact Subinitial for custom driver development.

DMM:

  • HP3458A, GPIB (with Ethernet adapter)
  • Rigol DM3000 series, Ethernet & USB

Power Supply:

  • Sorensen XPF 60-20DP, Ethernet
  • TDK Z+ series, Ethernet & USB
  • Rigol DP800 series, Ethernet & USB

O-Scope:

  • Rigol DS4000 series, Ethernet
  • Rigol DS1000Z series, Ethernet
  • Rigol DS1000E series, USB

Note: We strongly recommend using equipment with an Ethernet interface instead of USB to avoid a number of USB connectivity problems inherent in USB. Any GPIB equipment can be controlled via Ethernet using a Prologix GPIB-ETHERNET converter (or equivalent).

Other External Test Equipment

We encourage integrating external test equipment into hardware automated tests written in Python. Almost all test equipment can be controlled within Python using drivers provided from the manufacturer or through various third-party libraries such as python-ivi or PyVISA.

PC Installation Requirements

  • Python 3.5+
  • python and pip3 on your system PATH.

Use the commands below in a command prompt to verify your installed versions:

python --version
python3 --version
pip3 --version

PC Installation

Install all requirements, then open a command prompt and run the pip3 command below

pip3 install --user git+https://bitbucket.org/subinitial/subinitial-equipment.git
NOTES:

  • pip should work as well as pip3 if Python 2 is not installed on your system
  • pip's --user flag allows you to install this package without admin privileges, If you'd like to install the package system-wide then omit the --user flag e.g. pip3 install git+https://bitbucket.org/...
  • You can use virtualenv to make a localized Python environment for a particular project then pip install all required packages as needed with the virtualenv activated. Omit the --user flag when installing this package inside a virtualenv.
  • You can distribute a specific version of the library with your Python code easily by using the command below. The command below creates the subinitial-equipment package from the git tag v1.13.0 in the directory "." which is the current working directory (CWD)
    pip3 install git+https://bitbucket.org/subinitial/subinitial-equipment.git@v1.13.0 --target="."
    

Verify Installation

#!python
from subinitial.equipment.tdkzplus import TdkZPlus
print(TdkZPlus)

For more detailed installation instructions and help getting started refer to the Getting Started page.

Included Python Dependencies

3rd party Python libraries have been included for convenience in the package subdirectory: subinitial/equipment/lib

License Information

Each 3rd party python package has been included with subinitial.equipment for automatic fall-back usage when these packages are not found in your existing python library. All are optional or situationally dependent. Included are web-links for each package, please refer to these websites for copyrights, licensing, and author information.

serial - https://pypi.python.org/pypi/pyserial/2.7 usb - https://pypi.python.org/pypi/pyusb/1.0.0b2 usbtmc - https://pypi.python.org/pypi/python-usbtmc/0.5 vxi11 - https://pypi.python.org/pypi/python-vxi11/0.7

Optional USB Installation

PyUSB is required to connect to equipment over USB. We recommend you use Ethernet+TCP/IP when available for improved reliability. If you choose to use USB interfaces then here are some guidelines:

usb -- PyUSB Install

Example for Debian Based GNU/Linux:

Install libusb-1.0-0 with the following command:
    sudo apt-get install libusb-1.0-0

For issues refer to:
    https://github.com/walac/pyusb

You must add your device to the usbtmc rules file to give permission to connect:
    /etc/udev/rules.d/usbtmc.rules

    # USBTMC instruments
    # Agilent DSO-X 2004A
    SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0957", ATTRS{idProduct}=="179a", GROUP="usbtmc", MODE="0660"

If you don't want to change the usbtmc rules you can run your python code with administrative priviledges with the "sudo" command refer to:
    http://dontbuyjustmake.blogspot.com/2013/12/controlling-oscilloscope-with-linux.html

Updated