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.
Device | Supported | Tested | Comments |
---|---|---|---|
Fluke 5440B | ✔️ | ✔️ | |
HP 3478A | ✔️ | ✔️ |
There are currently no packages for Linux GPIB available on all platforms. To install the library it is required to install 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
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/
The package can be directly installed via Pypi:
python3 -m venv env # virtual environment, optional
source env/bin/activate
pip install async-gpib
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.
⚠️ 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.
I use SemVer for versioning. For the versions available, see the tags on this repository.
I use the Numpydoc style for documentation.
- Patrick Baus - Initial work - PatrickBaus
This project is licensed under the GPL v3 license - see the LICENSE file for details