Skip to main content

pypi python readthedocs black license

DvG_Devices

Collection of I/O interfaces to communicate with microcontroller boards and laboratory devices, with optional PyQt/PySide multithread support and graphical user-interfaces.

Supports PyQt5, PyQt6, PySide2 and PySide6.

Installation:

pip install dvg-devices

To be able to run the several provided graphical user-interfaces, one has to install an additional Qt-library. This can be either PyQt5, PyQt6, PySide2 or PySide6. My personal recommendation is PyQt5 for Python <= 3.7, and PySide6 for Python >= 3.8. Pick one:

pip install pyqt5
pip install pyqt6
pip install pyside2
pip install pyside6

If you wish to interface with an GPIB device you need to additionally install a Visa backend. See https://pyvisa.readthedocs.io/en/latest/introduction/getting.html

Supported devices

Arduino, ESP32, etc

Microcontroller (serial/telnet)

Aim TTi QL series II

Power supply

Bronkhorst EL-FLOW

Mass flow controller

Julabo circulator

Recirculating bath

Keysight 3497xA

Digital multimeter

Keysight N8700

Power supply

Novanta IMS MDrive

Stepper motor controller

OptLaser TEC RS232

Thermoelectric cooler controller

Parker Compax3

Servo controller

Picotech PT104

Temperature logger

PolyScience PD

Recirculating bath

ThermoFisher ThermoFlex

Chiller

Xylem Hydrovar HVL

Variable speed pump controller

Highlights

  • Class SerialDevice() offering higher-level general I/O methods for a serial device, such as auto_connect(), write() and query().

  • Class Arduino() which wraps around SerialDevice(). In combination with DvG_StreamCommand it allows for automatically connecting to your Arduino(-like) device and for easy serial I/O communication.

  • Class TelnetServerDevice() offering higher-level general I/O methods for e.g. an ESP32 microcontroller.

  • Separate PyQt/PySide interfaces are provided for each of these devices, offering out-of-the-box multithreaded data acquisition and communication. It relies on DvG_QDeviceIO.

  • Ready-to-run PyQt/PySide demos to directly control many of the supported devices with a graphical user-interface.

Examples

  • SerialDevice

    from dvg_devices.BaseDevice import SerialDevice
    
    dev = SerialDevice()
    dev.connect_at_port(port="COM3")
    success, reply = dev.query("My query command")
  • TelnetServerDevice

    from dvg_devices.BaseDevice import TelnetServerDevice
    
    dev = TelnetServerDevice()
    dev.connect(host="10.10.100.2", port=23)
    success, reply = dev.query("My query command")

Changelog

1.8.0 (2026-09-25)

  • BaseDevice.TelnetServerDevice.readline() now catches EOFError and ConnectionResetError when the telnet connection was closed unexpectedly (by the user or OS).

1.7.3 (2026-08-28)

  • OptLaser TEC controller: Fixed error “fixedWidth is an unknown keyword parameter” in OptLaser_TEC_controller_qdev.py.

1.7.2 (2026-08-27)

  • OptLaser TEC controller: Minor changes on the demos.

1.7.1 (2026-08-17)

  • OptLaser TEC controller: Fixed broken link to OptLaser manual.

  • OptLaser TEC controller: Notify user of “Connection lost”.

1.7.0 (2026-08-17)

  • Added support for OptLaser thermoelectric cooler (TEC) controller TEC-8A-24V-PID-HC-RS232.

1.6.0 (2026-05-13)

  • Added class BaseDevice.TelnetServerDevice, useful for e.g. communicating with an ESP32 microcontroller over telnet.

1.5.2 (2025-11-10)

  • Fixed communication error in Bronkhorst_MFC_protocol_RS232.py where the send setpoint value was incorrectly decoded into lower case hex, instead of higher case hex. Fixed.

1.5.1 (2025-01-21)

  • Device Keysight_3497xA: Made hard-coded VISA_TIMEOUT an input argument instead

1.5.0 (2024-06-27)

  • Support for Numpy 2.0

  • Restore support for Python 3.6. Was removed by mistake. Version 1.4.0 and this version do support Python 3.6 actually, but only in combination with PyQt5. PySide2 will not work because the wrapper library qtpy still expects app.exec_() instead of app.exec(). That got fixed in the qtpy version for Python >= 3.7.

1.4.0 (2024-05-23)

