Sun, 03 Jun 2018 18:09:47 +0200
[test] add a conftest.py file with fixtures for prologix emulator setup in tests
92 | 1 | .. pygpibtoolkit documentation master file, created by |
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 | |
4 | contain the root `toctree` directive. | |
5 | ||
95
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
6 | pygpibtoolkit |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
7 | ============= |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
8 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
9 | pygpibtoolkit_ is a Python_ toolkit for talking with GPIB devices. It |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
10 | consist in a set of python modules (low-level and some more |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
11 | high-level) in order to ease writing python code to play with GPIB |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
12 | devices. |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
13 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
14 | There are also some utility commands and GUI tools written using this |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
15 | library (and PyQt5 for GUI tools). |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
16 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
17 | The aim of the project is to have an infrastructure that make it easy |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
18 | to write code to command/interact with GPIB-controlled devices, and, |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
19 | as a corrolary, make it easy to write "description" code for specific |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
20 | test equipments. |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
21 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
22 | Quick start |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
23 | =========== |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
24 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
25 | The simplest way to install pygpibtoolkit_ is to use pip_. I strongly recommend |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
26 | you use virtualenvs_ for this, for example via virtualenvwrapper_ or pew_. Here |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
27 | is an example session using virtualenvwrapper_ on a Debian stretch machine: |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
28 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
29 | .. code-block:: bash |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
30 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
31 | david@host:~$ mkvirtualenv -p /usr/bin/python3 pygpib |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
32 | Already using interpreter /usr/bin/python3 |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
33 | Using base prefix '/usr' |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
34 | New python executable in /home/david/.virtualenvs/pygpib/bin/python3 |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
35 | Also creating executable in /home/david/.virtualenvs/pygpib/bin/python |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
36 | Installing setuptools, pkg_resources, pip, wheel...done. |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
37 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
38 | (pygpib) david@host:~$ pip install pygpibtoolkit |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
39 | [...] |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
40 | Installing collected packages: pyserial, numpy, sip, PyQt5, pyqtgraph, pygpibtoolkit |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
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 |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
42 | (pygpib) david@pavo:~$ pygpib-detect --help |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
43 | usage: A simple tool for detecting connected GPIB devices [-h] [-d DEVICE] [-v] |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
44 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
45 | optional arguments: |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
46 | -h, --help show this help message and exit |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
47 | -d DEVICE, --device DEVICE |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
48 | Device of connected Prologix GPIB bundle |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
49 | [/dev/ttyUSB0] |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
50 | -v, --verbose |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
51 | (pygpib) david@host:~$ python |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
52 | Python 3.5.3 (default, Jan 19 2017, 14:11:04) |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
53 | [GCC 6.3.0 20170118] on linux |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
54 | Type "help", "copyright", "credits" or "license" for more information. |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
55 | >>> from pygpibtoolkit.prologix import GPIB |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
56 | >>> from pygpibtoolkit.gpibcontroller import GPIBController |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
57 | >>> cnx = GPIB(device='/dev/ttyUSB0') |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
58 | >>> ctl = GPIBController(cnx) |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
59 | >>> dvm = c.register_device(24, "HP3456A") |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
60 | >>> dvm.S0F1 # set DVM to DC Voltage mode |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
61 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
62 | |
92 | 63 | |
64 | .. toctree:: | |
65 | :maxdepth: 2 | |
66 | :caption: Contents: | |
67 | ||
68 | introduction | |
69 | developer_manual | |
70 | ||
71 | ||
72 | Indices and tables | |
73 | ================== | |
74 | ||
75 | * :ref:`genindex` | |
76 | * :ref:`modindex` | |
77 | * :ref:`search` | |
95
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
78 | |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
79 | .. _pygpibtoolkit: https://bitbucket.org/dddouard/pygpibtoolkit |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
80 | .. _Prologix: http://www.prologix.com |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
81 | .. _Python: http://www.python.org |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
82 | .. _`user manual`: http://pygpibtoolkit.readthedocs.io |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
83 | .. _GPIB: https://en.wikipedia.org/wiki/IEEE-488 |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
84 | .. _linux-gpib: https://linux-gpib.sourceforge.io |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
85 | .. _virtualenvs: https://docs.python.org/dev/library/venv.html |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
86 | .. _pip: https://packaging.python.org/key_projects/#pip |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
87 | .. _virtualenvwrapper: http://virtualenvwrapper.readthedocs.io |
c6b655d9b855
[doc] refactor a bit the doc and use classic theme
David Douard <david.douard@logilab.fr>
parents:
92
diff
changeset
|
88 | .. _pew: https://github.com/berdario/pew |