Skip to main content

Python common code base to control devices high voltage research devices, in particular, as used in Christian Franck's High Voltage Lab (HVL), D-ITET, ETH

Project description

HVL Common Code Base

PyPI version Supported Python versions Pipeline status Coverage report Documentation Status Development pipeline status

Python common code base to control devices high voltage research devices, in particular, as used in Christian Franck’s High Voltage Lab (HVL), D-ITET, ETH.

  • Free software: GNU General Public License v3

  • Copyright (c) 2019-2021 ETH Zurich, SIS ID and HVL D-ITET

Features

For managing multi-device experiments instantiate the ExperimentManager utility class.

Devices

The devices wrappers in hvl_ccb provide a standardised API with configuration dataclasses, various settings and options enumerations, as well as start/stop methods. Currently, wrappers to control the following devices are available:

Function/Type

Devices

Data acquisition

LabJack (T4, T7, T7-PRO)
Pico Technology PT-104 Platinum Resistance Data Logger

Digital IO

LabJack (T4, T7, T7-PRO)

Experiment control

HVL Supercube with and without Frequency Converter

Gas Analyser

MBW 973-SF6 gas dew point mirror analyzer
Pfeiffer Vacuum TPG (25x, 26x and 36x) controller for compact pressure gauges
SST Luminox oxygen sensor

I2C host

TiePie (HS5, WS5)

Laser

CryLaS pulsed laser
CryLaS laser attenuator

Oscilloscope

Rhode & Schwarz RTO 1024
TiePie (HS5, HS6, WS5)

Power supply

Elektro-Automatik PSI9000
FuG Elektronik
Heinzinger PNC
Technix capacitor charger

Stepper motor drive

Newport SMC100PP
Schneider Electric ILS2T

Temperature control

Lauda PRO RP 245 E circulation thermostat

Waveform generator

TiePie (HS5, WS5)

Each device uses at least one standardised communication protocol wrapper.

Communication protocols

In hvl_ccb by “communication protocol” we mean different levels of communication standards, from the low level actual communication protocols like serial communication to application level interfaces like VISA TCP standard. There are also devices in hvl_ccb that use dummy communication protocol concept; this is because these devices build on propriety vendor libraries that communicate with vendor devices, like in case of the TiePie devices.

The communication protocol wrappers in hvl_ccb provide a standardised API with configuration dataclasses, as well as open/close, and read/write/query methods. Currently, wrappers to use the following communication protocols are available:

Communication protocol

Devices using

Modbus TCP

Schneider Electric ILS2T stepper motor drive

OPC UA

HVL Supercube with and without Frequency Converter

Serial

CryLaS pulsed laser and laser attenuator
FuG Elektronik power supply (e.g. capacitor charger HCK) using the Probus V protocol
Heinzinger PNC power supply using Heinzinger Digital Interface I/II
SST Luminox oxygen sensor
MBW 973-SF6 gas dew point mirror analyzer
Newport SMC100PP single axis driver for 2-phase stepper motors
Pfeiffer Vacuum TPG (25x, 26x and 36x) controller for compact pressure gauges
Technix capacitor charger

TCP

Lauda PRO RP 245 E circulation thermostat

Telnet

Technix capacitor charger

VISA TCP

Elektro-Automatik PSI9000 DC power supply
Rhode & Schwarz RTO 1024 oscilloscope

propriety

LabJack (T4, T7, T7-PRO) devices, which communicate via LJM Library
Pico Technology PT-104 Platinum Resistance Data Logger, which communicate via PicoSDK
TiePie (HS5, HS6, WS5) oscilloscopes, generators and I2C hosts, which communicate via LibTiePie SDK

Documentation

Note: if you’re planning to contribute to the hvl_ccb project do read beforehand the Contributing section in the HVL CCB documentation.

Do either:

