doc/developer_manual.rst

changeset 73
2645ef311424
parent 63
1c0d92f95115
child 74
62d7957b3aa8
--- a/doc/developer_manual.rst	Fri Aug 22 07:06:41 2008 +0200
+++ b/doc/developer_manual.rst	Fri Aug 22 08:59:03 2008 +0200
@@ -4,12 +4,34 @@
  Description
 =============
 
-The code is organized as follow:
+The code is organized in 2 layers; a low-level communication layer,
+and a highter level which allows to describe precisely a GPIB device,
+communicate asynchronously with it, etc.
+
+Low level
+=========
+
+The low level communication process is managed by the module
+``pygpibtoolkit.prologix``, in which there is a class names ``GPIB``
+that knows how to initialize the GPIB device, send commands and
+receive data from the bus, perform GPIB polls, etc.
+
+Example::
 
-``pygpibtoolkit`` is the main python package directory, holding
-generic GPIB stuffs. A GPIB controller is a class responsible for
-managing the communication with the GPIB device plugged in the
-computer. For now, the only GPIB controller is the Prologix one,
-defined in the ``pygpibtoolkit.prologix`` module.
+  from pygpibtoolkit.prologix import GPIB
+  cnx = GPIB() # by default, it is the controller in charge
+  idn = cnx.send_command("*IDN?", 12) # sends the idn command to device at GPIBaddress 12
+  print idn
+
+  cnx.set_address(12) # we will talk to this device 12 for a while
+  datablock = cnx.send_command('DDBN')
+
+  if cnx.check_srq():
+      print "A Service Request has been sent"
+
+Hight level
+===========
 
 
+
+

mercurial