Fri, 22 Aug 2008 08:59:03 +0200
small cleanups and doc update
63
1c0d92f95115
added doc (almost empty) files
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
1 | .. -*- coding: utf-8 -*- |
1c0d92f95115
added doc (almost empty) files
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
2 | |
1c0d92f95115
added doc (almost empty) files
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
3 | ============= |
1c0d92f95115
added doc (almost empty) files
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
4 | Description |
1c0d92f95115
added doc (almost empty) files
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
5 | ============= |
1c0d92f95115
added doc (almost empty) files
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
6 | |
73
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
7 | The code is organized in 2 layers; a low-level communication layer, |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
8 | and a highter level which allows to describe precisely a GPIB device, |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
9 | communicate asynchronously with it, etc. |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
10 | |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
11 | Low level |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
12 | ========= |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
13 | |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
14 | The low level communication process is managed by the module |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
15 | ``pygpibtoolkit.prologix``, in which there is a class names ``GPIB`` |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
16 | that knows how to initialize the GPIB device, send commands and |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
17 | receive data from the bus, perform GPIB polls, etc. |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
18 | |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
19 | Example:: |
63
1c0d92f95115
added doc (almost empty) files
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
20 | |
73
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
21 | from pygpibtoolkit.prologix import GPIB |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
22 | cnx = GPIB() # by default, it is the controller in charge |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
23 | idn = cnx.send_command("*IDN?", 12) # sends the idn command to device at GPIBaddress 12 |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
24 | print idn |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
25 | |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
26 | cnx.set_address(12) # we will talk to this device 12 for a while |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
27 | datablock = cnx.send_command('DDBN') |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
28 | |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
29 | if cnx.check_srq(): |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
30 | print "A Service Request has been sent" |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
31 | |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
32 | Hight level |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
33 | =========== |
63
1c0d92f95115
added doc (almost empty) files
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
34 | |
1c0d92f95115
added doc (almost empty) files
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
35 | |
73
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
36 | |
2645ef311424
small cleanups and doc update
David Douard <david.douard@logilab.fr>
parents:
63
diff
changeset
|
37 |