Google Ad

Donate to IanJohnston.com using PayPal here, or pledge a donation via Patreon here.
I like creating electronics related YouTube videos. I mostly buy faulty gear from Ebay and make a repair video of it, but it's expensive and so with your help maybe I can continue to do so. Your support would be greatly appreciated.


Project #025 - GPIB Windows Software

DISCLAIMER: This video is educational only, so if you decide to do the same yourself then you are on your own, I can't be held responsible for any problems/issues/damage/injury that may occur if you decide to follow this blog and try it yourself.

INTRO

Some time ago I messed with an Excel spreadsheet and some VBA macros to enable my Win10 PC to gather GPIB data from my HP3458A and present it on a graph........it worked, but it is a little unreliable. It'll just stop logging minutes or hours in......and the Excel VBA graphs are real slow even on a fast PC. Thread here:
https://www.eevblog.com/forum/metrology/3458a-logging-via-excel-macro/


So, I finally found some time to look into this subject again, I dug out the RaspPi 3 but gave up after a couple of hours.....I know very little about linux and get frustrated that although there is much info out there, it's a bit here and a bit there since articles get outdated, solutions are by cobbling apps and scripts from many different places.Not to mention, this is 2018, so surely we should be a long way from this sort of thing!
What I need a proper Windows solution, but again, there is not a lot out there...........

So, I went hunting and stumbled on Pawel Wzietek's CodeProject 2017 thread and after downloading his VB source I finally got it to compile in Visual Studio 2015 (thanks for the tips Pawel) and after playing with it and my 3458A it looks extremely reliable, not to mention I've written a few VS VB apps. With Pawel's code you can hammer the QUERY button and it simply queues the commands and gets the messages back. Not only that but it's also configurable for a number of different interfaces, such as VISA, GBIP:ADlink, GPIB-488 and COM port......and can run two devices at the same time. Looks like I had the shell of a useful home brewed app in sight.
https://www.codeproject.com/Articles/1166996/Multithreaded-communication-for-GPIB-Visa-Serial-i


My plan therefore was to expand on the original code (with permission from Pawel) and add in a batch query's, a temperature probe interface, log data to screen & CSV, a quick view chart/graph, and hopefully at some point full blown graphing.


THE PROJECT

So I spent about a week (evenings) developing my app and including as much functionality as possible. Pawel's library can connect with a number of GPIB interface types, i.e.

VISA
GBIP:ADlink
GPIB-488
COM port

My interest is mainly in the VISA interface which will use my own E5810A and with the free Keysight IO Libraries Suite loaded onto my Win10 PC. The Agilent 82357B (clone) works as well.

I have a number of devices which have a GPIB port, and so far here's the results of my testing with my app:-

HP3458A DMM – Ok
Keithley 2015THD DMM - Ok
Fluke 8842A DMM - Ok
Racal-Dana Universal Counter - Not working yet (not much effort made to be honest!)

I am using an E5810A and have the Keysight IO Libraries Suite.......but I don't see any reason it can't work with a USB interface etc also.

Temperature/Humidity device compatibility:
USB-TnH SHT10 V2.00 (Usb serial comms) - Link here.

Download the app here. Current version = V1.20

INSTRUCTIONS FOR INSTALLATION:

The zip file contains the following:
- main testIODevice app exe file
- Log.csv file (empty)
- additional .DLL's required (please replace these on any app updates).


INSTRUCTIONS / NOTES FOR USE:

Assumes that you have loaded the current version of Keysight IO Libraries Suite and have it configured.
I have tested the app with an Agilent E5810A LAN-GPIB and an Agilent 82357B USB-GPIB clone. Both running in Visa mode.


DEVICES:
Set up your NAME and ADDRESS of the device(s) you want to connect to, and pick the INTERFACE type (I have tested Visa only).
The defaults shown when you install are my own as an example.
Hit the CREATE DEVICE button (you choose). An pop-up box will appear that lists the connected device. This box will remain visible at all times and will let you see the commands being sent and any queued commands.


