34401a interface to PC - RS232 or GPIB? - Page 1
Forum section: electronics / testgear

author: motocoder
author_rank: Unknown
timestamp: June 17, 2014, 12:12:15 am
content: I recently picked up a used Agilent 34401a DMM off of eBay. I love the meter and want to take advantage of it's remote control capability.The meter has RS232 and GPIB interface, neither of which my PC has. I do think I have a USB -> Serial converter lying around somewhere, so I was thinking I would use that. Another option would be to get some sort of GPIB to USB converter or a GPIB board for my PC.Is there any advantage to going the GPIB route here?Thanks

author: Dave
author_rank: Super Contributor
timestamp: June 17, 2014, 12:24:14 am
content: GPIB is bulkier and more expensive, but faster and more reliable. If you are going to use slow datalogging, you might get away with RS-232, if you want to take advantage of 34401A's fast sampling rate, you are going to need GPIB.Quote from: User's Guide, page 219

author: motocoder
author_rank: Unknown
timestamp: June 17, 2014, 12:29:14 am
content: Quote from: Dave on June 17, 2014, 12:24:14 amDave - thanks. Do you have any recommendations regarding how to interface my PC to GPIB? I see a number of used Agilent GPIB to USB converters (cable plus a small converter box in one) on eBay, but they are relatively pricey (~$150).

author: Dave
author_rank: Super Contributor
timestamp: June 17, 2014, 01:32:26 am
content: I suggest you pick up Agilent 82357B. They aren't cheap (about $150, as you already figured out), but they work well.

author: motocoder
author_rank: Unknown
timestamp: June 17, 2014, 04:43:46 am
content: That actually seems to be the cheapest option. I am curious what the device is exposed as in Windows and Linux? Does it look like a serial port? Are there going to be driver issues in newer versions of Windows?

author: Galaxyrise
author_rank: Frequent Contributor
timestamp: June 17, 2014, 04:45:12 am
content: Do you actually know that you have need of more than 55/s? I wouldn't spend $150 without an actual use case in mind when a rs232->usb adapter is so cheap. And if you want fast readings but in short bursts, you can store them into DMM memory and then drain then out via rs232 post capture. There's enough memory for 512 readings.All my logging has been done with the meter in 6-digit mode, so rs232 was fine.

author: motocoder
author_rank: Unknown
timestamp: June 17, 2014, 04:52:36 am
content: I don't have a use case where I need that at the moment, and in fact I will probably start wth RS232. Still I wanted to research the topic in case I need to go GPIB in the future.

author: motocoder
author_rank: Unknown
timestamp: June 17, 2014, 05:05:06 am
content: So armed with the Agilent part number (82357b), I was able to find some info on the web about this. So GPIB is a very low level, simple hardware interface. That can be mapped to USB in any number of ways. The specific protocol on the PC side is as important and the hardware interface, as it determines what PC software is going to be compatible with it.Dave is right that the 82357b is the way to go, as the protocol this uses appears to be supported fairly widely. Note that there are also some Chinese clones of the 82357b that in theory should work as well. However, given the small cost difference, it's probably better to go with the Agilent part.There is also an alternative from Prologix, but seems like support for that isn't as widespread.

author: davorin
author_rank: Unknown
timestamp: June 17, 2014, 08:26:51 am
content: If you even want to go cheaper then there is a Prologix clone and firmware reports itself as Prelogix (o;One version was published in the Elektor magazine...and the one I use now can be found at:http://www.dalton.ax/gpib/Though soldering iron is needed (o;

author: motocoder
author_rank: Unknown
timestamp: June 17, 2014, 09:13:06 am
content: Quote from: davorin on June 17, 2014, 08:26:51 amI would be concerned about driver support. Seem like Agilent are keeping their drivers up-to-date for latest versions of windows.

author: davorin
author_rank: Unknown
timestamp: June 17, 2014, 09:18:26 am
content: Well..you're right (o;If someone for example can afford LabView then there is no need to go for a cheap GPIB-USB adapter...But there are also some people who can't afford it...so it also makes sense to go with a cheap or self-built adapter ;-)

