GPIB Instrument Control Console

Silly simple GPIB console for U/Linux & Mac OS

Similar projects worth following
I've slowly been acquiring a collection of GPIB enabled instruments for my bench and that allows me to do more sophisticated testing. Now all I need is a way to interface it to my MAC and software to control them.

The commercial software - like LabView - is awesome but very expensive. Some vendors like Keysight offer free or limited versions but all require specific and/or expensive hardware which limits what platforms you can use them on.

Prologix ( takes care of the hardware interface with their GPIB to USB adapter. It enumerates as a virtual serial port which in Unix-like operating systems is great. Basically a character device that you can access with standard file stream I/O. This makes it easy to write your own software to control instruments, heck you can even do it with a terminal emulator or even the call-up (cu) command. Best of all it's platform agnostic.

I created GPIBCON as a first step toward an extensible control program.  This version is very simple and only talks to a single instrument. but multiple instances can be run.  It's text-based and runs in a standard terminal window.  You configure it for the specific instrument via an ASCII config file.

Source code & config file comments provide the details.  Basically you add the GPIB commands to the config file and run the program with the name of the virtual serial port device.  It displays a 'console' of data from the instrument along with a command prompt to control it.

The program is written in ANSI C and distributed under the MIT license.  It should compile without problems on Mac OS and most U/Linux distributions.  Dunno about Windows.

Feel free to use as-is or a starting point for something more capable.

Version 4 adds ability to address multiple instruments on two device interfaces, timeout handling, and numerous optimizations.

Zip Archive - 38.43 kB - 04/20/2019 at 22:32


Version 3 adds data logging & the use of constants in calculated fields.

Zip Archive - 27.32 kB - 03/29/2019 at 16:30


Version 2 which includes calculated fields.

Zip Archive - 25.57 kB - 03/25/2019 at 00:50


Source code, binaries, sample config.

Zip Archive - 30.79 kB - 02/14/2019 at 02:59


  • Version 4 Posted

    Brian Cornell04/20/2019 at 22:37 0 comments

    Last version, I promise.  Bharbour was right, it gets quickly gets very complicated.  Nonetheless I needed the ability to talk to multiple instruments and at least two device channels for my test setups.

    This version adds both along with some bug fixes and optimizations.  Existing config files will need some updating to work properly but the same general syntax is used.  The zip contains a working example config.

  • Another Version Update

    Brian Cornell03/29/2019 at 16:34 0 comments

    The bane of writing your own software:  you're never done.  I keep finding more things I need to do with this.  Version 3 allows you to use constants in calculated fields.  Useful if you're reading data rendered in units of something - like a temperature sensor producing 10mV/C.

    Recording the data is essential and I don't know why I didn't include this in the original.  Anyway, it's there now.

  • New version with calculated field support.

    Brian Cornell03/25/2019 at 00:57 0 comments

    I've posted a new version that includes calculated fields using data acquired from the GPIB device.  It's very basic - add, subtract, multiply, and divide on two fields and no grouping.  The config file documents how it works in the display (dsp) section.

View all 3 project logs

Enjoy this project?



Brian Cornell wrote 03/30/2019 at 18:41 point

Yeah, that's quickly becoming apparent.  I'm hoping that with this framework I can quickly modify the base for specific tasks as you suggest.  Thanks for the tip on LabView, I will definitely check it out.

  Are you sure? yes | no

Bharbour wrote 03/30/2019 at 14:02 point

There is a "Home" version of Labview available for about $50US if you are interested. It will not compile to a .exe file, but it can run stuff as long as you have the Labview program open.

That said, I have done a few command line GPIB tools. The most ambitious was designed to run several instruments like a power supply, function generator, DVM and an electronic load box. It was intended to allow script control for automated testing. It quickly got so cumbersome to use that I never finished it. Keeping a program small and limited to a single instrument, or a very specific task seems like the way to do this. 

Good Luck,

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates