Author Topic: GPIB interface (IEEE488)  (Read 20646 times)

0 Members and 1 Guest are viewing this topic.

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: gb
GPIB interface (IEEE488)
« on: February 24, 2017, 04:48:31 pm »
I have recently purchased a digital meter with a GPIB interface. I have been looking at how to connect the meter to a PC to explore programming it, but I have found that the GPIB adapters cost as much as the used meter! Strangely, there also seems to be a complete lack of the usual far east 'alternatives'. Does anyone know if there is a cost effective way of building a GPIB interface?
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 3418
  • Country: us
Re: GPIB interface (IEEE488)
« Reply #1 on: February 24, 2017, 04:54:44 pm »
LQ Electronics sells a cheap one.  Not a lot more than you would pay for the parts for a home brew version. 

Here is a link to a roll your own approach

http://www.edn.com/design/test-and-measurement/4318969/Build-a-USB-based-GPIB-controller
 
The following users thanked this post: rachaelp

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: GPIB interface (IEEE488)
« Reply #2 on: February 24, 2017, 05:12:03 pm »
If you do not have GPIB adapter you can build GPIB from Arduino.
http://egirland.blogspot.cz/2014/03/arduino-uno-as-usb-to-gpib-controller.html
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1409
  • Country: dk
Re: GPIB interface (IEEE488)
« Reply #3 on: February 24, 2017, 05:13:05 pm »
LQ Electronics sells a cheap one.  Not a lot more than you would pay for the parts for a home brew version. 

Here is a link to a roll your own approach

http://www.edn.com/design/test-and-measurement/4318969/Build-a-USB-based-GPIB-controller

That's an Old design , Don't ....

Either get a "Clone Agilent/NI USB adapter" , or for a tryout make this one (costs an arduino)  , the GPIB connector is more expensive than the arduino.
https://egirland.blogspot.dk/2014/03/arduino-uno-as-usb-to-gpib-controller.html

Edit: Damm beaten by Plesa   :box:
/Bingo
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: GPIB interface (IEEE488)
« Reply #4 on: February 24, 2017, 05:16:49 pm »
LQ Electronics sells a cheap one.  Not a lot more than you would pay for the parts for a home brew version. 

Here is a link to a roll your own approach

http://www.edn.com/design/test-and-measurement/4318969/Build-a-USB-based-GPIB-controller

That's an Old design , Don't ....

Either get a "Clone Agilent/NI USB adapter" , or for a tryout make this one (costs an arduino)  , the GPIB connector is more expensive than the arduino.
https://egirland.blogspot.dk/2014/03/arduino-uno-as-usb-to-gpib-controller.html

Edit: Damm beaten by Plesa   :box:
/Bingo

If you want I have box of blue GPIB connector in my garage, I can ship them for shipping cost or small donation to charity :)
I made quite good GPIB cables out of it.
Check this thread
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/new/?topicseen#new
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
Re: GPIB interface (IEEE488)
« Reply #5 on: February 25, 2017, 01:09:59 am »
LQ Electronics sells a cheap one.  Not a lot more than you would pay for the parts for a home brew version. 

Here is a link to a roll your own approach

http://www.edn.com/design/test-and-measurement/4318969/Build-a-USB-based-GPIB-controller
Uh, you might want to avoid the UGSimple model though.  No better than the self-made ones (might have difficulties driving multiple or old devices, mine at least does).  Can't speak about the Windows software, but the one for Linux is among the worst I've ever encountered.

I ended up buying a cheap PCI based pre-enjoyed one (with CEC chipset) of e-bay.  That one works fine with the linux-gpib library.
 

Online bitseeker

  • Super Contributor
  • ***
  • Posts: 8106
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: GPIB interface (IEEE488)
« Reply #6 on: February 25, 2017, 02:02:10 am »
There are three models of the LQ interface. Here's a comparison table. The UGSimple and UGPlus do not have line drivers and, as a result, cannot support many devices on the GPIB bus.

More importantly, if you ever want to use the interface with standard GPIB control software, the LQ interfaces use proprietary libraries and won't work without recompiling. For tinkering, the Arduino solution may be the best way to get started, especially if you already have one lying around.

