[volt-nuts] do you like Labview in your labs?

Chuck Harris cfharris at erols.com
Tue Dec 7 01:42:06 UTC 2010


Marvin E. Gozum wrote:

> Chuck, on the side, did your issues with Prologix GPIB adapter resolve
> using Linux?

Marvin,

The Prologix GPIB adapter works very nicely on Linux.  I use it
primarily with Python, where it is trivial to write data collection,
graphing, and analysis routines.

The only problem I ever had was with my HP3478A DVM.  For whatever
reason, it will not work as the only device on the bus with my old
V4.6 adapter, with V5.0 firmware.  If there was another device on
the bus, it was fine. Abdul is sending me the latest version, and
I will see if that makes a difference.

My suspicion is that my HP3478A DVM has a problem with its on chip
pull up resistors, and the old Prologix adapter cannot source enough
current to make it work.  Adding a second powered on device sources
enough additional current to mask the problem.

Remember, the old adapter was never intended to be a fully drive
compliant controller.  It was intended to drive one or two devices.
I have run it with 6 or 7 devices, and as long as all are turned on,
it does just fine.

For those that want a complete example of how to drive the Prologix using
Python, here goes!
----------------------------------------------------------------------

#! /usr/bin/env python

# 7854.py - try out some gpib data collection using the Prologix gpib-usb controller
#

import os
import termios
import serial
import time

def gpib_init() :
	ser.write("++mode 1\r")
	time.sleep(0.1)
	ser.write("++ifc\r")
	time.sleep(0.1)
	ser.write("++auto 0\r")
	time.sleep(0.1)
	ser.write("++eoi 0\r")
	time.sleep(0.1)
	
def gpib_read(addr):
	ser.write("++addr " + str(addr) + "\r")
	time.sleep(0.1)
	ser.write("++read eoi\r")
	return ser.readline()

def gpib_write(addr,gpibstr):
	ser.write("++addr " + str(addr) + "\r")
	time.sleep(0.1)
	ser.write(gpibstr + "\r")
	
#
# test program...
#

ser = serial.Serial('/dev/ttyUSB0',rtscts=0,timeout=1)

ser.write("++ver\r")
print ser.readline()

gpib_init()

gpib_write(10,"ID?\r")
print "ID= " + gpib_read(10) + "\r"

gpib_write(10,"VMDR\r")
gpib_write(10,"HMDB\r")

gpib_write(10,"STORED\r")

gpib_write(10,"1 0 2 4 >P/W AVG10\r")
gpib_read(10)

gpib_write(10,"SENDX\r")
time.sleep(4)

print "X=" + gpib_read(10) + "\r"
print "X=" + gpib_read(10) + "\r"
----------------------------------------------------------------------

Modify it to your hearts content.

-Chuck Harris

OBTW, Prologix is a great company, I cannot recommend them enough!



More information about the volt-nuts mailing list