WinGPIB - Windows GPIB App (multi-purpose) - Page 1
Forum section: electronics / general

author: IanJ
author_rank: Unknown
timestamp: November 18, 2018, 09:02:50 pm
content: WinGPIBApp rebranded 2nd Jan. 2022 - UK/USA Trademark.wingpib.co.uk & wingpib.comThis app provides reliable Windows GPIB functionality to many brands and types of test instruments, aka HPIB, GPIB, or IEEE-488 Instrument Control.WinGPIB isstrictlyfor non-commercial, non-business use only, contact me if you wish to use it within your business.Written in Visual Studio2019 VB2022 VB and using Pawel Wzietek's awesome GPIB library code (.DLL Multi-threaded GPIB communication), I wrote a custom front end to what you see below.The app can interface using various different types of GPIB interfaces, and can run two devices at the same time.Pawel's original project:https://www.codeproject.com/Articles/1166996/Multithreaded-communication-for-GPIB-Visa-Serial-iI/O DEVICE PROTOCOL COMPATIBILITY:99% of instruments with a GPIB interace will work with this app because it is extremely flexible. The following protocols can be selected:- VISA (Generic interface [GPIB,USB etc.] via Visa)- GPIB:ADlink (ADlink boards)- GPIB-488 (gpib488.dll - Some Keithley, MCC and older NI boards)- COM port (Generic serial)- Prologix Serial- Prologix Ethernet (TCP)- NI-GPIB-232CT-A (NI serial)Confirmed adaptors:These are the ones I have confirmed, or have been confirmed to me.- Agilent E5810A (VISA)- Agilent 82357B USB (VISA)- Agilent 82350-66511 PCI-GPIB card (VISA)- Prologix GPIB-Ethernet (Prologix Ethernet TCP)- AR488 Arduino GPIB (Prologix serial)- Kofen's PoE Ethernet (Prologix Ethernet TCP)- National Instruments NI-GPIB-232CT-A (NI-GPIB-232CT-A)TEMPERATURE/HUMIDITY DEVICE COMPATIBILITY:Whilst also being able to connect to two GPIB devices at the same time, WinGPIB also allows interfacing to a temperature & humidity sensor which can logged alongside the GPIB data.- USB-TnH SHT10 V2.00 & USB-TnH SHT30 (Usb serial comms). -https://www.dogratian.com- Adafruit MCCP2221A/SHT40 as follows:Adafruit MCP2221A Breakout - General Purpose USB to GPIO ADC I2C - Stemma QT / Qwiic -http://adafru.it/4471Adafruit Sensirion SHT40 Temperature & Humidity Sensor - STEMMA QT / Qwiic -http://adafru.it/4885STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long -http://adafru.it/4210- User based protocol (partial) - Handy if you have your own home grown protocol etc.OS TESTED:Win10Win11DOWNLOADS:Release V3.285 (1st Sep. 2025), see ZIP file attached below.Note: You can also check for new versions and download the latest from within the app (from V3.284 onwards), see SETTINGS tab in the app.Note: Version 3.143 and over requires MCP2221DLL-M-dotNet4.dll which is available here -https://github.com/Ian-Johnston/WinGPIBadditionalinfo/tree/main/WinGPIBadditionalinfoif you are updating.Extra: If you want access to previous versions or the latest (possibly not released yet) installation .msi files then download them from my GIT here:https://github.com/Ian-Johnston/WinGPIBadditionalinfo/tree/main/WinGPIBadditionalinfo/WinGPIB-AnyCPU_All-SetupFiles[all files scanned with BitDefender Antivirus prior to upload]SOURCE CODE:This app may be used and distributed freely for strictly non-commercial, non-business purposes only. If you wish to use it within your business then contact or PM me.The source code is available for download from my GIT (you need all 3 repositories):WinGPIBproj - Visual Studio project (the main GUI).IODevices - Visual Studio project (the DLL required by the main app).WinGPIBadditionalinfo - A compilation of files, datasheets, sample data, utilities, 3rd party DLL's & drivers etc.https://github.com/Ian-Johnston?tab=repositoriesINSTALLATION INSTRUCTIONS:Fresh Installation of WinGPIB:First, make sure you have the Keysight IO Libraries loaded, running and configured. Then,1. Unzip and run the .msi installer -WinGPIB_V#####.zip2. The program is installed at: C:\Program Files (x86)\IanJ\WinGPIB\WinGPIB.exe3. All user data resides inC:\Users\\Documents\WinGPIBdata4. A desktop shortcut is created to run the app.Updating WinGPIB app:1. Install using the same .msi installer as above. It will not overwrite the files in your data folder, C:\Users\\Documents\WinGPIBdataNote: See post #766 before upgrading if you are on V3.177 or earlier.Moving your WinGPIB profiles to a new PC:V3.178 onwards:1. Use the EXPORT PROFILES button to save all your profiles/settings data to \WinGPIBdataProfilesData.dat.2. Copy the .dat file to your new PC \WinGPIBdata folder.3. Once you have installed WinGPIB, use the IMPORT PROFILES button to import all your profiles/settings data.4. Restart WinGPIB.Prior to V3.178:1. On your old PC (I'm using Win10) go to: C:\Users\YOURUSERNAME\AppData\Local\Microsoft\WinGPIB.exe_Url_somegreatlonglistoflettersnumbers\1.0.0.0\and in there is a file called user.config2. Copy that file out and put it in the similarly named folder in your new PC. The large folder name will be different.Installation Notes:1. If you accidentally delete your GPIBchannels.txt or base Log.csv file there are original copies in the program folder you can copy over to C:\Users\\Documents\WinGPIBdata.2. When upgrading you may lose the contents of your profiles so Export them first.3. WinGPIB does not use OneDrive for it's data storage.4. If you get an error on running the program that a Log.csv file or its path doesn't exist, then manually create the exact path and drop a copy of Log.csv in that folder. Restart WinGPIB.5. Version 3.143 and over requires MCP2221DLL-M-dotNet4.dll available here -https://github.com/Ian-Johnston/WinGPIBadditionalinfo/tree/main/WinGPIBadditionalinfo.Note that depending on your Windows install you may need to install Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package in order for the MCP2221DLL to work properly. Available here:-https://www.microsoft.com/en-gb/download/details.aspx?id=26999orhttps://www.techpowerup.com/download/visual-c-redistributable-runtime-package-all-in-one/INSTRUCTIONS / NOTES FOR USE (may not be complete):Assumes that you have loaded the current version of Keysight IO Libraries Suite and have it configured.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.Types of commands as follows:-Query Blockingcommands are immediately executed/sent. They are immediately executed on the calling thread (usually GUI thread), this method waits until it gets response from the interface.Query Asynccommands are queued. 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.Send Asynccommands queued. These types of commands do NOT expect a reply.BATCH/LOOPING COMMANDS:PRE RUN- Initialize your device with a list of SEND ASYNC type commands.AT RUN- A single QUERY ASYNC type command.AT STOP- A list of SEND ASYNC type commands you may wish to send when you hit STOP.INTERRUPT COMMANDS:You can specify an Async (no reply) command to be send periodically, such as ACAL DCV when you are logging etc.Duration in secs = How long you need that command to be active for, i.e. ACAL DCV on a 3458 may take 60secs.Period in mins = How often do you want that command sent, i.e. every 120mins.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.COMMAND LINE INTERFACE:After connecting to your device(s) use the comand line interface to send and receive data from your device(s).TEMPERATURE/HUMIDITY:There is only a couple of Temperature/Humidity sensor I have tested and that are available from DOGRATIAN seller here -https://www.dogratian.com/index.phpThey are 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.The SHT30 gives 2dp's whereas the SHT10 1dp.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.PLAYBACK CHART:For offline display of the generated .CSV files. The user can select the Device to be displayed on the graph (since there are 2 devices available), and also zoom in/out and scroll back/forward through the graph.TIP: The Playback Chart relies on the consistency of the CSV being correct, i.e. no empty lines, the first 3 lines start with // for the metadata, the first and last data timestamp is used to calculate the period of the entire data.HP3458A & HP3457A DMM RAM EXTRACT:Utility to extract the battery backed up (DS1220Y IC) cal ram on the 3458A down to a .bin file.Utility to extract the battery backed up (DS1235Y ICs) settings ram (both) on the 3458A down to a .bin file.Utility to extract the battery backed up cal ram (2 versions) on the 3457A down to a .bin file.Utility to decode a 3458A .bin file and extract calibration data/info.ADVANTEST/ADCMT R6581(T) CALIBRATION CONSTANTS DOWNLOAD/UPLOAD:Utility to download or upload the regular calibration constants from the meter to a JSON file.HP 3245A UNIVERSAL SOURCE CALIBRATION:Utility to automate the full calibration (DCV & DCI) of an HP 3245A by using a 3458A, 34461A/34465A/34470A or R6581(T).SAVE SETTINGS:Most of the entries are saved off so when you restart the app they will be there.E5810A AGILENT LAN/GPIB GATEWAY CONFIG:The E5810 is a popular LAN gateway, here's some tips on installation and getting it configured:1. Power up E5810A and make sure it gets an IP assigned (DHCP), i.e. 192.168.1.1752. Go tohttp://192.168.1.175and "Find & Query Instruments". Make sure you can communicate with your device.3. Go to Keysight Connection Expert and ADD Remote GPIB Interface.Change SICL Interface ID to the one that finds the IP of the E5810A. Hit OK.4. Now a device will be listed on the "My Instruments" panel. The GPIB address will be displayed i.e. GPIB1::22:INSTRTERMINATOR INFO:CR = carriage return (original meaning: moves to column zero without advancing paper).LF = line feed (original meaning: advances paper without returning to column zero).CRLF = does both the above\r = CR = 0x0D = 13\n = LF = 0x0A = 10 = newlineCOMMON & NOT SO COMMON ISSUES:ISSUE 1: MAV not set errors:Example: "Poll timeout: MAV not set, status byte=4"Check your device manual to see where the MAV is coded in the status byte and set the MAV mask accordingly.The standard value is 16 and is set by default in WinGPIB.If it still doesn't work the only option is to disable polling altogether although you then might experiencedelays if you have more than one device connected via GPIB.Also, if this is happening with large NPLC settings or other such time hungry commands then try increasing the Timeout (ms) to 10000 or 15000.This issue can also happen if your GPIB commands are incorrect (spelling, syntax etc).ISSUE 2: Can connect to my device but get syntax errors, no command is actioned:I have found a dodgy GPIB cable/connector can cause this.ISSUE 3: The main WinGPIB.exe is sometimes flagged up & quarantined by Windows anti-virus scans.ThreeFour times now it's been flagged as containing a virus andthreefour times now I have sent it in and it's been confirmed as a false positive. Twice by BitDefender, andoncetwice by Microsoft Defender. If it happens to you then please let me know and I will contact the anti-virus company involved.ISSUE 4: The \WinGPIBdata button to access C:\Users\\Documents\WinGPIBdata seems to pick up a different folder to the folder that the CSV's are saved to, i.e. one is under a \OneDrive folder.This is not a WinGPIB issue, it's due to a misconfiguration of your Win10/11 My Documents folder. Fix thePersonalentry here and remove \OneDrive:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell FoldersHKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell FoldersISSUE 5: Possible VISA32.DLL Issues:If you have Keysight IO Libraries loaded and you can communicate with your device using it's GPIB address via the Connection Expert but get an error (Visa error BFFF009E) using WinGPIB and you've tried everything, then:Go to C:\Windows\SysWOW64RenameVisa32.dlltoVisa32_old.dllRenamevisa32.Agilent Technologies - Keysight Technologies.dlltoVisa32.dllReason: Windows updates and updates to other programs on your PC can often replace this .DLL with their own and breaks WinGPIB Visa functionality!Have fun.Ian.SCREENSHOTS:(reduced in size for webpage), click on them to see full size version.NOTE: These are not the latest screenshots, I don't keep them up-to-date with each GUI mod:Note: This example error I generated by switching off the 34461A whilst it was logging data!Example IO Devices pop-up:DOWNLOADS:Note: You can also download the latest version from within the app (from V3.284).