ModelMax. command/data lengthBinary data transferScreen image captureGPIB script featureFile read and saveMax. GPIB devicesHold screws
UGSimple60NoNoNoNo<5No
UGPlus20,000YesYesYesYes<5No
UG0120,000YesYesYesYes14Yes
« Last Edit: February 25, 2017, 02:03:48 am by bitseeker »
I TEA.
 

Offline mmagin

  • Frequent Contributor
  • **
  • Posts: 613
  • Country: us
Re: GPIB interface (IEEE488)
« Reply #7 on: February 25, 2017, 04:06:28 am »
If you have more time than money, or if it's a fascinating project to you:

First, if you can put the instrument in talk-only mode (certainly possible with older HP DMMs) where it just spits out the readings at the rate it's triggered at, I believe you can hook a 5V-tolerant microcontroller (e.g. AVR/PIC) to the 8 DIO lines and the DAV line and cobble together a listen-only interface pretty easily.

Going a little bit further than that:
https://egirland.blogspot.com/2014/03/arduino-uno-as-usb-to-gpib-controller.html
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: gb
Re: GPIB interface (IEEE488)
« Reply #8 on: February 25, 2017, 01:00:42 pm »
As it happens, I have one of those Arduino UNO kits now waiting for a real world project. I will probably prototype it first using the kit and then use a far east clone for a more permanent solution. I have PM'ed you, plesa, about those GPIB connectors.

I do also have an FT USB serial adapter somewhere although I would have to dig it out and check that it is suitable for this project. I do know it was TTL 5v as I used it to control the shutter on my old camera. However, I tend to agree that the Arduino option might be the easiest to get started with.

Incidentally, I also have a Rigol 1054Z and have their UltraSigma and UltraScope software installed. The former is a communications framework which allows screen grabs and talking to the instrument interface manually and it works well over USB or LAN. However, it also has a GPIB and RS232 option. The GPIB option allows for the setting of a serial COM port for comms. I was wondering whether once I have a USB-to-GPIB hardware set up, whether it would allow me to talk to a non-Rigol instrument at least at rudimentary level?




 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: au
Re: GPIB interface (IEEE488)
« Reply #9 on: February 25, 2017, 04:36:32 pm »
That Arduino Uno gpib project is brilliant!. Just tried it with an Arduino Deumilanove and it worked first time.

I didn't have a connector, so I cut a gpib cable in half. I have a couple of those $3 CH340 Arduino boards on order and I will use the cable to make two gpib controllers.

Just finished trying it out with a HP 33120A waform gen. and a Time 9811 programmable resistance. All the commands I tried worked.

The cable cost me $10 and so that works out at about $8 per gpib controller.
« Last Edit: February 25, 2017, 04:40:48 pm by amspire »
 

Online bitseeker

  • Super Contributor
  • ***
  • Posts: 8106
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: GPIB interface (IEEE488)
« Reply #10 on: February 25, 2017, 06:48:07 pm »
That was quick, amspire. Congrats on your nearly instant, low-cost GPIB controllers and thanks for sharing your results.
I TEA.
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: au
Re: GPIB interface (IEEE488)
« Reply #11 on: February 26, 2017, 04:58:52 am »
Just thought I would add some notes about my experience at building the Arduino Uno 6.1 GPIB interface.

http://egirland.blogspot.com.au/2014/03/arduino-uno-as-usb-to-gpib-controller.html

It is probably better getting the files from github, as you get the documentation as well in the zip file.
https://github.com/larsks/arduino-gpib

The code runs fine on my Deumilanove board, and as mentioned before, I just cut a GPIB cable in half for the connection. I secured the cable with a tie through one of the mounting holes and tacked the tie to the cable in a few spots with the soldering iron to stop the cable from rotating. The board I used was a cheap Arduino clone, but with with real FTDI chip. Any working RS232 interface chip should work.

Get the Prologix manual to get some extra documentation on the ++ commands.
http://prologix.biz/downloads/PrologixGpibEthernetManual.pdf

The Serial Monitor built into the Arduino IDE is fine for testing.

Initially, use verbose mode ("++verbose"). The first command you must do is to set the correct GPIB target address. If the target device has the address set to 13, use "++addr 13". Many devices will want the EOI (end of information, I guess) to be enabled - "++eoi 1" .

If you send a command requesting information, you will need to follow it with a ++read command. If you enable auto mode ("++auto 1"), it will automatically do reads after every command, and so you will get errors whenever the command has no return data. These errors are usually benign.

