Skip to main content

Python3 AsyncIO Linux GPIB wrapper

Project description

pylint PyPI PyPI - Python Version PyPI - Status code style

async_gpib

Python3 AsyncIO Linux GPIB Wrapper. The library requires Python asyncio and is a thin wrapper for the threaded Linux GPIB Wrapper library.

The library is fully type-hinted.

Supported Devices

Instruments

Device Supported Tested Comments
Fluke 5440B :heavy_check_mark: :heavy_check_mark:
HP 3478A :heavy_check_mark: :heavy_check_mark:

Setup

There are currently no packages for Linux GPIB available on all platforms. To install the library it is required to install Linux GPIB.

Linux GPIB:

These instructions are for Ubuntu:

sudo apt install subversion build-essential autoconf libtool flex bison python3-dev
svn checkout svn://svn.code.sf.net/p/linux-gpib/code/trunk linux-gpib-code
cd ~/linux-gpib-code/linux-gpib-kernel
make
sudo make install  # ignore the signing errors
sudo groupadd gpib  # seems not to be installed
sudo modprobe ni_usb_gpib
cd ~/linux-gpib-code/linux-gpib-user
./bootstrap
./configure --sysconfdir=/etc
make
sudo make install
sudo ldconfig

Linux GPIB Python module:

Once Linux GPIB is installed, you can either install the python package or use the gpib-ctypes package.

python3 -m venv env  # virtual environment, optional
source env/bin/activate
pip install -e ~/linux-gpib-code/linux-gpib-user/language/python/

async_gpib Python module

If you have cloned the repository, there is a script available to install the package from the source.

python3 -m venv env  # virtual environment, optional
source env/bin/activate
python3 pip install .

Alternatively the package can be directly installed via Pypi:

python3 -m venv env  # virtual environment, optional
source env/bin/activate
pip install async_gpib

Usage

Initialize the GPIB adapter

from async_gpib import AsyncGpib
# Create a controller and talk to device address 22
async with AsyncGpib(name=0, pad=22) as gpib_device:
    # Add your code here
    ...

See examples/ for more working examples.

Support for Multiple Devices

:warning: Concurrency with multiple devices: Note, that when using a single adapter to control multiple devices, there is no concurrency on the GPIB bus. This means, there is no speed increase, when making asynchronous reads from multiple devices on the bus regarding the transfer time.

Versioning

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

Documentation

I use the Numpydoc style for documentation.

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

async_gpib-2.1.1.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

async_gpib-2.1.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file async_gpib-2.1.1.tar.gz.

File metadata

  • Download URL: async_gpib-2.1.1.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for async_gpib-2.1.1.tar.gz
Algorithm Hash digest
SHA256 14ce8a2f6d9839d9612ac256456f60e3ed33625ad0b0fcc9e123b8458ace8abe
MD5 89d8b847cb792ef0384b7f02beb3c7da
BLAKE2b-256 5302b9a3375311437748a370eaa55e182adf51706d34fbf2ffc3f242ae9c1e2f

See more details on using hashes here.

File details

Details for the file async_gpib-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: async_gpib-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for async_gpib-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf568ef5a6851e64f134d60aa3132f582e4fc1ae18d64985f8e5034961264180
MD5 b7fc4203db9ff4f6a3a0d85abcd4773f
BLAKE2b-256 3be816ff42528af12fc8ae08894d54bb8e032064047d6675e5bf986d2dff63f0

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