Major clean-up and streamlining:

  • Using qtpy library instead of my own Qt5/6 mechanism

  • Changed all string formatting to f-strings

  • Extended type hinting and checking

  • Made demos uniform and passing qdev arguments to MainWindow now

  • Individual source files now follow the PyPi package version

  • Resolved nearly all Pylint / Pylance warnings

  • Removed Python 3.6 support

New devices added:

  • Xylem Hydrovar HVL - Variable speed pump controller

  • Novanta IMS MDrive - Stepper motor controller

1.3.0 (2023-02-23)

  • Added method BaseDevice.SerialDevice.query_bytes()

  • Fixed type hints in BaseDevice.SerialDevice

1.2.0 (2022-09-14)

  • Added support for PyQt5, PyQt6, PySide2 and PySide6

1.1.0 (2022-02-01)

  • Added method BaseDevice.SerialDevice.readline()

1.0.0 (2021-07-02)

  • Stable release, identical to v0.2.6

0.2.6 (2021-03-02)

  • Minor: Adjusted width of GUI control in Julabo_circulator_qdev.py

0.2.5 (2021-03-02)

  • Loosened dependence to pyserial~= 3.4

0.2.4 (2021-03-02)

  • Added device: Julabo circulator

0.2.3 (2020-08-27)

  • Workaround for bug with unknown cause in Aim_TTi_PSU_protocol_RS232 where the power supply occasionally will skew the serial input and output stream, such that the reply matches the second-previous query statement. Fixed by forcefully flushing the serial input and output buffers whenever a wrong reply is received. Hopefully, this will fix the skew when the next query() operation gets executed.

0.2.2 (2020-08-27)

  • Fixed bug in BaseDevice.query_ascii(). The use of ast.literal_eval got removed because it chokes on nan. Everything is now interpreted as a float instead.

0.2.1 (2020-08-12)

  • Fix wrong import statement dvg-pyqt-controls

  • Fix wrong import statement dvg-pyqt-filelogger

0.2.0 (2020-08-11)

  • Added dependence dvg-pyqt-controls~=1.0

  • Added dependence dvg-pyqt-filelogger~=1.0

  • Added dependence dvg-pyqtgraph-threadsafe~=3.0

0.1.0 (2020-07-23)

  • Fixed bug in BaseDevice.py where inspect.getouterframes() would momentarily suspend the thread. Solved by ditching inspect. The new ID_validation_query mechanism now relies on a simple boolean flag that gets set to force query() to raise on timeout.

  • Update dependence dvg-qdeviceio==0.3.0

0.0.7 (2020-07-17)

  • Update dependence dvg-qdeviceio==0.2.2

0.0.6 (2020-07-16)

  • Finished implementing BaseDevice.SerialDevice()

  • Update dependence dvg-qdeviceio==0.2.1

0.0.5 (2020-07-07)

  • Update dependence dvg-qdeviceio==0.2.0 Enum DAQ_trigger is now called DAQ_TRIGGER

  • Code style: Black

0.0.4 (2020-07-04)

  • Update dependence dvg-qdeviceio==0.1.2

0.0.3 (2020-07-02)

  • Fixed broken packaging

0.0.2 (2020-07-02)

  • Major restructuring PyPI package

  • Implemented DvG_QDeviceIO

0.0.1 (2020-07-01)

  • First release on PyPI

Release files for dvg-devices 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dvg-devices 1.8.0
File Size Uploaded
dvg_devices-1.8.0.tar.gz 4.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for dvg-devices 1.8.0
File Interpreter ABI Platform
dvg_devices-1.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 MB

Release files / dvg_devices-1.8.0.tar.gz

Download URL dvg_devices-1.8.0.tar.gz
Size 4.2 MB
Tags Source
SHA-256 checksum
How to use checksums
84ee2e02a9f2423577e29e4da19911b50efed204005c31d9d90926f2c9741675
BLAKE2b-256 checksum
How to use checksums
baad43c7017a0192dbb364edb95610bd4f11b03c36e13d79c7fe9604382edcfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / dvg_devices-1.8.0-py3-none-any.whl

Download URL dvg_devices-1.8.0-py3-none-any.whl
Size 4.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0bf5cd549a6312a0072a7b63a1c59d19d6043618d2ea8c2c6dee6579225d1121
BLAKE2b-256 checksum
How to use checksums
8e34857d67809a7a01bca564e60358ec5566079d80f9b5f9b0163f19edc014bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

1.8.0 This release

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page