doc/developer_manual.rst

changeset 73
2645ef311424
parent 63
1c0d92f95115
child 74
62d7957b3aa8
equal deleted inserted replaced
72:a81d0fd26332 73:2645ef311424
2 2
3 ============= 3 =============
4 Description 4 Description
5 ============= 5 =============
6 6
7 The code is organized as follow: 7 The code is organized in 2 layers; a low-level communication layer,
8 and a highter level which allows to describe precisely a GPIB device,
9 communicate asynchronously with it, etc.
8 10
9 ``pygpibtoolkit`` is the main python package directory, holding 11 Low level
10 generic GPIB stuffs. A GPIB controller is a class responsible for 12 =========
11 managing the communication with the GPIB device plugged in the 13
12 computer. For now, the only GPIB controller is the Prologix one, 14 The low level communication process is managed by the module
13 defined in the ``pygpibtoolkit.prologix`` module. 15 ``pygpibtoolkit.prologix``, in which there is a class names ``GPIB``
16 that knows how to initialize the GPIB device, send commands and
17 receive data from the bus, perform GPIB polls, etc.
18
19 Example::
20
21 from pygpibtoolkit.prologix import GPIB
22 cnx = GPIB() # by default, it is the controller in charge
23 idn = cnx.send_command("*IDN?", 12) # sends the idn command to device at GPIBaddress 12
24 print idn
25
26 cnx.set_address(12) # we will talk to this device 12 for a while
27 datablock = cnx.send_command('DDBN')
28
29 if cnx.check_srq():
30 print "A Service Request has been sent"
31
32 Hight level
33 ===========
14 34
15 35
36
37

mercurial