or

  • build and read HVL CCB documentation locally; install first Graphviz (make sure to have the dot command in the executable search path) and the Python build requirements for documentation:

    $ pip install docs/requirements.txt

    and then either on Windows in Git BASH run:

    $ ./make.sh docs

    or from any other shell with GNU Make installed run:

    $ make docs

    The target index HTML ("docs/_build/html/index.html") should open automatically in your Web browser.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.8.1 (2021-08-13)

  • Add Python version check (min version error; max version warning).

  • Daily checks for upstream dependencies compatibility and devel environment improvements.

0.8.0 (2021-07-02)

  • TCP communication protocol.

  • Lauda PRO RP 245 E circulation thermostat device over TCP.

  • Pico Technology PT-104 Platinum Resistance Data Logger device as a wrapper of the Python bindings for the PicoSDK.

  • In com.visa.VisaCommunication: periodic status polling when VISA/TCP keep alive connection is not supported by a host.

0.7.1 (2021-06-04)

  • New utils.validation submodule with validate_bool and validate_number utilities extracted from internal use within a dev.tiepie subpackage.

  • In comm.serial.SerialCommunication:
    • strict encoding errors handling strategy for subclasses,

    • user warning for a low communication timeout value.

0.7.0 (2021-05-25)

  • The dev.tiepie module was splitted into a subpackage with, in particular, submodules for each of the device types – oscilloscope, generator, and i2c – and with backward-incompatible direct imports from the submodules.

  • In dev.technix:
    • fixed communication crash on nested status byte query;

    • added enums for GET and SET register commands.

  • Further minor logging improvements: added missing module level logger and removed some error logs in except blocks used for a flow control.

  • In examples/ folder renamed consistently all the examples.

  • In API documentation: fix incorrect links mapping on inheritance diagrams.

0.6.1 (2021-05-08)

  • In dev.tiepie:
    • dynamically set oscilloscope’s channel limits in OscilloscopeChannelParameterLimits: input_range and trigger_level_abs, incl. update of latter on each change of input_range value of a TiePieOscilloscopeChannelConfig instances;

    • quick fix for opening of combined instruments by disabling OscilloscopeParameterLimits.trigger_delay (an advanced feature);

    • enable automatic devices detection to be able to find network devices with TiePieOscilloscope.list_devices().

  • Fix examples/example_labjack.py.

  • Improved logging: consistently use module level loggers, and always log exception tracebacks.

  • Improve API documentation: separate pages per modules, each with an inheritance diagram as an overview.

0.6.0 (2021-04-23)

  • Technix capacitor charger using either serial connection or Telnet protocol.

  • Extensions, improvements and fixes in existing devices:
    • In dev.tiepie.TiePieOscilloscope:
      • redesigned measurement start and data collection API, incl. time out argument, with no/infinite time out option;

      • trigger allows now a no/infinite time out;

      • record length and trigger level were fixed to accept, respectively, floating point and integer numbers;

      • fixed resolution validation bug;

    • dev.heinzinger.HeinzingerDI and dev.rs_rto1024.RTO1024 instances are now resilient to multiple stop() calls.

    • In dev.crylas.CryLasLaser: default configuration timeout and polling period were adjusted;

    • Fixed PSI9080 example script.

  • Package and source code improvements:
    • Update to backward-incompatible pyvisa-py>=0.5.2. Developers, do update your local development environments!

    • External libraries, like LibTiePie SDK or LJM Library, are now not installed by default; they are now extra installation options.

    • Added Python 3.9 support.

    • Improved number formatting in logs.

    • Typing improvements and fixes for mypy>=0.800.

0.5.0 (2020-11-11)

  • TiePie USB oscilloscope, generator and I2C host devices, as a wrapper of the Python bindings for the LibTiePie SDK.

  • a FuG Elektronik Power Supply (e.g. Capacitor Charger HCK) using the built-in ADDAT controller with the Probus V protocol over a serial connection

  • All devices poling status or measurements use now a dev.utils.Poller utility class.

  • Extensions and improvements in existing devices:
    • In dev.rs_rto1024.RTO1024: added Channel state, scale, range, position and offset accessors, and measurements activation and read methods.

    • In dev.sst_luminox.Luminox: added querying for all measurements in polling mode, and made output mode activation more robust.

    • In dev.newport.NewportSMC100PP: an error-prone wait_until_move_finished method of replaced by a fixed waiting time, device operations are now robust to a power supply cut, and device restart is not required to apply a start configuration.

  • Other minor improvements:
    • Single failure-safe starting and stopping of devices sequenced via dev.base.DeviceSequenceMixin.

    • Moved read_text_nonempty up to comm.serial.SerialCommunication.

    • Added development Dockerfile.

    • Updated package and development dependencies: pymodbus, pytest-mock.