The project is designed to talk to just one GPIB device, but one of the users has controlled 3 devices connected to the Arduino. It can overheat the ATmega324P chip, particularly if it is a small form factor chip.

Last time I checked, the price of getting a PCB mount right angle male 24 pin Centronix connector for use as the GPIB connector was pretty high. Cables are much easier to get and they give you two connectors.

Richard.



« Last Edit: February 26, 2017, 05:11:17 am by amspire »
 
The following users thanked this post: lowimpedance, daqq

Online bitseeker

  • Super Contributor
  • ***
  • Posts: 8106
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: GPIB interface (IEEE488)
« Reply #12 on: February 26, 2017, 10:38:44 pm »
Thanks for sharing your notes, Richard. Nice job with the wiring! When you receive those other Arduino boards, do you plan to add some driver chips or transistors to handle the load of the bus/devices?
I TEA.
 

Online Johnny10

  • Frequent Contributor
  • **
  • Posts: 671
  • Country: us
Re: GPIB interface (IEEE488)
« Reply #13 on: February 26, 2017, 11:48:37 pm »
I see you are not in the states... this may not be for you with customs and taxes?
but I just bought an NI PCI-GPIB card that worked first time I plugged it in.
It found different test equipment pretty quickly. I connected 7000 series TEK scope and HP 8903.

Total cost including shipping $45.00 I see others available similar prices.

I have been looking for these cards for a year now and they have always been over 150 dollars.
Glad they are getting cheaper.


http://www.ebay.com/itm/National-Instruments-PCI-GPIB-IEEE-488-2-PCI-Card-tested-/262871248479?hash=item3d3458ee5f:g:wZgAAOSwj85YPGd2

Tektronix TDS7104, DMM4050, HP 3561A, HP 35665, Tek 2465A, HP8903B, DSA602A, Tek 7854, 7834, HP3457A, Tek 575, 576, 577 Curve Tracers, Datron 4000, Datron 4000A, uTracer, HP5335A, EIP534B 20GHz Frequency Counter, TrueTime Rubidium, Sencore LC102, Tek TG506, TG501, SG503, HP 8568B
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: au
Re: GPIB interface (IEEE488)
« Reply #14 on: February 27, 2017, 12:35:46 am »
Thanks for sharing your notes, Richard. Nice job with the wiring! When you receive those other Arduino boards, do you plan to add some driver chips or transistors to handle the load of the bus/devices?
Probably not. I like the idea that you can do gpib with just an Arduino and connector or cable. Unfortunately, even though this project is open source, it is a CC Nonderivative license. In other words, even though it would be dead easy for people in this forum to extend the functionality, no-one can share improved versions.  |O 

I am just going to use it as is, and if I want serious gpib, I will go and get an Agilent or Prologix device.
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: au
Re: GPIB interface (IEEE488)
« Reply #15 on: February 27, 2017, 12:47:53 am »
I see you are not in the states... this may not be for you with customs and taxes?
but I just bought an NI PCI-GPIB card that worked first time I plugged it in.
It found different test equipment pretty quickly. I connected 7000 series TEK scope and HP 8903.

Total cost including shipping $45.00 I see others available similar prices.
I have seen lower prices. I actually had an ebay ad on my browser for an A$77 PCI GPIB card when I read your post. Trouble is it has to run from a desktop PC.

One of the good things about this Arduino gpib is that as well as working with notebooks, it can easily be controlled by a low cost, low powered device like an OrangePI zero, or Raspberry Pi. It just means you can cheaply set up a long term monitoring of, say, voltage references without involving PC's.
« Last Edit: February 27, 2017, 04:36:09 am by amspire »
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: gb
Re: GPIB interface (IEEE488)
« Reply #16 on: February 27, 2017, 06:49:06 pm »
Vendor must have put the price up since its now 60$.....

Although it is one option, I'm not keen on a PCI card as I would preferably like to use the laptop. Interesting point about the CC Nonderivative license. Presumably it does not prevent me from improving it for my own purposes then? Its a shame that any improvements cannot be shared. The |O expresses my thoughts on that as well.
« Last Edit: February 27, 2017, 06:50:37 pm by WaveyDipole »
 