author: Andreas
author_rank: Super Contributor
timestamp: November 18, 2018, 10:11:21 pm
content: Quote from: IanJ on November 18, 2018, 09:02:50 pmHello,your plans are really high sophisticated. (with the graphical display).But how do you get W10 working reliable?Every time I want to log one of my ADCs via RS232 in a W10 machine it tries to install some software and reboot over night.I have found no way to stop this behaviour. So I usually use old XP or W7 machines for measurements.Just one hint:instead of trying to put all software into one application I use several small programs.E.g. one program for temperature sensing and one for sensing the reference voltage.The easiest way is to log 1 minute averages and combine the results via spread sheet calculations.Another interesting way is to use a virtual file for data exchange.So the values of e.g. a NTC-sensor ADC can be used from other software applicatonsand logged together with the readings or could even be used for T.C. corrections.with best regardsAndreas

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: November 19, 2018, 12:38:40 am
content: I do this with a small PowerBASIC program and an old Prologix adapter that uses an FTDI chip. I can easily call their drivers and have few reliability problems... but I haven't tried it on my Win10 machine. I don't expect any serious problems. The same program, with some minor changes reads my HP3478A, HP3455A and frequency counter (can't remember the model). I suspect similar code could be done with Visual Basic or most any language. I just happen to like Basic and FTDI chips.

author: alanambrose
author_rank: Frequent Contributor
timestamp: November 19, 2018, 03:26:35 pm
content: Another data point - I have quite a lot of C# GPIB code which runs fine. I have used both and USB<->GPIB adaptors and LAN<->GPIB and both work good. There's a bit of nonsense with the different manufacturers (NI, Keithley, Agilent etc) all trying to bethevisa interface on your machine - I'm using the Agilent version right now but I think I've used others in the past. I've found that the different manufacturer's test equipment has its own GPIB idiosyncrasies, timing behaviour etc. A bit of care with good exception handling and dealing with corner cases will pay dividends. The good thing about the Microsoft environment (I'm sure others will list the negatives) is that visual studio is 'grown-up' and has a good built-in debugger. You can even make some code changes within the debugger and it'll do an incremental compile on-the-fly and continue running from where you hit the break point - i.e. without a full re-build, app re-start etc.Alan

author: alm
author_rank: Super Contributor
timestamp: November 19, 2018, 03:53:29 pm
content: C# and before that C has been used for decades for instrument control. According to Wikipedia, LabWindows (the LabVIEW framework with G code replaced by C) started in 1987 (for DOS). So of course there is no reason you couldn't develop something that is at least as good as the Python + PyVISA solution you might use on a Raspberry PI (which should also work on Windows). The only disadvantage compared to the Raspberry PI solution I can see is price and power usage if you want to run it 24/7.Like Andreas, I would reconsider the monolithic approach, and consider separating data acquisition and analysis / plotting. You can later create something that manages both (e.g. connect to acquisition using a socket and embed the plotting), but this makes it much easier to do unattended logging (e.g. start as service), offline analysis, combining data from multiple instruments, etc. I would also separate logging from the DMM (including its internal temperature if you care) and logging from the environment sensor(s), since the latter data may be used for multiple instruments that are in the same room.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: November 19, 2018, 04:09:04 pm
content: As Alan says, different instruments have their own quirks. It took me forever to figure out how to get my HP 8903B back to local from program control. Long ago I interfaced to an HP network analyzer that had a very early version of HPIB. I did it with a big old Data Translation card that had a bunch of I/O lines. Quirky doesn't begin to describe it. Huge PITA, but the interface cards were quite expensive back then. I'd never think about using anything other than a National or Prologix interface now.

author: alm
author_rank: Super Contributor
timestamp: November 19, 2018, 04:32:02 pm
content: Instruments certainly have their quirks. Some in hardware: I think the designer of the Prologix interface had to spend a lot more time than he expected to get his GPIB interface to work with all kinds of instruments. In my experience, newer (e.g. post-IEE-488.2 / SCPI) instruments are better behaved than older ones: if you go back far enough, then they implemented GPIB entirely in discrete logic gates, and the programming might be "send a byte with the first bit set and the other seven bits the voltage you want to set" without having any feedback. In my experience HP/Agilent instruments are better behaved than Keithley or Philips instruments from the same era. I've had to write more "if garbage data, then ignore" code or "avoid this sequence, since the instrument may lock up" for the latter two than for HP equipment. But I'm sure that's not universal across instruments.

author: IanJ
author_rank: Unknown
timestamp: November 19, 2018, 07:29:11 pm
content: Hi all,New screenshot posted in message #1 above......3458A connected via E5810A......and I've done a bit more coding, enough to see if the concept will work reliably.I have a PDVS2 connected to the 3458A and set to ramp the voltage up & down between 0 - 10Vdc.The procedure with the app is to manually send a few commands (will vary with instrument I guess), then trigger readings from then on, i.e.:END ALWAYS - GPIB EOI mode, this is needed so the 3458A can respond correctlyNRDGS 1 - Number of readingsTARM SGL - Trigger readings (1)PS. I haven't played with NPLC etc yet.....thats next to do.Then with TARM SGL left in the COMMAND window, set the sample rate, in this case 1 second and hit "Run"Over on the right on the DATA LOG the sample are being logged to screen along with Date, Time and Temperature. I've not processed the sampled reading so have left it as per sent by the 3458A for now.The current Sample count is recorded in the Device 1 area.At the moment "Stop" will cease the sampling, but will leave the 3458A connected. I will add another button to properly "disconnect" later.No CSV file yet, I want to make sure, as a few have hinted, that Win10 is happy.Noted alm post regarding Keithley instruments less well behaved.....I have a couple of 2015 THD DMM's so will hook them up at some point and give them a go. I also have some Fluke's, Racal-Dana gear also.So far seems to be working fine, and much more reliable than my Excel spreadsheet/macros.Ian.

author: IanJ
author_rank: Unknown
timestamp: November 19, 2018, 10:44:04 pm
content: Quote from: alm on November 19, 2018, 03:53:29 pmI hear ya.......however, at the moment I just want something operational that mostly fits my own needs.......and it's just easier for me to integrate everything into the one app. My forte is uC C++, this is my ummm 4th Visual Studio VB app....ever, so there's a lot I don't know.The source code will be posted at some point (warts and all).....so anyone else can take it on after that if I don't look into it.Update:Have added a checkbox to format returned data in numerical data format with correct DP position. Useful for 3458A data. Screenshot above updated.One issue I do have which I need to look at is manually terminating GPIB and not have the 3458A front panel controls locked out.......a job for tomorrow. Then I'll look at writing to CSV.Ian.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: November 20, 2018, 03:34:54 am
content: My effort was much less ambitious, didn't even put a title on the title bar, but it does the job. It's reading 1.23456 VDC from the calibrator-

author: IanJ
author_rank: Unknown
timestamp: November 21, 2018, 11:04:59 am
content: Hi all,Hit upon a wee problem last night......all was working well, I could connect to the 3458A and I recorded some 60k+ samples at 1sec intervals no problem, I can connect to the 3458A via a series of commands every time without problem.However, disconnection is another matter!.......LOCAL 7 or LOCAL 722, or any other combination of RESET, CLEAR etc etc etc will not release the meter from remote back to local.......and as a result some subsequent commands in an attempt to do so just time-out, almost like it is half way between remote and local.....and the funny thing is that it does accept SOME command but not all, i.e. BEEP and RESET work. I did read the GPIB manual, including Appendix B.....to no avail.So, I fired up the Agilent E5810A's web inteface and sent some commands from it, the same commands I am sending from my VB app and it reacts in exactly the same way.The only way I can get back to local mode on the 3458A after I have sent the commands is to press the LOCAL button on the 3458A itself.....or pull the GPIB connector from the back of the 3458A.Tonight I will try the Agilent USB-GPIB adaptor (clone) I have and see if it does the same.It's not a huge issue, but I would prefer that it all works as perfect as possible............any Ideas?Ian.

author: alm
author_rank: Super Contributor
timestamp: November 21, 2018, 02:21:46 pm
content: So you are saying it does not just fail to release the keyboard, but also fails to respond to commands it would respond to before you send "LOCAL 722"?If new commands were sent after "LOCAL 722", then I could understand the instrument going back to remote immediately. Note that the "22" is the GPIB address, so if the instrument is at GPIB address 16, you should send "LOCAL 716". Did you also try to send the GTL GPIB command (ibloc), instead of sending the string "LOCAL ..." to the instrument?

author: pwlps
author_rank: Frequent Contributor
timestamp: November 21, 2018, 02:46:26 pm
content: Hi Ian,As far as I remember the command for Agilent stuff should have been either "LOCAL:RESET" or "LOCAL OFF", did you try those?Also, did you try to Dispose the class instance? Dispose calls the "viClose" Visa function, this might reset the instrument to local but I'm not sure.Otherwise, if it doesn't work tell me and I could try to implement the GPIB "GTL" command in the library. GTL is a GPIB bus message and Visa implements it e.g. with :ViStatus viGpibControlREN(ViSession vi, ViUInt16 mode);with this option: (from Visa manual):mode Action DescriptionVI_GPIB_REN_ADDRESS_GTL Send the Go To Local command (GTL) to this device.But then check first in the manual if GTL is supported by your 3458A - not sure this belongs to the list of mandatory 488 functions (there are several levels of compatibility for GPIB but I don't remember them).The call to this function could be added to Dispose just before the call to viClose.Pawel

author: IanJ
author_rank: Unknown
timestamp: November 21, 2018, 02:47:16 pm
content: It fails to respond to LOCAL 7 or LOCAL 722, and yes my GPIB address is 22.So, I send my preamble commands and ultimately TARM SGL every second and logging begins.....I then eventually stop sending TARM SGL and then send LOCAL 722 or CLEAR or RESET etc and those commands fail. This happens both with my VB and also at the command line on the E5810A web interface. And when those commands fail if I send BEEP or RESET instead then the 3458A responds......so not as if all comms has ceased. If I then try to start logging again (TARM SGL etc) then it fails, it's like the 3458A is half-ib and half-out of remote/local. I have to manually hit LOCAL on the front panel and manually RESET.......or pull the GPIB connector.I will try your suggestions tonight when I get back to the workshop.It would be nice to know what series of commands other folks are sending when they are finished with their GPIB session.....not much on the web about that, just plenty about initiating sessions.Ian.

author: alm
author_rank: Super Contributor
timestamp: November 21, 2018, 02:56:54 pm
content: For me, the instruments used for long-term logging are usually in remote mode. If I want to use them for local operation, I use the front panel to go to local, enable display and set triggering to auto. So I never bothered with sending the local command via GPIB. Will try it later today if I have time.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: November 21, 2018, 03:29:51 pm
content: Getting my instruments back to front panel operation remotely has always been a problem. I think I've got it licked, though I'm not a programmer and can't even play one on TV. The trick is to tell your controller not to look for data after every send. If it does that, communication can never stop, regardless of what else you send. Don't know if this will help, but here's the code called by my disconnect button (PowerBASIC for Prologix adapter)-Code:SUB GPIB_CloseDIM lResult AS LONGDIM lpBuffer AS ASCIZ * %gpibWriteLenDIM B2W AS DWORDDIM BW AS DWORDON ERROR GOTO GPIB_Error_TraplpBuffer = "++auto0"+$LF 'turn off controller automatic read after write so meter will releaseB2W = LEN(lpBuffer)lResult = FT_Write(InstHandle, lpBuffer, B2W, BW)IF lResult <> %FT_OK THEN ERROR 152lpBuffer = "D1F1R-2RAZ1N4T1"+$LF 'turn on internal trigger and reset other settings for manual operationB2W = LEN(lpBuffer)lResult = FT_Write(InstHandle, lpBuffer, B2W, BW)IF lResult <> %FT_OK THEN ERROR 152lpBuffer = "++loc"+$LF 'return control to front panel- this releases instrumentB2W = LEN(lpBuffer)lResult = FT_Write(InstHandle, lpBuffer, B2W, BW)IF lResult <> %FT_OK THEN ERROR 152lResult = FT_Close(InstHandle) 'close the GPIB connectionIF lResult <> %FT_OK THEN ERROR 152gpibConnected = 0GPIB_Close_Exit:EXIT SUB

author: pwlps
author_rank: Frequent Contributor
timestamp: November 21, 2018, 06:01:48 pm
content: I guess the VB code posted by Conrad Hoffman is for a Prologix GPIB adapter?QuoteIn Prologix language the "++loc" command sends a GoToLocal message to the device, this should be equivalent to the Visa function I mentioned.edit:In fact as there is no device address in this code, I think the "++loc" simply releases the REN line, so that all devices on the bus return to local. Prologix manual is not clear about this.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: November 21, 2018, 06:37:40 pm
content: For the above to work, that first command in my disconnect code is needed. You have to get the adapter out of auto mode. For the Prologix it's "++auto0". No idea for other adapters, but I tore my hair out until I figured this out.

author: IanJ
author_rank: Unknown
timestamp: November 21, 2018, 08:11:35 pm
content: Hi all,I'll get back to the 3458A disconnect issue later....I was starting to pull my hair out also!Meantime I have done some more work and have got both devices working at the same time now.....HP3458A and a Keithley 2015THD......see screenshot in post#1 above.There are now some extra text boxes:Commands to send at run......and Commands to send at STOP......It's this 'stop' where I was trying to send LOCAL 722 to the 3458A......ahh well!The way it works is: The preamble commands are sent, but the last command in the list is the one that is repeated over and over......hence my TARM SGL & :READ?I also have the CSV file generation working and logging to there also.Snapshot of CSV below.....note I have decoded the readings in it as well as the onscreen Data Log, this is optional via a checkbox.PS. Keithley DMM has annoying 'beep' when GPIB command is sent....I am sure there's a command to disable this!.....actually I think it's an error being generated....need to fix this....UPDATE: Send ":INIT:CONT OFF" also, per page 2-55 of 2015THD manual.PS. There's a wee bug in the data formatting below......Code:HP3458A,21/11/2018 8:00:37 PM,4.53913284,25.0 C,33.2 %RHKEITHLEY,21/11/2018 8:00:37 PM,4.53913284,25.0 C,33.2 %RHHP3458A,21/11/2018 8:00:40 PM,8.55030307,25.0 C,33.3 %RHKEITHLEY,21/11/2018 8:00:40 PM,4.53913284,25.0 C,33.3 %RHHP3458A,21/11/2018 8:00:42 PM,8.55030307,25.0 C,33.3 %RHKEITHLEY,21/11/2018 8:00:42 PM,8.55030307,25.0 C,33.3 %RHHP3458A,21/11/2018 8:00:45 PM,5.93175246,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:00:45 PM,8.55030307,25.0 C,33.4 %RHHP3458A,21/11/2018 8:00:47 PM,5.93175246,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:00:47 PM,5.93175246,25.0 C,33.4 %RHHP3458A,21/11/2018 8:00:50 PM,1.10277879,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:00:50 PM,5.93175246,25.0 C,33.4 %RHHP3458A,21/11/2018 8:00:52 PM,1.10277879,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:00:52 PM,1.10277879,25.0 C,33.4 %RHHP3458A,21/11/2018 8:00:55 PM,4.37050003,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:00:55 PM,1.10277879,25.0 C,33.4 %RHHP3458A,21/11/2018 8:00:57 PM,4.37050003,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:00:57 PM,4.37050003,25.0 C,33.4 %RHHP3458A,21/11/2018 8:01:00 PM,3.19072211,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:01:00 PM,4.37050003,25.0 C,33.4 %RHHP3458A,21/11/2018 8:01:02 PM,3.19072211,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:01:02 PM,3.19072211,25.0 C,33.4 %RHHP3458A,21/11/2018 8:01:05 PM,7.16935305,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:01:05 PM,3.19072211,25.0 C,33.4 %RHHP3458A,21/11/2018 8:01:07 PM,7.16935305,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:01:07 PM,7.16935305,25.0 C,33.4 %RHHP3458A,21/11/2018 8:01:10 PM,8.15781706,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:01:10 PM,7.16935305,25.0 C,33.4 %RHHP3458A,21/11/2018 8:01:12 PM,8.15781706,25.0 C,33.4 %RHKEITHLEY,21/11/2018 8:01:12 PM,8.15781706,25.0 C,33.4 %RHHP3458A,21/11/2018 8:01:15 PM,1.56956653,25.0 C,33.5 %RHKEITHLEY,21/11/2018 8:01:15 PM,8.15781706,25.0 C,33.5 %RHHP3458A,21/11/2018 8:01:17 PM,1.56956653,25.0 C,33.5 %RHKEITHLEY,21/11/2018 8:01:17 PM,1.56956653,25.0 C,33.5 %RHHP3458A,21/11/2018 8:01:20 PM,4.12928689,25.0 C,33.5 %RHKEITHLEY,21/11/2018 8:01:20 PM,1.56956653,25.0 C,33.5 %RHHP3458A,21/11/2018 8:01:22 PM,4.12928689,25.0 C,33.5 %RHKEITHLEY,21/11/2018 8:01:22 PM,4.12928689,25.0 C,33.5 %RHHP3458A,21/11/2018 8:01:25 PM,2.5474837,25.0 C,33.5 %RHKEITHLEY,21/11/2018 8:01:25 PM,4.12928689,25.0 C,33.5 %RHIan.

author: alm
author_rank: Super Contributor
timestamp: November 21, 2018, 09:03:04 pm
content: Quote from: IanJ on November 21, 2018, 08:11:35 pmI remember the error beep and having to send ":INITIATE:CONTINUOUS OFF" as one of the Keithley quirks, indeed. Took quite a while until I figured out the solution.

author: alm
author_rank: Super Contributor
timestamp: November 21, 2018, 10:49:53 pm
content: A quick test on a HP 3458A connected to an Agilent E2050A (predecessor of the E5810A without all the new-fangled stuff like web interfaces). I used a Python shell with python-vxi11 to send commands through the E2050A. This instrument is on GPIB address 20.Code:# Initialize>>> import vxi11>>> instr = vxi11.Instrument("TCPIP::1x.x.x.x::gpib,20::INSTR")# Send a random command to make it go to remote mode>>> instr.write('DISP ON')# At this point the REM annunciator is lit, and front panel keys other than local are disabled.# Send GTL>>> instr.local()# The REM annunciator turns off, and front panel keys work againI checked the manual again, and theLOCAL 7commands are for HP 200/300 BASIC, so they're irrelevant for modern computers. Sending those to the 3458A produces an error, as expected. You just have to tell the GPIB controller to send theGTLcommand and / or release the REM line. In the NI 488 C bindings, this would beibloc(), and pwlps describes a few posts earlier how to do it with VISA. In the VXI-11 bindings I was using for this test, it'sInstrument.local(). Before this, I issueDISP ONandTRIG AUTOto get the DMM into a usable state for interactive use.

author: IanJ
author_rank: Unknown
timestamp: November 21, 2018, 11:15:39 pm
content: Quote from: alm on November 21, 2018, 10:49:53 pmAha!......this prompted me to do more testing because pwlps had sent me an updated DLL to do just this (there are two applications, I am just modifying one of them right now)......but I think it was written to call GTL on shutdown of the app, which indeed does work and it releases the 3458A back to local mode. A good step forward though.Ian.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: November 22, 2018, 01:02:28 am
content: Wow, that reminds me of the HP 85 I used to use. We've come a ways.

author: acts238willy
author_rank: Regular Contributor
timestamp: November 22, 2018, 02:48:30 am
content: +Sadly, the old gear is still very good, ppm-wise.The Datron, HP, etc., GPIB stuff that all calls forthe HP85 needs a modern solution for data collection.I get some help from Digelent's program called'Labview Home'... it's a student copy of Labview,dated 2014, for less than $60. It has good toolsfor my 3458s.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: November 22, 2018, 04:03:29 am
content: With the right meter setup, say "F1R0Z0N3T3D3" to blank the display and fix the range, I can read at about 60 ms intervals. OK for what I tend to do, but not record breaking speed. How fast is your program?