EEVblog Electronics Community Forum

Products => Test Equipment => Topic started by: Gandalf_Sr on October 04, 2016, 12:04:19 pm

Title: Gathering data into Excel
Post by: Gandalf_Sr on October 04, 2016, 12:04:19 pm
G0HZU mentioned in a thread about the HP3458A (https://www.eevblog.com/forum/testgear/agilent-3458a-gpib-data-aquisition-software-and-options/msg1040083/#msg1040083) that the easiest (and cheapest) way to gather data into a PC is by using Excel.  I'm familiar with Excel's VB macro language, is this how it's done?

I have several pieces of test gear that have GPIB (although I think my $60 'Agilent' 82357B USB-GPIB bought on eBay may be a fake) or my new Agilent 34461A which does not have the GPIB option but comes with Ethernet as standard.

I'd appreciate some pointers as to where to start on writing utilities that can read from the various instruments to gather data into an Excel spreadsheet.

Am I right in saying that, once I've established a port on my PC, presumably by some kind of driver installation, I could run up a terminal program and type commands that will elicit responses from the various pieces of connected gear?

Thanks in advance for any help.
Title: Re: Gathering data into Excel
Post by: StuUK on October 04, 2016, 12:05:55 pm
G0HZU mentioned in a thread about the HP3458A (https://www.eevblog.com/forum/testgear/agilent-3458a-gpib-data-aquisition-software-and-options/msg1040083/#msg1040083) that the easiest (and cheapest) way to gather data into a PC is by using Excel.  I'm familiar with Excel's VB macro language, is this how it's done?

I have several pieces of test gear that have GPIB (although I think my $60 'Agilent' 82357B USB-GPIB bought on eBay may be a fake) or my new Agilent 34461A which does not have the GPIB option but comes with Ethernet as standard.

I'd appreciate some pointers as to where to start on writing utilities that can read from the various instruments to gather data into an Excel spreadsheet.

Am I right in saying that, once I've established a port on my PC, presumably by some kind of driver installation, I could run up a terminal program and type commands that will elicit responses from the various pieces of connected gear?

Thanks in advance for any help.

And you could do that all from VBA in Excel if required
Title: Re: Gathering data into Excel
Post by: PA0PBZ on October 04, 2016, 02:32:45 pm
Watch this:

 https://www.youtube.com/watch?v=VQ3kwS7pLl8 (https://www.youtube.com/watch?v=VQ3kwS7pLl8)
Title: Re: Gathering data into Excel
Post by: bingo600 on October 04, 2016, 06:21:17 pm
IMHO

Python to read gpib data , and then write output/processed data to a CSV file is much more general.
Would work on any major OS , not not Excel specific.

/Bingo
Title: Re: Gathering data into Excel
Post by: Jester on October 04, 2016, 07:03:05 pm
I just did this using VB to get data from a Tek scope, very easy and works well.
Title: Re: Gathering data into Excel
Post by: G0HZU on October 04, 2016, 08:20:36 pm
Yes, it should be quite easy to get basic data this way. However, I think it's eventually worth progressing to something a bit more powerful like Python.

I tend to do everything in VB and I use an ancient version of Visual Studio for stuff like this. See below for a basic logger I put together to look at PSU stability over time using VB. It gives an autoscaling graph display and also logs the data to a text file if I want to export it to excel.

It also timestamps the data using an accurate timer derived from the main clock oscillator on the motherboard and this can time events with a resolution below 1ms very accurately over a long time period. The native timer function in VB isn't very accurate by comparison and best avoided for stuff like this.

The actual commands sent to the DMM are very simple, pretty much the same things that would get sent by Excel but the neat thing is you can present the results in many ways using the various visual features available in VB. eg the graph is just a built in function in VB and I just update the graph with a new data value each time I get a result from the DMM and I add another row to the graph ready for the next datapoint. So this makes the graph look like it is updating/resizing in real time. Very easy to do...

The 'display' on the DMM is just a simple text label placed over a jpg of a DMM and the font colour chosen to look like the same colour as the DMM. I just update the label text every time I read the DMM. Crude but adequate :)

The tools I've used for this are old so it's very much a case of old dog, old tricks. I'm trying to escape from VB and learn how to do stuff like this in Python.

https://youtu.be/BZWAhtpVqFs
Title: Re: Gathering data into Excel
Post by: G0HZU on October 04, 2016, 08:41:24 pm
Also, it's worth going on youtube and searching for the various 'command expert' videos from Keysight. There are quite a few of them and some are more helpful than others and the one already linked to by PA0PBZ is one of the better ones.

There's a couple of good ones by Bill Griffifths and some others too.
Title: Re: Gathering data into Excel
Post by: Gandalf_Sr on October 05, 2016, 12:05:15 pm
Sigh, so I watched the movie (which was good) but then tried to make it work with my $60 eBay "Agilent 82357B compatible" USB-GPIB adapter that I bought in March; I got error messages saying that Windows 10 could not work with the USB device and no GPIB devices at all were seen in Keysight Connection Manager which came with my new Keysight 34461A multimeter.  I sent a message to the eBay seller of the "82357B" (nettcy168) saying it was clearly a fake and definitely not "Agilent 82357B compatible" - the seller has replied apologetically and said he will refund me.

So now I need to buy a USB-GPIB interface, or maybe an Ethernet-GPIB device like the E5810A.  I see a load of NI GPIB-USB-HS adapters but many are from China, they start at $168, and I'm not at all sure that they aren't fakes either.  I should be able to get an E5810A for around $260 and it seems to me that Ethernet might be the better way to go bandwidth-wise, any thoughts or suggestions?
Title: Re: Gathering data into Excel
Post by: tszaboo on October 05, 2016, 12:15:43 pm
Sigh, so I watched the movie (which was good) but then tried to make it work with my $60 eBay "Agilent 82357B compatible" USB-GPIB adapter that I bought in March; I got error messages saying that Windows 10 could not work with the USB device and no GPIB devices at all were seen in Keysight Connection Manager which came with my new Keysight 34461A multimeter.  I sent a message to the eBay seller of the "82357B" (nettcy168) saying it was clearly a fake and definitely not "Agilent 82357B compatible" - the seller has replied apologetically and said he will refund me.

So now I need to buy a USB-GPIB interface, or maybe an Ethernet-GPIB device like the E5810A.  I see a load of NI GPIB-USB-HS adapters but many are from China, they start at $168, and I'm not at all sure that they aren't fakes either.  I should be able to get an E5810A for around $260 and it seems to me that Ethernet might be the better way to go bandwidth-wise, any thoughts or suggestions?
The E5810A works, only windows. I dont think it is worth the money honestly. I would only use it if I need to build in into a rack, production environment.
The E5810A cannot even detect the 3458A correctly, because the 3458A is missing a GPIB command and Agilent just cannot be bothered to fix it.
I would use a third party GPIB-Ethernet bridge. I would not bother with GPIB-USB.
Title: Re: Gathering data into Excel
Post by: Gandalf_Sr on October 05, 2016, 01:35:23 pm
Thanks NANDBlog, do you have any specific recommendations for a third party GPIB-Ethernet bridge?
Title: Re: Gathering data into Excel
Post by: Gandalf_Sr on October 05, 2016, 10:18:53 pm
I picked up an HP E5810A today on eBay for $240 shipped, I only use windows so I think it's going to work for me.
Title: Re: Gathering data into Excel
Post by: G0HZU on October 05, 2016, 11:00:09 pm
Note that the genuine 82357 USB/GPIB adaptor cables can be fussy things to work with in my experience. At work we moved across to the NI USB/GPIB adaptors a few years ago because the 82357 devices were taking too long to debug on various PCs with various versions of the Agilent IO library installed.

Today, we have a large box stuffed with (genuine) 82357A and B adaptors that nobody wants to use because the (genuine) NI adaptors seem to be much more robust when first setting them up. I think I'm the only person to be using an 82357B at work and I use it to get data from Agilent VNAs via GPIB.

Here at home I have a genuine 82357A adaptor and I try to avoid using library updates from Agilent because the later IO libraries seem to cause loss of function on some applications.
Even then I sometimes have to remove/refit the cable to even read the device in connection expert. It's all a bit flakey IMO.

But when it does work, it always works reliably if that makes sense. i.e. once a connection is established it seems to be flawless in operation.
Title: Re: Gathering data into Excel
Post by: G0HZU on October 05, 2016, 11:48:20 pm
Here's an old datalogging program I wrote when I first bought my Keithley 2015THD DMM about 3 years ago. It is written in VB using similar commands to the ones you would use in Excel VB but it graphs the results on a bar chart. The bar chart is a library function written in VB and I just load DMM data into it. So I didn't create the bar chart, I just loaded it from a VB library and used it to display DMM data.

You can see it measure a square wave, then a triangle wave then a fairly pure sinewave at 1kHz.

The PC is sending a lot of GPIB commands per second to the Keithley 2015THD to maintain all the data on the screen. It is a bit slow when 15 harmonics are displayed as you can see, but it is still usable. It gets markedly slower if you display (say) 50 harmonics and it takes about a second to refresh a full screen of data with 50 harmonics in the bargraph.

This shows why it's worth stepping beyond VB in Excel because it isn't that much harder to present the data in a graph like this. You just have to make sure you put the data for each harmonic in the relevant bar in the graph as you send a command to measure each harmonic level.

Writing code to read the harmonic levels with a mouse and marker is a bit trickier but only needs a few lines of code in VB to use the mouse to grab trace data.

https://youtu.be/S3fAyXyUbOw
Title: Re: Gathering data into Excel
Post by: Gandalf_Sr on October 05, 2016, 11:53:30 pm
G0HZU,

Thanks for all that information, I'm glad I didn't get another USB-GPIB adapter, they seem like they are more trouble than they are worth given that 99% of them sold on eBay seem to be fake although you do seem to  be recommending the NI USB/GPIB adapters, I've been reading a lot about those including people saying that the NI driver software reports that the adapter it's connected to is a fake but continues to work.

Do you have any experience to share or comments about using the HP E5810A or it's reliability?
Title: Re: Gathering data into Excel
Post by: G0HZU on October 06, 2016, 12:14:15 am
No sorry, I've never used an HP E5810A. It seems to be an expensive item, I bet they cost a lot when new.
Title: Re: Gathering data into Excel
Post by: tszaboo on October 06, 2016, 10:23:24 am
Thanks NANDBlog, do you have any specific recommendations for a third party GPIB-Ethernet bridge?
For future reference, I think I've used the Prologix. Anyway, good luck with the E5810A.
Title: Re: Gathering data into Excel
Post by: HighVoltage on October 06, 2016, 10:32:36 am
I have a new "Keysight" branded E5810A but I have not been able to get it properly integrated into the I/O Library and / or BenchVue.
The browser interface of the E5810A is pretty good and I can see all the hooked up GPIB instruments.
It probably just requires some time to set it all up.

Title: Re: Gathering data into Excel
Post by: Gandalf_Sr on October 11, 2016, 12:37:35 am
My HP E5810A arrived today and it's in great shape and looks like it's genuine; I also won an NI GPIB-USB-HS which I'm pretty certain is the real thing but it won't get here until Wednesday.  Both were from eBay.
Title: Re: Gathering data into Excel
Post by: HighVoltage on October 11, 2016, 07:26:05 am
For my E5810B to properly work, I had to reinstall the connection expert and I/O Libraries.
Now it works extremely well and new instruments hooked up via GPIB are automatically detected.
Title: Re: Gathering data into Excel
Post by: Gandalf_Sr on October 14, 2016, 01:06:51 pm
Here's my experiences so far in interfaces on my Windows 10 64 bit PC environment.

The E5810A arrived, I plugged it into power and LAN and it was found immediately by Keysight Connection Expert (KCE), I was then able to connect GPIB instruments to it and they are seen through KCE. 

I then tried the NI GPIB-USB-HS adapter - it wasn't recognized by Windows so I went to NI looking for the driver.  First I had to create an account and then download a 683 MByte Zip file that expanded to a 901 MByte install folder on C: from which the installation started.  It then warned me that another VISA driver (the one from KCE I assume) was present and it was going to replace and rename that other VISA driver - at that point I stopped the installation, backtracked and uninstalled the almost 2 G bytes of junk it had put on my system.  SURELY there's a simpler USB driver that I can install for just the NI GPIB-USB-HS which will then work with via KCE?

I did open the NI GPIB-USB-HS up and it has a metalized coating inside the plastic case - I'm pretty certain it's a genuine one.