author: neslekkim
author_rank: Super Contributor
timestamp: June 17, 2014, 10:59:12 am
content: What about this one?https://www.tindie.com/products/galvant_industries/gpibusb-adatper-rev3/And those agilents, can those be used with other gpib stuff?, say Keithley 2000 series?

author: davorin
author_rank: Unknown
timestamp: June 17, 2014, 11:12:11 am
content: Looks nicely built....similar to the other project I mentioned..only difference is it uses a PIC18F4520 (no internal USB) instead of the PIC18F2550. Seems like a small FTDI USB-to-seriel chip there as well...Think the main reason is that other projects are based on a sample USB code from Microchip, which can't be modified and published together.Another difference, proper GPIB line drivers...but then again...this would also require external 5V supply as the USB can only deliver 0.5A, whereas driving the maximum allowed devices needs more power...The advantage of the PIC18F2550 version is, that you can specify any baudrate you like, as there isn't any ;-)

author: AlfBaz
author_rank: Super Contributor
timestamp: June 17, 2014, 11:36:49 am
content: Quote from: neslekkim on June 17, 2014, 10:59:12 amYes.The GPIB side is just that GPIB, so if an instrument has a port for it it'll work.@motocoderYou mentioned Linux, if you plan to use it on that OS you may want to look into it further not sure if the 82357B works well or at all in Linux (driver issues)If Linux is an OS you may need look for posts by a member here that goes under the name Bingo600. He's had success with one of the cheaper, third party adaptors and posted updates or at least instructions on making updated drivers on Linux including example python scripts for data logging

author: AlfBaz
author_rank: Super Contributor
timestamp: June 17, 2014, 11:41:26 am
content: Cant find the link right now but he also managed to get the particular usb/gpib adapter he had to work on a RASPi storing data on the sd card

author: AlfBaz
author_rank: Super Contributor
timestamp: June 17, 2014, 12:03:12 pm
content: Quote from: AlfBaz on June 17, 2014, 11:36:49 amScrap that, it appears the 82357B is fine on Linux.Here's the post about it, the raspi and other assorted Linux thingshttps://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/

author: Dr. Frank
author_rank: Super Contributor
timestamp: June 17, 2014, 12:38:32 pm
content: Quote from: motocoder on June 17, 2014, 12:12:15 amWell, your PC normally has RS232 on the mainboard, only the D sub ( DB 9) plug is not assembled on the rear panel of your PC.If you have some D sub 9 jacks in your stock, then it's cheap and easy to interface the HP34401A.Decades ago, I even connected an HP48SX calculator to this instrument, so I think, the minimum 3 lines interface (RX, TX, GND) is sufficient for steering.If you go for GPIB, you may better pick a National Instruments PCI bus card.As surplus they may be available for less than 100€/$, plus cable(s).That's much better, and you later can extend your system with other instruments.Frank

author: macboy
author_rank: Super Contributor
timestamp: June 17, 2014, 12:54:42 pm
content: Quote from: motocoder on June 17, 2014, 12:29:14 amI recommend the Agilent USB GPIB. I haven't used mine much, but it seems to work very well so far. In contrast to lower cost (Prologix) or home-made ones, this one has VISA drivers, GPIB32.dll, and an Activex component for scripting (I wonder if I'm the only one using that...). This adapter will work with Agilent software, as well as Labview, etc. I got mine for a little less than $150 shipped from the far east, and it was brand new in a factory sealed box.

author: AlfBaz
author_rank: Super Contributor
timestamp: June 17, 2014, 01:07:11 pm
content: Quote from: Dr. Frank on June 17, 2014, 12:38:32 pmI considered the NI internal cards over agilent's usb offering but the mobility of a usb adaptor (laptops etc) won me over

author: davorin
author_rank: Unknown
timestamp: June 17, 2014, 01:10:11 pm
content: Besides the fact that many GPIB cards found on ebay are either PCI or ISA bus only...Think I will order one of those "strange" 82357B adapters from China and crack it open to see what's inside (o;