Online bitseeker

  • Super Contributor
  • ***
  • Posts: 8106
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: GPIB interface (IEEE488)
« Reply #17 on: February 27, 2017, 07:48:17 pm »
Correct, you can do whatever you want with it for your own use. You just can't distribute your improved firmware. Of course, you could contact the author about pulling your changes into the main code base. That could still benefit the community.

Failing that, you could post about what you did to improve it. We're keen on reading about it.
I TEA.
 

Offline mmagin

  • Frequent Contributor
  • **
  • Posts: 613
  • Country: us
Re: GPIB interface (IEEE488)
« Reply #18 on: February 27, 2017, 07:59:24 pm »
Somewhat related to this, I have also wondered if a good route to a reliable GPIB interface is to use one of these NI GPIB-232CV adapters you find on ebay with any old USB-serial adapter.  It's old and fairly cheap, but you're not locked into something like ISA or PCI.

I'm less interested in specific drivers or anything, I like stuff I can just open a connection to better than stuff that uses a wonky API (which is why I find myself liking the Prologix stuff much more than the classic Agilent, NI, etc. stuff supported by Linux GPIB).
 

Online bitseeker

  • Super Contributor
  • ***
  • Posts: 8106
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: GPIB interface (IEEE488)
« Reply #19 on: February 27, 2017, 08:03:56 pm »
That's an interesting idea. I don't see why it wouldn't work for normal control purposes, as long as the USB-RS232 adapter works well (some can be flaky).
I TEA.
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: au
Re: GPIB interface (IEEE488)
« Reply #20 on: February 28, 2017, 12:02:18 am »
Correct, you can do whatever you want with it for your own use. You just can't distribute your improved firmware. Of course, you could contact the author about pulling your changes into the main code base. That could still benefit the community.

Failing that, you could post about what you did to improve it. We're keen on reading about it.
What I am working on right now is running Emanuele Girlando's Arduino GPIB board from a OrangePi One PC board. The board is running 16.04 Ubuntu with a lightweight XFCE desktop interface via TightVNC. I just love the idea of a computer + GPIB that uses less then 2W. I have a UPS that could easily run this along with a DVM for about 10 hours from the battery, so it makes sense for getting good uninterrupted logging.

So right now I am concentrating on setting myself up to do Python coding on the OrangePi to talk to the Arduino GPIB. Tried some quick serial code, and it is hanging - have to debug that.

The tools that run well on the OrangePi include the Arduino IDE, Geany (Python IDE), Glade (if I want to make any GUI for Python).

IDEs like Eclipse and PyCharms absolutely kill the computer with RAM usage.

Looks like I am going to bite the bullet and learn how to use Vim (gulp) as a Python ide. Very powerful, and it just flies on the low powered OrangePi. In typical Vim practice, I have had to recompile Vim to add all the features needed for IDE use, I have had to sort out a .vimrc that makes it possible to read comments (by default dark blue) on the black terminal screen background, and I will next have to learn how to do plugins (complex - but can be simplified with even another plugin). I am always using vi or vim, so I may as well learn how to use it properly.

I guess it is possible to make some changes to the Arduino GPIB code as long a it is the form of patches that can be added to the original code. The features I would like to add include SRQ (I think someone has already published code for this) and "++read EOI" so I can efficiently read a multi-line response from an instrument. It shouldn't be that hard to implement the "++read (char)" functions as it just means to continue to read lines until you get the character (char) from the instrument.

Richard
 

Online bitseeker

  • Super Contributor
  • ***
  • Posts: 8106
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: GPIB interface (IEEE488)
« Reply #21 on: February 28, 2017, 12:38:09 am »
Low-power servers are really cool. I've been running a PogoPlug with portable external drive at home for a file server for a while now. Although I haven't measured the setup, it's really low power consumption, too.
I TEA.
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: au
Re: GPIB interface (IEEE488)
« Reply #22 on: March 01, 2017, 08:18:58 am »
Making progress. Finally got my Python code running on my OrangePI to reliably talk to the Arduino GPIB. After powering up the Arduino, the first communication always failed, but if I used a terminal, it always worked first time.

I had the scope out, then the logic analyser which all showed no problem at all.

Finally worked out that the Arduino Duemilanove has the lovely property that before you connect to the serial port, the DTR is 5V. The first time you connect to the USB serial port, the DTR goes low which resets the Arduino via a capacitor coupling. Stays low after that.

