Skip to main content

A Python asyncio library for the Fluke 5440B voltage calibrator.

Project description

pylint PyPI PyPI - Python Version PyPI - Status License: GPL v3 code style

fluke5440b-async

Python3 asyncio Fluke 5440B driver. This library requires Python asyncio and asyncio library for the GPIB adapter.

The library is fully type-hinted.

:warning: The following features are not supported (yet):

  • External calibration: I do not have the means to test this. If you want to help, open a ticket and we can get this done
  • Setting and retrieving DUUT tolerances and errors. I believe this is best done in software on the host computer and not done internally in the calibrator. If you really need that featuer open a ticket.

Supported GPIB Hardware

Device Supported Tested Comments
asyncio Prologix GPIB library :heavy_check_mark: :heavy_check_mark:
asyncio linux-gpib wrapper :heavy_check_mark: :heavy_check_mark:

Tested using Linux, but should work on Mac OSX, Windows or any OS with Python support.

Documentation

The full documentation can be found on GitHub Pages: https://patrickbaus.github.io/pyAsyncFluke5440B/. I use the Numpydoc style for documentation and Sphinx for compiling it.

Setup

To install the library in a virtual environment (always use venvs with every project):

python3 -m venv env  # virtual environment, optional
source env/bin/activate  # only if the virtual environment is used
pip install fluke5440b-async

All examples assume that a GPIB library is installed as well. Either run

pip install prologix-gpib-async    # or alternatively
# pip install async-gpib

Usage

:warning: The calibrator does not like excessive serial polling. So, when using the Prologix adapter, one might see warnings like this: Got error during waiting: ErrorCode.GPIB_HANDSHAKE_ERROR. If you are using a Prologix adapter, this can be safely ignored at this point. These are harmless and can be ignored.

The library uses an asynchronous context manager to make cleanup easier. You can use either the context manager syntax or invoke the calls manually:

async with Fluke_5440B(connection=gpib_device) as fluke5440b:
    # Add your code here
    ...
try:
    fluke5440b = Fluke_5440B(connection=gpib_device)
    await fluke5440b.connect()
    # your code
finally:
    await fluke5440b.disconnect()

A simple example for setting the output voltage.

from pyAsyncFluke5440B.Fluke_5440B import Fluke_5440B

from pyAsyncGpib.pyAsyncGpib.AsyncGpib import AsyncGpib


# This example will print voltage data to the console
async def main():
    # The default GPIB address is 7.
    async with Fluke_5440B(connection=AsyncGpib(name=0, pad=7)) as fluke5440b:
        # No need to explicitely bring up the GPIB connection. This will be done by the instrument.
        await fluke5440b.set_output(10.0)
        await fluke5440b.set_output_enabled(True)


try:
    asyncio.run(main(), debug=True)
except KeyboardInterrupt:
    # The loop will be canceled on a KeyboardInterrupt by the run() method, we just want to suppress the exception
    pass

See examples/ for more working examples.

Versioning

I use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the GPL v3 license - see the LICENSE file for details

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

fluke5440b_async-1.0.3.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

fluke5440b_async-1.0.3-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

Details for the file fluke5440b_async-1.0.3.tar.gz.

File metadata

  • Download URL: fluke5440b_async-1.0.3.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for fluke5440b_async-1.0.3.tar.gz
Algorithm Hash digest
SHA256 5ba388ca2ceab6156fe7a792a9b8dc3a2ac4f807a4c0536168ba568ffcfed49a
MD5 1d1c0ff567e328584676cfa4920f8a1c
BLAKE2b-256 55a3d5c74d4df81550b614d554bedb97e4e8d24ee274fb9ff14a7b314c6650fe

See more details on using hashes here.

File details

Details for the file fluke5440b_async-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fluke5440b_async-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 59127791381b7ae1b275a3c6c066a85f412291d27cd28fb335a170eebb166608
MD5 8fba6a12510a135bbf1d4e3583becc19
BLAKE2b-256 48fa5225e55758d743d9a1dba0b15f41fc122462e5d2918cf6b45d7c8a273a91

See more details on using hashes here.

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