author: bingo600
author_rank: Super Contributor
timestamp: June 17, 2014, 07:34:21 pm
content: Quote from: davorin on June 17, 2014, 01:10:11 pmMake sure you order a Beiming USB->GPIBThis one is compatible with the Agilent Adapter , under both Windows & Linux , even uses their drivers.Don't get the "gold clone" it won't work on linuxhttp://www.ebay.com/itm/S82357-GPIB-USB-interface-Agilent-82357B-compatible-/181438006375F is faster gpib->usb xfer (it uses DMA internally)http://www.ebay.com/itm/F82357-GPIB-USB-interface-compatible-with-Agilent-82357B-/181438007391And AlfBaz got my RasPI Thread correct (Where i test both the Agilent & the Beiming using linux-gpib on a RasPI)https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/Well actually to be fair , the Beiming has a slight advantage on linux , as you don't need to load the Agilent firmware onto it via usb. It's already on it.But using fxload it's not much of a problem to load it if getting a real Agilent 82357B , don't get the A./Bingo

author: davorin
author_rank: Unknown
timestamp: June 17, 2014, 07:55:38 pm
content: Is there any documentation of the Beiming adapters how to control them directly under Linux?Like there are docs/sample code available for the Prologix adapters...or the Prelogix clone firmware where I can do a simpleHCSU DEV,BMPSCREEN_DUMPand write the output to a bmp file...Wonder if there is a big difference in speed when dumping the BMP file from My LeCroy 9354AL either with the S or F version.Do you have experience with similar DSOs?

author: motocoder
author_rank: Unknown
timestamp: June 18, 2014, 07:46:42 am
content: Quote from: davorin on June 17, 2014, 11:12:11 amLooks like the FTDI chip is an FT230X. THat's really too bad. I wish more people would use an FT232H. You can get a lot more throughput out of it, and because it comes with a DLL that abstracts the driver, you don't need to write a custom driver for it. There's even an open source equivalent.

author: motocoder
author_rank: Unknown
timestamp: June 18, 2014, 07:48:00 am
content: Quote from: AlfBaz on June 17, 2014, 11:41:26 amSort of an extended data logger? Pretty cool.

author: bingo600
author_rank: Super Contributor
timestamp: June 19, 2014, 07:19:46 pm
content: Quote from: davorin on June 17, 2014, 07:55:38 pmThe Beiming is like the Agilent , controlled by linux-gpib.Look up the doc for linux-gpibhttp://sourceforge.net/projects/linux-gpib/files/latest/download?source=filesAnother program that uses linux-gpib is gpib-utilshttp://sourceforge.net/projects/gpib-utils/files/latest/download?source=filesThis one shows nice examples of how to program via linux-gpib.I'm currently using playing with python for accessing my instruments via linux-gpib , as there areseveral language bindings built into linux-gpib./Bingo

author: motocoder
author_rank: Unknown
timestamp: June 20, 2014, 12:54:47 pm
content: Quote from: Dr. Frank on June 17, 2014, 12:38:32 pmI considered this, but the problem is my PC is maybe 10 feet or more from the meter. I think the GPIB cable is going to be rather big and bulky, and didn't think it would be practical due to the length. OTOH, I have a USB hub just a couple of feet from the instrument.I've been considering building a small Linux box that I could locate underneath the table where all my test equipment is. However, the wife has her new equipment alert system fully engaged since the purchase of the 34401A, so any new PC will have to wait.

author: Zucca
author_rank: Unknown
timestamp: June 23, 2014, 04:51:11 am
content: Newbie here.Tonight I did my first experience on connecting a 34401a with GPIB.I´m using the Beiming F82357, so far no problem and good customer support.Here the theory GPIB vs RS232 I read to give me an idea [? means I don´t fully understand why]:GPIB1) GPIB has 1MB/sec of shared bandwidht between the devices connected2) The maximum GPIB speed is equal to the lowest speed device in the chain (?)3) Up to 15 devices (?, depends on protocol implementation I believe) with 1 GPIB Adapter at the same time4) Expensive (cables and adapter) but reliableRS2321) Dedicated bandwidth PC<->Device but much slower speed2) Cheapest way to connect with PC3) max 1 device each serial port at the same timeNow I want to connect in the same GPIB bus my Keithley 220 (made in 1985) and the 34401a, I will let you know if the performance will degrade (see point 2 in the GPIB feature above).Please correct me or add comments if necessary, I want to know the truth.Thanks in advance,Z