The reason why the terminal always worked was I always took more then 1.5 seconds to send a command after opening.

I gather the FTDI rs232 behaviour is well known - I just didn't know.

I guess the CH340 boards I have on order will do the same thing. It is OK - just needs a 2 second delay after opening the serial port - but it probably means I should just leave the port open all the time while the python code is running.

I may do some changes to Emanuele's code and I will just use Linux diff and patch to record the changes to get around the NoDerivative license. Is that legal?

Here is the words from the CC nonderivative license:

Quote
NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.

It is OK to freely distribute unmodified CC NoDerivative-licensed source code. Not sure about a diff file that can modify this source. Any opinions?

I have got my up-to-date Cygwin diff and patch for use on Windows, but the other thing I discovered is I had to rename patch.exe, since if a program contains the word "patch", Windows insists it has to be run under administrative permissions. If you rename any program patch.exe or somethingpatch.exe, it will suddenly only run under Administrative permissions. If it is renamed to pa_tch.exe, it is fine.
« Last Edit: March 01, 2017, 08:47:22 am by amspire »
 

Offline jimmc

  • Frequent Contributor
  • **
  • Posts: 280
  • Country: gb
Re: GPIB interface (IEEE488)
« Reply #23 on: March 01, 2017, 02:48:35 pm »
I have used Emanuele's code with an Arduino Nano (CH340 clone), I got over the DTR reset problem as below. (Crude but it works for me).
The logic levels and drive capability are not within specification but I have tried it with older instruments using the Texas and Motorola chipsets without problems. (Only one at a time)

OK it's not a guaranteed solution but for a total cost of a few GBP I'm happy.

One other thing I didn't like about the code was that the GPIB lines were driven high see comments from my code below.

// Modified to use 'Open Collector Mode' to follow GPIB specification...
// Asserted   (Low state)   digitalWrite(xx, LOW); pinMode(xx, OUTPUT), This way round to ensure output never 'glitches' to +5v
// Unasserted (High state)  pinMode(xxx, INPUT_PULLUP), High by internal pullup only (20-50 kOhm)
 
// Arduino Nano clone using CH340G.  CTS & DSR lines asserted by grounding pins 9 & 10 of CH340G (needed for compatibility)
// 100 ohm from Arduino RST to 5v via jumper. Inhibits DTR reset starting bootloader.
// Also incorporates Florian's comment.
// ++ver reply changed to "Girlando GPIB-USB Controller modified version 6.1.1"

It's now recognised by EZ-GPIB and KE5FX GPIB Toolkit but I have not taken this any further.

Unfortunately the RF Scientific GPIB Logger v 1.0 from doktor pyta looks for the VID&PID of a FTDI device and does not work. This was the one I really wanted :(

Pity about the no Derivatives licence.

Jim

p.s.
I know there is a high speed version of the GPIB spec that uses 'active high' drivers but for low speed devices like this it's much safer (for the instrument) not to use this mode.
« Last Edit: March 01, 2017, 03:16:25 pm by jimmc »
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 1990
  • Country: ca
Re: GPIB interface (IEEE488)
« Reply #24 on: March 01, 2017, 05:39:06 pm »
Be careful with these Arduino based GPIB adapters, they do not meet the electrical (layer 1) requirements for GPIB. The spec says that a logic high can be as low as 2.0 V, and because of the thevanin termination, it will actually never be higher than about 3.3 V on Tri-state open-collector systems, i.e. nearly all of them. The 2.0 V spec is fine with TTL input devices, but the Arduino has only CMOS inputs. That means that a logic high (with 5 V Vcc) should be presented to the input pin as > 0.6*Vcc or > 3 V. and a logic low should be < 0.4*Vcc or < 2 V. (To get even more specific, look at the Atmega328P datasheet, graphs for "Input Pin Threshold and Hysteresis"). It may work, but is certainly not guaranteed. A better idea is a micro with TTL inputs, either fixed or configurable.  Besides the logic level problems, there is also the need for 50 mA of current sink per line. You can kind of get around this issue by only loading the bus with a single device (more devices = more terminations to sink current from).
« Last Edit: March 03, 2017, 04:13:13 pm by macboy »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf