1 .. pygpibtoolkit documentation master file, created by |
1 .. pygpibtoolkit documentation master file, created by |
2 sphinx-quickstart on Wed May 16 10:51:57 2018. |
2 sphinx-quickstart on Wed May 16 10:51:57 2018. |
3 You can adapt this file completely to your liking, but it should at least |
3 You can adapt this file completely to your liking, but it should at least |
4 contain the root `toctree` directive. |
4 contain the root `toctree` directive. |
5 |
5 |
6 Welcome to pygpibtoolkit's documentation! |
6 pygpibtoolkit |
7 ========================================= |
7 ============= |
|
8 |
|
9 pygpibtoolkit_ is a Python_ toolkit for talking with GPIB devices. It |
|
10 consist in a set of python modules (low-level and some more |
|
11 high-level) in order to ease writing python code to play with GPIB |
|
12 devices. |
|
13 |
|
14 There are also some utility commands and GUI tools written using this |
|
15 library (and PyQt5 for GUI tools). |
|
16 |
|
17 The aim of the project is to have an infrastructure that make it easy |
|
18 to write code to command/interact with GPIB-controlled devices, and, |
|
19 as a corrolary, make it easy to write "description" code for specific |
|
20 test equipments. |
|
21 |
|
22 Quick start |
|
23 =========== |
|
24 |
|
25 The simplest way to install pygpibtoolkit_ is to use pip_. I strongly recommend |
|
26 you use virtualenvs_ for this, for example via virtualenvwrapper_ or pew_. Here |
|
27 is an example session using virtualenvwrapper_ on a Debian stretch machine: |
|
28 |
|
29 .. code-block:: bash |
|
30 |
|
31 david@host:~$ mkvirtualenv -p /usr/bin/python3 pygpib |
|
32 Already using interpreter /usr/bin/python3 |
|
33 Using base prefix '/usr' |
|
34 New python executable in /home/david/.virtualenvs/pygpib/bin/python3 |
|
35 Also creating executable in /home/david/.virtualenvs/pygpib/bin/python |
|
36 Installing setuptools, pkg_resources, pip, wheel...done. |
|
37 |
|
38 (pygpib) david@host:~$ pip install pygpibtoolkit |
|
39 [...] |
|
40 Installing collected packages: pyserial, numpy, sip, PyQt5, pyqtgraph, pygpibtoolkit |
|
41 Successfully installed PyQt5-5.10.1 numpy-1.14.3 pygpibtoolkit-0.1.0 pyqtgraph-0.10.0 pyserial-3.4 sip-4.19.8 |
|
42 (pygpib) david@pavo:~$ pygpib-detect --help |
|
43 usage: A simple tool for detecting connected GPIB devices [-h] [-d DEVICE] [-v] |
|
44 |
|
45 optional arguments: |
|
46 -h, --help show this help message and exit |
|
47 -d DEVICE, --device DEVICE |
|
48 Device of connected Prologix GPIB bundle |
|
49 [/dev/ttyUSB0] |
|
50 -v, --verbose |
|
51 (pygpib) david@host:~$ python |
|
52 Python 3.5.3 (default, Jan 19 2017, 14:11:04) |
|
53 [GCC 6.3.0 20170118] on linux |
|
54 Type "help", "copyright", "credits" or "license" for more information. |
|
55 >>> from pygpibtoolkit.prologix import GPIB |
|
56 >>> from pygpibtoolkit.gpibcontroller import GPIBController |
|
57 >>> cnx = GPIB(device='/dev/ttyUSB0') |
|
58 >>> ctl = GPIBController(cnx) |
|
59 >>> dvm = c.register_device(24, "HP3456A") |
|
60 >>> dvm.S0F1 # set DVM to DC Voltage mode |
|
61 |
|
62 |
8 |
63 |
9 .. toctree:: |
64 .. toctree:: |
10 :maxdepth: 2 |
65 :maxdepth: 2 |
11 :caption: Contents: |
66 :caption: Contents: |
12 |
67 |