author: motocoder
author_rank: Unknown
timestamp: June 23, 2014, 01:01:27 pm
content: Quote from: zucca on June 23, 2014, 04:51:11 amI am interested to hear your results.One thing I discovered reading the 34401a manual is that the maximum bps rate it supports is 9600, which is really quite pitiful. So it seems they are not even really taking advantage of the maximum realistic speed you can get over RS-232. My point is that the theoretical bandwidth of the interface is important, but may not be the limiting factor for the particular device you are using.

author: bingo600
author_rank: Super Contributor
timestamp: June 23, 2014, 04:27:15 pm
content: Quote from: motocoder on June 23, 2014, 01:01:27 pmWell at 100, 10 or even 1 NPLC , 9600 seems to be fineWhat would you be measuring ?/Bingo

author: bingo600
author_rank: Super Contributor
timestamp: June 23, 2014, 04:34:27 pm
content: Quote from: zucca on June 23, 2014, 04:51:11 amNone of the above would be able to overrun the Beiming , well overrun would/ought to be impossible due to the 3-way handshake on the GPIB Bus , your 2. Means the one doing the slowest 3-way handshake.So your 2. would only be active if you query both instruments at the same time.I'd expect no significant delay (even though i don't know the 220 specs)What are you guyzz measuring since you worry about the GPIB Bandwidth (or rs232) ?1000+ samples/sec or ?I'd say your use (programmig) of the GPIB Bus is prob going to be the biggest delay factor here.Not the xferrate of the bus./Bingo

author: Zucca
author_rank: Unknown
timestamp: June 23, 2014, 04:55:08 pm
content: Thanksbingo600for the clarifications.According to your information I assume the GPIB is an event triggered bus and the traffic there is generally very low, so it is very unlikely to hit the maximum bandwidth limit, at least with the 34401a.Now let´s discuss what I read about GPIB.I heard that it is possible to send over the GPIB screenshot of Spectrum Analyzer  measures, in this case while the image is being transfer the GPIB is 100% busy (no other communication possible).Now imagine I was polling cyclic every 10NPLC a Voltage measurement with my 34401a on the same GPIB Bus, at the time the SA image will be sent I think I will lose some measures.Same story with a very slow (I imagine, still have to test) 1985 device like the Keithley 220. I trigger the 220 and I hope it will give me back what I need before I need to get the data from the 34401a.Can you confirm me the GPIB is a "one talker only" bus? If yes, then the bus performance is affected by:1) Number of talker devices2) How fast they can talk3) How much they have to talkAgain, I have just started with GPIB and I say thanks to everyone in advance who is explaining me how it works.

author: Dave
author_rank: Super Contributor
timestamp: June 23, 2014, 05:11:47 pm
content: Quote from: zucca on June 23, 2014, 04:55:08 pmYes, only one device can talk in one particular moment.Not only is the transfer rate limited by how fast a device can talk, but also how fast it canlisten.Here is the timing diagram of the GPIB data and handshake lines:Lines NRFD and NDAC are pulled low by all listeners. Only when they all release NRFD line and it goes high (pull-up resistor), is the talker allowed to put data on the bus and only when they all release NDAC, does the talker know they all received the data. If you have a slow listener, the whole system has to wait for it.

author: AlfBaz
author_rank: Super Contributor
timestamp: June 23, 2014, 05:30:39 pm
content: Here's some empirical data.HP3457A at 0.005 NPLC hooked up to a function gen putting out a square wave 0 to 4V at 1Hz.I then get set ScopeExplorer to auto-refresh (get a screen grab) from my lecroy 574 every 1 second.The graph shows narrowing (spikes) of the pulses. Not shown in the pic is some complete misses of the high pulse.This is with an agilent usb adaptor

author: AlfBaz
author_rank: Super Contributor
timestamp: June 23, 2014, 05:31:59 pm
content: The above pic is zoomed in... it does go down to 0V

author: Zucca
author_rank: Unknown
timestamp: June 23, 2014, 06:15:16 pm
content: ThanksAlfBazandDave!Your answers went beyond my expectations. Now I have a clear picture on how the GPIB works. Very interesting discussion.