0.4.0 (2020-07-16)

  • Significantly improved new Supercube device controller:
    • more robust error-handling,

    • status polling with generic Poller helper,

    • messages and status boards.

    • tested with a physical device,

  • Improved OPC UA client wrapper, with better error handling, incl. re-tries on concurrent.futures.TimeoutError.

  • SST Luminox Oxygen sensor device controller.

  • Backward-incompatible changes:
    • CommunicationProtocol.access_lock has changed type from threading.Lock to threading.RLock.

    • ILS2T.relative_step and ILS2T.absolute_position are now called, respectively, ILS2T.write_relative_step and ILS2T.write_absolute_position.

  • Minor bugfixes and improvements:
    • fix use of max resolution in Labjack.set_ain_resolution(),

    • resolve ILS2T devices relative and absolute position setters race condition,

    • added acoustic horn function in the 2015 Supercube.

  • Toolchain changes:
    • add Python 3.8 support,

    • drop pytest-runner support,

    • ensure compatibility with labjack_ljm 2019 version library.

0.3.5 (2020-02-18)

  • Fix issue with reading integers from LabJack LJM Library (device’s product ID, serial number etc.)

  • Fix development requirements specification (tox version).

0.3.4 (2019-12-20)

  • New devices using serial connection:
    • Heinzinger Digital Interface I/II and a Heinzinger PNC power supply

    • Q-switched Pulsed Laser and a laser attenuator from CryLas

    • Newport SMC100PP single axis motion controller for 2-phase stepper motors

    • Pfeiffer TPG controller (TPG 25x, TPG 26x and TPG 36x) for Compact pressure Gauges

  • PEP 561 compatibility and related corrections for static type checking (now in CI)

  • Refactorings:
    • Protected non-thread safe read and write in communication protocols

    • Device sequence mixin: start/stop, add/rm and lookup

    • .format() to f-strings

    • more enumerations and a quite some improvements of existing code

  • Improved error docstrings (:raises: annotations) and extended tests for errors.

0.3.3 (2019-05-08)

  • Use PyPI labjack-ljm (no external dependencies)

0.3.2 (2019-05-08)

  • INSTALLATION.rst with LJMPython prerequisite info

0.3.1 (2019-05-02)

  • readthedocs.org support

0.3 (2019-05-02)

  • Prevent an automatic close of VISA connection when not used.

  • Rhode & Schwarz RTO 1024 oscilloscope using VISA interface over TCP::INSTR.

  • Extended tests incl. messages sent to devices.

  • Added Supercube device using an OPC UA client

  • Added Supercube 2015 device using an OPC UA client (for interfacing with old system version)

0.2.1 (2019-04-01)

  • Fix issue with LJMPython not being installed automatically with setuptools.

0.2.0 (2019-03-31)

  • LabJack LJM Library communication wrapper and LabJack device.

  • Modbus TCP communication protocol.

  • Schneider Electric ILS2T stepper motor drive device.

  • Elektro-Automatik PSI9000 current source device and VISA communication wrapper.

  • Separate configuration classes for communication protocols and devices.

  • Simple experiment manager class.

0.1.0 (2019-02-06)

  • Communication protocol base and serial communication implementation.

  • Device base and MBW973 implementation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hvl_ccb-0.8.1.tar.gz (199.8 kB view hashes)

Uploaded Source

Built Distribution

hvl_ccb-0.8.1-py2.py3-none-any.whl (162.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page