# HG changeset patch # User David Douard # Date 1219388343 -7200 # Node ID 2645ef31142492c9f1e67cf473db7726e1d2b229 # Parent a81d0fd26332e7c32709a59a965021e173758fd7 small cleanups and doc update diff -r a81d0fd26332 -r 2645ef311424 doc/developer_manual.rst --- 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 +=========== + + diff -r a81d0fd26332 -r 2645ef311424 doc/introduction.rst --- a/doc/introduction.rst Fri Aug 22 07:06:41 2008 +0200 +++ b/doc/introduction.rst Fri Aug 22 08:59:03 2008 +0200 @@ -1,7 +1,7 @@ .. -*- coding: utf-8 -*- ============== - Presentation + Introduction ============== pygpibtoolkit_ is a Python_ toolkit for talking with GPIB devices. It @@ -47,8 +47,9 @@ Tools ======= -Every tool presented in this section can display a *help* message -using the ``-h`` or ``--help`` option. +Every tool presented in this section can be found in the `bin` +directory, and can display a *help* message using the ``-h`` or +``--help`` option. For the sake of testing these tools, some example files are proposed in the `example` directory. @@ -111,9 +112,11 @@ Simple GPIB device detector. The computer GPIB device is configured so it is the Controller In Charge on the GPIB bus. It takes a while -(several seconds) to run the retection procedure. When complete, it -will simply display the list of devices found on the bus, with a -decription of the device (if available). +(several seconds) to run the retection procedure. + +Once complete, it will simply display the list of devices found on the +bus, with a decription of the device (if available, ie. if it replies +to the IDN? command, which is not the case of older devices). dump_datablock -------------- diff -r a81d0fd26332 -r 2645ef311424 pygpibtoolkit/HP3562A/HP356X.py --- a/pygpibtoolkit/HP3562A/HP356X.py Fri Aug 22 07:06:41 2008 +0200 +++ b/pygpibtoolkit/HP3562A/HP356X.py Fri Aug 22 08:59:03 2008 +0200 @@ -11,7 +11,7 @@ # this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """ Copyright (c) 2007-2008 David Douard (Paris, FRANCE). -http://www.logilab.org/project/pygpibtoolkit -- mailto:python@logilab.fr +http://www.logilab.org/project/pygpibtoolkit -- mailto:david.douard@logilab.fr """ diff -r a81d0fd26332 -r 2645ef311424 pygpibtoolkit/HP3562A/dump_datablock.py --- a/pygpibtoolkit/HP3562A/dump_datablock.py Fri Aug 22 07:06:41 2008 +0200 +++ b/pygpibtoolkit/HP3562A/dump_datablock.py Fri Aug 22 08:59:03 2008 +0200 @@ -53,6 +53,7 @@ res = "" print "command = ", cmd + # warning, this use direct low level serial communications... self._cnx.write('%s\r'%cmd) i = 0 while i