author: macboy
author_rank: Super Contributor
timestamp: June 23, 2014, 07:07:56 pm
content: Quote from: Dave on June 23, 2014, 05:11:47 pm...But only if the slow listeneris listening. Most of the time, there is a single listener, so throughput is essentially based on the speed of that listening alone (but also affected by cable capacitance).

author: davorin
author_rank: Unknown
timestamp: July 16, 2014, 09:53:45 am
content: Bought now one of those F82357 GPIB-USB adapters on ebay today...Seems to based on a Cypress USB microcontroller....similar to the ISP programming cable from Lattice...Let's see how well it can be reverse engineered (o;

author: neslekkim
author_rank: Super Contributor
timestamp: July 16, 2014, 02:28:05 pm
content: similar to this?http://sigrok.org/wiki/GPIB-USB_82357B_cloneExport the flash then?

author: davorin
author_rank: Unknown
timestamp: July 16, 2014, 05:12:51 pm
content: Hmm....pretty much...the Lattice Semiconductor ISP cable uses the same 68013 USB SoC...Think I have of those controllers some spare at home ;-)Line drivers I just ordered recently...

author: neslekkim
author_rank: Super Contributor
timestamp: July 16, 2014, 09:30:14 pm
content: I have a couple of thesehttp://www.ebay.com/itm/280870904109If they can be used it would have been interresting to try it.. (for my keithley 2015)

