GPIB on Linux for HP Test Gear
ฝัง
- เผยแพร่เมื่อ 7 ก.พ. 2025
- I adore all of my GP-IB/HP-IB test gear and have been wanting a way to use it all more conveniently with modern computers. So after some trial and error, this is how I prefer to setup and use this kind of hardware with linux.
Find my code here: github.com/AkB...
Here are some ways to help me make more videos!
Buy some Merch:
Merch: tech-tangents....
Leave a one time tip:
Paypal one-time: paypal.me/AkBKukU
Ko-fi: ko-fi.com/tech...
Amazon Wishlist for Production Gear:
www.amazon.com...
Become a monthly supporter:
Patreon: / akbkuku
TH-cam Membership: / @techtangents
Paypal Monthly: techtangents.n...
Other Links
TH-cam: / akbkuku
Twitch: / techtangents
Fediverse: dialup.space/@...
Github: github.com/AkB...
Thingiverse: www.thingivers...
Discord: / discord
Some minor errata on the setup process, I put up the message on screen that you may need to run "./bootstrap" for the user setup. But you will possibly also need the python package "setuptools" to get the module to build correctly. I tested this again on another computer I had done less on and it was needed for the build process there.
1970s/1980s-era HP has to be one of the most exciting and innovative companies that ever existed.
The required timeout is not the case in actuality. The long measurement time is due to the resolution the measurement is being taken with. If you reduce the precision, you’ll get faster measurements.
If you want to earn your SCPI/GPIB ninja badge, read up on the Serial Poll functionality. You set some registers as to which events (eg measurement or “operation complete”) trigger the SRQ line to get asserted or the SRQ bit in the status register. You only then need to poll the status register (which is hard-lines on the bus), and do a read once the bit/line is asserted. It’s much lower overhead and fast compared to having to wait a fixed timeout. The same approach is used across all GPIB instruments that support Serial Poll.
There is likely a good clear example of using serial poll in the DMM Programming Manual.
Yep. The event based stuff is what makes GPIB special. (And different from typical serial port applications). It works a lot like interrupts on microcontrollers (/PCs without an OS/just DOS).
That mondo card you were showing seems to be an HP 82321A - HP BASIC Controller, I believe they were colloquially known as "Viper Cards" and they're pretty much a 68K unix card that runs HP's version and uses the local PC as an IO tool. HP also did a later version of it, the HP 82324B (not sure if they did an A) Measurement Coprocessor - Colloquially known as the "Hyper Viper" (I again I believe) - I have one of those in my multi-OS Dolch Pac 65 so I can run old HP Test & Measurement gear software that would normally expect a Series 200/300 machine.
The NI GPIB-RS232 that you showed can be imagined as the same as the NI GPIB-USB-HS - It's simply a GPIB adapter and can address all the instruments on the bus. I'm not familiar with any serial GPIB controller that could only work with a single device - I'm not saying there isn't one, just that I can't remember ever seeing one. Devices like the Prologix, AR488, etc can all drive the full addressable GPIB bus I believe.
Anyway, love the content and look forward to your new videos - I'm going to go back and watch the 16500C ones as I missed those when released.
I just looked up the NI GPIB-RS232 and it is a bit weird compared to the NI GPIB-232 adapters - If the manual is to be believed then it can operate in a controller mode but it can also operate in just a serial host mode - I wonder why they did this compared to the GPIB-232 series? Anyway I stand corrected about your comment on "the way it is setup now"
[UPDATE] Reading a bit more of the manual I think they created C mode so that people could simply take talker/listener devices that were on a GPIB bus and let them be used directly from the PC - For example, you can configure the HP 53131A to just be a talker so your PC could then grab whatever frequency results were "talked" by the counter - Anyway, it'd be interesting to find out why from the people who were there when it was created.
You hit the nail on the head with the big HP card, it's the BASIC Language Processor. I got it specifically because it's basically the same as the HP Series 200 that I have, it's so cool!
And as you discovered, that GPIBRS232 adapter I have is indeed a bit odd. The benefit to the single device mode is that you don't have to handle addressing at all. You can just send the commands as if it was any other serial device.
@@TechTangents I'm looking forward to what you show the Viper card doing - I got the 82324B because I didn't want to have to spin up a complete series 200/300 unit to run the software (which is also why I used the Dolch Pac, I can lift it onto the bench and have everything I need in one small-ish unit).
The talker/listener thing is something that I've never really used, I know that it is possible as it was in all the manuals I read but I've never been in a situation where the setup used it - I always just did direct addressing of the device.
However, I'm super interested in trying out the video overlay idea you showed though - Thanks for the cool idea.
When it comes to engineering and testing equipment, _usually_ old is gold. It's something you'd want to hold onto.
Office looks great! 3 things I want to say; 1.) The nostalgia level is off the charts. It feels as if the 90s ZiffDavis PC magazines have come back to life and I'm being transformed into the pages. It feels like I'm walking the booths of a 90s computer exhibition in Taiwan. The memories you trigger are emotional. 2.) I'm older than you, but you master it all. 3.) I only understand 20%. 50% is learning. The remaining 30% helps put me to sleep.
This has to be one of the coolest things I've seen in a while, OBS live datalogging from equipment as old as I am. 😂
For those "capabilities that have been around a lot longer than your realize" feel, you could use some 1980 vintage Fluke GPIB instruments or host that included CRTs with touch screens. The touch areas weren't hi res - basically it sensed which of an array of rectangular fields you were touching. But still quite neat. One of my early jobs was adding GPIB capability to an instrument that monitored and tested avionics buses. And lest people get the impression from your video that GPIB is slow, it could generally achieve throughputs near a megabyte per second when properly configured. Slow compared to modern USB3 or USB4 buses, but fast enough for many instrument readings per second, and faster than many other communication protocols of the '70s or '80s.
If I am correct the CEC GPIB ( I think later both by Keithley ) interface could get up to 8MB/s. In my company they used CEC for almost all test computers.
Modbus is an industrial automation communication standard that is still in use today. As is Data Highway, Profibus, Canbus, etc. Once you get a decent standard going, it's hard to get rid of it, because the installed base is HUGE. So new equipment has to support old communication standards, just to maintain compatibility.
There's a reason RS-232 and RS-485 are still around.
I feel your PAIN. This is the main reason I don't really control my instruments using linux, meaning the reason why I still use Windows for this task. I do however have a Linux Mint box that is set up for this using software from the NI repositories. Keep the videos coming!
Those manuals are beautiful. You can tell that all of this stuff was designed by really forward thinking people. I really enjoyed your demonstration!
@TechTangents it would be helpful to add a counter to each window that shows “Time since update”. That should help viewers correlate what’s happening (fan spun up) with what the system is doing (waiting on a measurement update). Very cool work!!
Been using Linux for a while now since Windows 7 was the last version released by Microsoft which was designed to allow anyone to get anything useful accomplished.
This is a pretty good demonstration of why you would want to go through the trouble of setting this up, and why I haven't. :)
When I sit down to do something I usually have neither the time nor the cognitive resources to spare so I just end up using USB to RS232 and a terminal program. I keep a Windows XP install in a VM with USB pass-through (I used to use Visual Basic and VISA) just in case I still need to do something above and beyond calibrating a power supply for instance.
Its neat seeing something so old still being useful.
But have you..... HP 9825 Repair Part 10: We talk to Bob Stern, the one and only Mr. Fancy Pants.
Aside from manually useradd-ing the group, which I never had to do, this is very nostalgic. Reminds me of installing stuff not available in the package repos back in the early 2000s.
Running out to see the rain is just adorable.
I did this sort of thing in six different OS's back in the 90's. (a few lifetimes ago as an Embedded Programmer) Even wrote a "demo" X11 program to copy the front panel of a Fluke DMM for remote access. (sometimes those things were inside fume hoods, explosive containment, even in a radiation chamber once.)
Nice, was waiting for this for ages
24:15 That's brilliant. Love this use case.
cool...MIDI for test equipment
I thought the same thing
In a way, kind of yes.
Here's to Dave Smith. And his associates.
Kinda, yeah LOL
Ah man this takes me back. Working as a software engineer for Nortel optical electronics devision. GPID. Operating a few keithley (much like the HP but it was also a power source along with being a multi meter).
Actuators (Melles Griot) Epson robotic Arms. Spectrum analysers. And depending on if the testkit was testing a laser or mach-zender a HP laser source.
My job was writing the testkit software.
And the flashback to using National Instruments controls for linux (Solaris 7) and later windows to give nice buttons, dials and charts on the testkit software UIs.
Best job ever.
Always fun to see this kind of programming! :D Also the overlay is really cool, could also make live graphs with that for the funsies
Roughly 24:31 was the "Oh, that's so cool" moment, if you're keeping track. 😁
EDIT...And you can do whatever you want with the visuals. Amazing how fast I went from "how could this possibly be worth all this effort?" to "this is totally worth all this effort."
Can you save the data stream with a time index so you could play it back and change the formatting in post? I could see you wanting to tweak the visual after you see how the shot comes together.
Nice to see you have tied up a bit :)
I was watching some of you older videos the other week and was thinking "looks so clean and organised back then"
Hey Shelby. I work in Lab IT for Pharma. Some of the GC, HPLC, UPLC instruments et. al., still have/use GPIB, but many have transitioned to local Ethernet.
Thanks!
Tech Tangents. The highest quality production. For seriously silly reasons.
If i remember right some of the peripherals, including some huge "washing machine" hard drives, for the HP 3000 series minicomputers used HPIB. It'd be awesome to be able to get one of those talking to a modern Linux machine!
I worked with test equipment in the Air Force that uses GPIB. Very easy to use and set up.
Holy freakin’ A !
I hope I do not have to do half of that…work. My situation is a bit different, I will be trying to send data from my Linux box to a HP7470A flatbed plotter, through a usb-gpib cable. I have not tried doing anything yet, except reading up on the flatbed plotter and the gpib interface. A lot of it goes right over my head, for the time being.
Thank you for posting this video, it gave me some clarity of what I am looking at, and what might be my starting point in working with the flatbed plotter.
Cool stuff! not something i will probably ever play with, but love to see this kind of tinkering. @12:14: About running it every time at boot, possibly setting up a udev rule will help with that, making things even easier.
Nice work. :) Arch Linux and derivatives seem to have some GPIB libraries available in the AUR, possibly making this easier to install on that platform.
Awesome, Thank you for the video.😊
NI 488.2 drivers are free. To support those USB-GPIB Adapters under windows I think you need to install a version < v17.6.
Consider usinf double() insteaf of float() , especially when dealing with lab equipment.
in python this is handled transparently, there's only one float type
I've built a set of the Xyphro UsbGpib dongles for my lab. They only do a single device but work great with Linux using only the pyvisa and pyvisa-py packages. No messing around with drivers anymore 🎉
Welcome to my daily business :D
Programming and designing ATE (automated test equipment).
GPIB is great. Much more robust than LXI in my opinion.
However I don't like the National USB dongles. They are very expensive but not very reliable. In general USB is not that realiable in noisy (production) environments. A big oven turns on? - too bad, device re-enumerates! OS hangs? Too bad, weird issues.
I just love GPIB (or RS-232/485) - they just work.
In my graduate research lab (as of a year ago), just about everything except one ultra-modern piece of equipment had GPIB for all of the control and measurement! Those thick daisy-chain GPIB cables ran all over the place.
oh, went through this last year to get waveform data from my HP 54504A to make tuning some RF receivers a little bit easier. as you mentioned, getting that sort of data from an oscilloscope via GPIB (and then figuring out how to display it in a usable way) was quite the yakshave.
Spent a lot of effort on that, glad it paid off. I see Python as a modern Perl. Mostly because of the insane amount of modules available.
The HP 4401A exist at list from 1996. We still using a lot of them. I did not see even one that brake down. Fuse maybe pop up , or the power switch platic pusher brake, but not the electronic circut. One of the best DMM.
udev exists to run things when you plug them in and there's some example rules in linux-gpib-user
That gear was just dragged screaming 40 years into the future lol. NIce work!
Excellent info! Playing around with my hp 9000/300 workstation and thinking it might be better to control hpib test equipment through modern linux lol.
The cool thing about GBIP is yiy can set the voltage and amps of the power supply, trigger a measurement, and then plot all s from all devices in an excel
The slow read of some devices might be because of averaging. Maybe your slow devices take a lot of samples, and then average them out. It should be a config setting.
This is how I tend to use it, very handy for long test cycles, especially ones that need to run for 24 hours. Add in some tests for ambient temperature, humidity levels, light levels, etc and it can really catch some weird situations.
The compilation part was funny. As a Gentoo user, hearing someone talk through building modules, maintaining dev dependencies, and being aware of updates and how they impact other things... It's like when you talk to someone who has had childhood trauma and they don't realize that it's not just like perfectly normal to have routinely witnessed things that would have a parental guidance sticker applied to them. Hahaha...
send help.
I learned a lot about GP-IB. I also didn't know Dolphin has a built in term emulator.
Lab view, wow I had forgotten about that I used a fair bit 25 years ago at university, and never saw it again
I have a GPIB board for S-100 (a one of these days project) and an Apple II that has been used a bit. It took forever to find an English version for the Apple II card as most online versions were other language or just about unreadable. Having a print copy is great anyway.
Really cool
OMG that's awesome that the driver for the NI GPIB-USB is in the linux kernel now. Getting that thing to work on linux is a pain.
Please do a video on HP-IL!! (far superior!)
National Instruments actually still has Mac drivers for their GPIB NuBus cards on their support site, but it took some rummaging to find them. (I have one of those cards, but no HP-IB devices to use it with...)
Super cool stuff. I don't think that I would have had the patience to do the set up on it. I wonder if you could automate that process using the openSUSE build service and make the packages you need for Debian, Kubuntu or whatever distro you are using today.
reminds me of the Paul Daniels usb c meters he sells. Theres software that allows a overlay on OBS.
That's just great !
You're probably the only person in the world who says GPIB as a word instead of spelled out like any acronym.. and it really grinds my gears.
I'm working as a test engineer programming and designing such equipment. Both are used regularly.
("Geepib" as well as "Gee Pee I Bee") I prefer the latter however.
The fan going that fast seems not to be because you upped the current limit to 2A, but because you set it up to 8 volts tension.
HP stuff? I knew it’s been a while.
Thats really cool - was fun to see that PHP was supported as well. I can imagine doing graphs as well in just plain html-5 or web-gl
But these fans really must be spinning at 26000 RPM not 2600?
how are you getting the values overlayed on the screen? is that something within obs, or notify-send?
when you speak of serial to GP-IB my mind keeps going to the IEC to 488 adapters for connecting PET peripherals to VIC, C64 and later Commodore machines.
Couldn't you have written to the power supply what voltage atd ampere you wanted?
Might be something to consider to add to the interface.
Wouldn't dedicating a thread to each instrument in the Python program help with reactivity of the overlay ?
It would get a reading as soon as the instrument is ready, and the bus is available.
Then you can use queues to get the reading back to the web server.
Since everything still has to go through one piece of hardware it's all going to be limited by that anyway. And the 3478As are the only thing that don't have limits on how fast they can be polled.
I hate using GPIB due to how expensive the adapters and cables are, how bulky the cables are, and how you need special software/drivers to talk to the GPIB adapter, but the chaining is really nice.
There is a PPA for Ubuntu und a COPR for Fedora, at least the latter working fine with my NI PCI card - that makes the whole setup much simpler - Do you get a decent speed out of your USB interface? Dumping the ROM from a Tektronix Scope was super slow with that.
My advise: put your python script plus all the gpib dependencies onto a raspberry pi, then shove that pi somewhere behind the instruments and just access the web-ui you made.
the 5-pin MIDI of test gear
Next is the iset/vset commands via HPIB so you don't have to be quick on the front panel to set values.
If you get that excited for rain - what are your thoughts toward snow?
If I see snow in central Arizona we're probably all doomed.
interesting video i made a gpib package for work like month ago but instead of getting drivers my ubuntu install jusy saw it as usb and i was able to send the command as serial
Is there no protocol to encapsulate IEEE488 over an IP based transport? I mean, you can probably imagine making an Arduino to act as a gateway and forward GPIB messages into UDP datagrams and the other way round. It's not like low level 488 is that complicated.
Also, have you tried talking to a PET or a floppy drive just for shits and giggles?
Just for the record, here, which version of the Linux Kernel are you waiting on ?
Why not just package the user driver using udev to trigger setup on hotplug events, and as you said create a DKMS for the kernel component. You only need to do it once and then just run package build for new updated versions. dpkg isn't that difficult. Personally, I use Gentoo, but I always write an ebuild for unpacked software since I really don't like having anything unmanaged on my systems.
may I ask: where are you based that it hasn't rained in half a year?
13:11 - not sure but I think you can create a rc.local to start it automatically in every "init 5"
Just try systemctl status rc-local to get a clue
8:10 use an esp32 or a raspberry pi zero w and get gpib over Lan and Bluetooth
In the intro master shot, what is the system sitting in the background on the right side of the frame?
please, set the width to a fixed value, as jumping around is annoying/distracts
I noticed in main_loop that you're calling read() twice which I guess is ok because the actual reading is done in update_int(), but usually it's better to do something like `if (val := dmm1.read()) is not None:` `data["devices"].append({"DMM: 3478A Top":val})`
Arrgh, Walrus Operator!
@JGnLAU8OAWF6 I love the walrus operator. It makes dealing with regex matching so much easier.
Did you check pyvisa and or pymeasure?
have a epic 90's digital lightwave network analyzer(portable touchscreen 486 in a suitcase form factor) it has gpib too
You also have an HP-41CX also works
13:40 "Python feels like the modern day version of BASIC" *That's it*! Well said.
NI have labview free for personal use. Not sure about for Linux though
What file manager / terminal are you using?!
It's Dolphin, the default file browser on KDE. I think it's even available for Windows.
@ woah! I didn’t know it could do that!!! I’m on Pop at the moment, but Gnome is annoying me again lol. I may just install KDE. I liked Kubuntu but it didn’t play nice with the hybrid NVIDIA Quadro / integrated Intel GPU setup on my ThinkPad P1.
0:17 Ahhhh, the scream test.
GPIB sounds like is functions much like the Atari 8-bit SIO.
Seems like a good candidate for a pre baked Raspberry Pi image.
and this could be so much easier these days... as long as manufacturers would
Cheap test automation is the best test automation
Use a larger font in your code editor please...
aww the audio gets weird halfway through
26,000 rpm surely?
Back when HP products were actually decent
had an old plotter It had gpib
Wow, first one here? Impossible. Thanks for the great vids
First human, perhaps. Looks like the bots are here in force.
29:10 this is too much fan )
Sacrilege 😁😁😁You say GPIB and HP gear in the same description. It is HPIB when you connect up HP gear via those funny cables. I know, it became GPIB when a lot of other companies began adapting that interface on their equipment. Saying GPIB when touching HP gear ... oh my. I used all this stuff because my career began in the 70's. Tektronix would rowlf if you said HPIB using their interface. Just say'n and having fun doing so. Yes, used Labview as well.
HP submitted it into the standards to open it up and they knew it needed a new name to do that, some in HP weren't happy about that, but they knew it was required. Even HP people I've known, back when I was a kid when this changed, quickly switched to G-PIB. Having something they created become an industry standard was a source of pride to them from what I've heard.