
Virtual Instrument Lab Library
Virtual Instrument Control Library.
PyViLab-Lib Readme
Introduction
PyViLab-Lib provides a pure python library for software control of laboratory instruments.
Requirements
- Python (tested with 3.8+)
- All package requirements are listed in requirements file
- For the proper functioning of the matplotlib library needed in some projects
/examples
folder we need GUI backend outside virtual environment via installing tkinter:sudo apt-get install python3-tk
Installation
To install this software you have to clone repository. (see package details)
git clone https://gitlab.nsoric.com/mtf/lab/pyvilab-lib.git
Configuring udev
In case you cannot access your device, then you need to create an udev rule to properly set the permissions of the device. First connect your device and run lsusb
. Then find the vendor and product IDs of your device.
Steps to creating rules file:
- create group usbtmc:
sudo addgroup usbtmc
- add yourself in group usbtmc:
sudo usermod -a -G usbtmc <userName>
- place file
50-rigol.rules
in location/etc/udev/rules.d/
with this content altered with your device IDs:
# USBTMC instruments
# Rigol DM3068
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="1ab1", ATTRS{idProduct}=="0c94", GROUP="usbtmc", MODE="0666", SYMLINK="usbtmc%n"
# Rigol DG1022A
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0400", ATTRS{idProduct}=="09c4", GROUP="usbtmc", MODE="0666", SYMLINK="usbtmc%n"
# Rigol DS2072A
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="1ab1", ATTRS{idProduct}=="04b0", GROUP="usbtmc", MODE="0666", SYMLINK="usbtmc%n"
# Rigol DS1202Z-E
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="1ab1", ATTRS{idProduct}=="0517", GROUP="usbtmc", MODE="0666", SYMLINK="usbtmc%n"
- logout and login to activate membership in usbtmc group or if you want to reload udev rules without logout:
sudo udevadm control --reload-rules && udevadm trigger
Example code
All example codes for each instrument are available on GitLab (see package in the examples folder)
Contributors 2
Links
Languages
■Library
Last update
2022-05-10 14:59:21
Created at
10.11.2021