author: davorin
author_rank: Unknown
timestamp: July 16, 2014, 09:36:30 pm
content: Got a couple of those as well ;-)Tried once a Chinese Arduino Nano clone as a GPIB USB adapter...but switched to the PIC 18F2550 Preloxig clone design...much better..But still...when I switch on more than 3 devices..communication stops due to missing line drivers...and every week more instruments are coming (o;

author: neslekkim
author_rank: Super Contributor
timestamp: July 16, 2014, 10:02:02 pm
content: have been thinking about thishttps://www.tindie.com/products/galvant_industries/gpibusb-adatper-rev4/not sure what would be best, the ebay types or thisI'm not going to get more gpib stuff I guess

author: davorin
author_rank: Unknown
timestamp: July 16, 2014, 10:08:49 pm
content: Looks similar to the Prologix clone called Prelogix...just with line drivers...Biggest problem I have is that either Farnell nor Mouser have an available Centronics 24 pin connector for PCB mount....I can't tell anything yet about the Agilent clones..but what I like about the Prologix clone is the fact that I can just start a serial terminal and type in what I want to do...like setting and neasuring voltage on my 6632B with "++addr 5, volt 5, meas:curr?" (o;I intend to use my GPIB adapter in combination with MRTG or other RRD tools to log power consumption over time..and display a nice graph...

author: alex.forencich
author_rank: Frequent Contributor
timestamp: July 17, 2014, 01:30:20 am
content: If you want a convenient solution for a whole stack of equipment, I would go with a GPIB to LAN adapter. The old HP E2050A boxes can be had for quite cheap on ebay for around $100 and they bridge the GPIB bus to a VXI-11 interface. Then you can just connect it to your home network and you're good to go. The LAN port on those is only 10 Mbit, but that generally doesn't cause much of a problem. They also have the correct line drivers for a proper GPIB interface.

author: motocoder
author_rank: Unknown
timestamp: July 17, 2014, 05:24:43 am
content: Quote from: bingo600 on June 23, 2014, 04:27:15 pmNothing - making the same point you are, namely that the communications channel isn't necessarily the limiting factor.

author: scasagrande
author_rank: Contributor
timestamp: July 26, 2014, 05:36:51 pm
content: Quote from: neslekkim on July 16, 2014, 10:02:02 pmHey that's mine! I didn't see this thread earlier so sorry for the late response.If you want VISA support my adapter doesn't do that. It was designed from the beginning to avoid VISA because I didn't want to put up with it.Someone mentioned the GPIB line driver chips and how you would need an external power supply. You know that the official NI and Agilent USB to GPIB adapters also are only powered over USB? You mostly need to be able to sink current.I also work closely with anyone that has issues with my adapter be it simple issues trying to figure out an instrument's communication protocol or debugging firmware bugs. The next firmware version (v6) is currently in beta with a number of speedups, requested features, and software compatibility improvements.Oh, and its all open source! I'm trying to make open source my full time job so buying my adapter goes to support this project and others including software projects such as InstrumentKit.Here's some links:www.galvant.cawww.youtube.com/user/stevencasagrandewww.github.com/Galvant/gpibusb-firmwarewww.github.com/Galvant/InstrumentKit

author: doktor pyta
author_rank: Frequent Contributor
timestamp: October 08, 2014, 06:52:35 pm
content: https://www.eevblog.com/forum/testgear/rf-scientific-gpib-logger-v-1-0/

author: dramoto
author_rank: Contributor
timestamp: October 10, 2014, 10:23:37 pm
content: The cheaper option that I found...http://egirland.blogspot.com.es/2014/03/arduino-uno-as-usb-to-gpib-controller.html

author: macboy
author_rank: Super Contributor
timestamp: October 13, 2014, 12:20:55 pm
content: Quote from: dramoto on October 10, 2014, 10:23:37 pmThis may work or may not depending on your instruments. The main issue is the input levels of the Arduino's ATmega328. The nominal specified "high" voltage is 0.7 Vcc (or greater), which is 3.5 V at 5 V Vcc. GPIB bus uses thevenin termination which creates a floating (high) voltage of slightly less than that (around 3.3V). So the logic level specifications of the Arduino are not met, and reliable operation is not guaranteed or expected.A better option is to use a microcontroller with inputs that are (or are configurable to be) TTL level inputs. There is alsothis open-source H/W & S/W option, which uses TTL logic chips to interface to the bus.

author: dramoto
author_rank: Contributor
timestamp: November 07, 2014, 10:07:45 pm
content: Quote from: macboy on October 13, 2014, 12:20:55 pmThanks for the info.You know it well.My Arduino Gpib works with the fluke 45 but not yet with the keithley 2000

author: free_electron
author_rank: Super Contributor
timestamp: November 07, 2014, 11:22:24 pm
content: why can;t any of these home-brew gpib adapters follow the standard. it ain;t that hard. simply put the two line driver chips on there. they are like 2 $ ... and all these problems go away.

author: cellularmitosis
author_rank: Unknown
timestamp: July 16, 2017, 06:03:19 am
content: I just got logging via RS-232 working on my 34401A this evening.While reading through the manual I discovered "talk only" mode, which is by far the easiest way to get started with logging data.Using the menus, configure the 34401A to use RS-232. Then, configure the 34401A's GPIB address to be 31. This puts the device into "talk only" mode, which allows you to configure and operate the device as you normally would via the front-panel, but it automatically spits out all of the readings to the serial port. This makes it operate similarly to the cheap hand-held DMM's which have a serial data-logging option.Attached is an example of this working with CuteCom, and I've also attached a simple Python script which will log the values to a CSV file (you'll need to rename the file extension from .txt to .py).Code:#!/usr/bin/env pythonimport serialimport sysimport timeser = serial.Serial(port = sys.argv,baudrate = 9600,bytesize=serial.EIGHTBITS,stopbits = serial.STOPBITS_TWO,parity = serial.PARITY_NONE,timeout = 10)sys.stdout.write("timestamp,value\n"); sys.stdout.flush()last_sample_timestamp = time.time()while True:line = ser.readline()now = time.time()# The FTDI chip seems to buffer up a certain amount of outgoing bytes if# there is no listener to recieve them. Thus, when we first run this# script, we will get an initial flood of queued readings. Throw those# away, because we don't have a timestamp for them.if now - last_sample_timestamp < 0.1:continuelast_sample_timestamp = nowmicrovolts = float(line.rstrip()) * 1000000sys.stdout.write("%0.3f,%0.1f\n" % (now, microvolts)); sys.stdout.flush()

author: alm
author_rank: Super Contributor
timestamp: July 16, 2017, 06:58:05 am
content: Funny how the RS-232 mode is affected by the GPIB address. That would probably not be obvious to me.