You can effectively batch commands using the PRE RUN, AT RUN and AT STOP boxes and using the RUN/STOP button at the bottom.
PRE RUN commandsare used to set up your device.
AT RUN command is the command that is repeated at the SAMPLE RATE.


Command types are as follows:

SINGLE COMMANDS:
Enter single commands in the COMMAND boxes and hit QUERY and you'll get a RESPONSE back (if it's a command that returns a query).
Types of commands as follows:-
Blocking commands - Are immediately executed on the calling thread (usually GUI thread), this method waits until it gets response from the interface.
Query Asynchronous commands - Queries are queued and the queue is processed on a different thread (producer-consumer model). The call appends the query to the queue and returns immediately.


SETUP BATCH COMMANDS:
Send Asynchronous commands - Sent via AT RUN, and are sent similar to the Query Async commands except do not expect a reply, i.e. "fire and forget" manner.
Note: my GUI should really have a separate single command send for SendSync but I have not implemented this at the moment.....you can just use the QueryAsync single query send and the reply will just time-out gracefully.


RUNNING BATCH COMMANDS:
When you have everthing set up hit the RUN button and you will see the pop-up become active as it starts to communicate with your device. You will see any successful queries/sends and any errors.
Please note that there are some issues in this regard, i.e. you may see some errors appear and the queue grow, but in the case of my 3458A and Keithley 2015THD everything usually settles down until you just see one line for your devices as it communicates.

IO DEVICES POP-UP:
When the CREATE DEVICE buttons are pressed a pop-up box will appear that lists the connected device(s).
This box will remain visible at all times and will let you see the commands being sent and any queued commands.
Note that you can close this window without any effect on the app. You can use the button "Show Device List" to show it again if needed.
Please note that there are some issues in this regard, i.e. you may see some errors appear and the queue grow, but in the case of my 3458A and Keithley 2015THD everything usually settles down until you just see one line for your devices as it communicates.


TEMPERATURE/HUMIDITY:
There is only 1 Temperature/Humidity sensor I have tested and that is available here:-
http://www.dogratian.com/products/index.php/menu-sensors/menu-usb-tnh-type-a-sht10
It's a serial USB type sensor and does not require any drivers except what Win7/Win10 loads automatically as you insert it. You should see a COM port which you can pick from the list on the app.


DATA LOG / CSV:
For CSV generation, per the defaults, set up your filename and path to where you want the CSV to be saved. At the moment there is not file generated if it doesn't exist so make sure you have an empty .CSV text file at the path specified.
The check box ENABLE CSV will start saving data to the .CSV file.
The EXPORT CSV file will copy the active .CSV file to the same folder and append the current date & time as the filename.
EXPLORER will launch Windows Explorer and pointing to the path folder.
You can clear the current CSV file with the RESET CSV button, there's a check box next to it which must be set before the reset will work.
ENABLE LOG check box will activate the log file display window.
E NOTATION TO DECIMAL check box will convert ########E-02 to the decimal equivalent. This is for the CSV and well as the log window.


CHART:
Enable either or both device charts via the check boxes.
With the boxes un-checked you can hit the CLEAR CHART to reset the chart windows and remove the data.
You can change the resolution of the chart with the X-AXIS SCALE POINTS entry. Once the chart display reaches the set number of data points on it the chart will start to scroll off to the left as new data appears at the right.
The range of the Y-axis is adjustable via the SCALE MIN AND SCALE MAX enries. You can manually set them or hit AUTO SCALE and the chart will look at the existing trace and from it's highest and lowest position will centre and scale the chart.
The UP and DN buttons allow the current set scale to be adjusted in 10% steps.


SAVE SETTINGS:
Most of the entries are saved off so when you restart the app they will be there.

PLAYBACK CHART:
For offline display of the generated .CSV files. The user can select the device to be displayed on the graph, and also zoom in/out and scroll back/forward through the graph.


IMPORTANT NOTE:
The app is free and as such is not free of bugs and issues, i.e. there's not too much error trapping i.e. if you were to input negative numbers, letters etc into some of the entries the app will probably crash.


SCREENSHOTS:

thumb app14

 

thumb app14