3458a logging via Excel macro - Page 1
Forum section: electronics / general

author: IanJ
author_rank: Unknown
timestamp: February 03, 2017, 03:35:49 pm
content: Hi all,I have a 3458a and also a 34461A and with the latter have been using BenchVue to log data.......but recently with a project I have been working on I looked to try and log with the 3458a. I also have a 82357A GPIB/USB interface and look to see how I could get it working.I'm not into RaspPi and wanted a simple easy hookup......couldn't find much without delving into it so sent an email to Keysight pleading with them to add support for the 3458a to Benchvue.I got a phone call from Keysight UK and the guy explained the situation and that for the time being BenchVue looks a no-go.................however, he did have an Excel spreadsheet that contained a macro that connects directly to the 82357A and he was happy to let me have it and publish here.To get it running (in Windows) all you have to do is have the 82357A drivers loaded and set the instrument address (in my case it's GPIB0::22::INSTR ) on the Excel form.NOTES:Whenever power is cycled on the 3458A, the GPIB End or Identify (EOI) function must be enabled (this is in the marco). This indicates that data is available from the 3458A when requested by the PC. To query the 3458A ID, END ALWAYS or END ON must be set before sending the ID? command. Otherwise the PC receives no notification that data is available and will wait indefinitely for the data. This is what confuses many people.I can confirm that at least in my case I simply plugged everything in and set the address and hit the START button on the app and off it went. It logs the data to the Excel sheet as pictured below.I intend to play with the macro a bit and re-format the output a bit, and add some live graphs. A proper VisualStudio VB app may follow (once this project is out of the way).Have fun.Ian.PS. For latest version scan down the thread for the latest .zip

author: Pipelie
author_rank: Regular Contributor
timestamp: February 03, 2017, 03:46:16 pm
content: Thanks for share, I'll test it with my 3458 and 82357 tomorrow.

author: HighVoltage
author_rank: Super Contributor
timestamp: February 03, 2017, 04:30:11 pm
content: Thanks for sharing, I will give it a try

author: IanJ
author_rank: Unknown
timestamp: February 03, 2017, 05:57:19 pm
content: Hi all,Played with the macro a bit and converted the string from the 3458a to a real numbers i.e. float (double) all ready for inserting into a graph......I'm a C++ guy really so not sure why the error in the conversion.Code:inst_valueF = CSng(inst_value3)" 1.234354060E+00" to 1.234354019..........etc.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 03, 2017, 07:32:38 pm
content: Hi all,Threw on a couple graphs onto the 3rd sheet just to test and ran it for a while.Updated spreadsheet also attached (still with string to float conv. issue).Ian.

author: IanJ
author_rank: Unknown
timestamp: February 04, 2017, 10:48:07 am
content: Hi all,Attached new version.- Fixed float conversion of string- Now handles negative voltages.Value String from 3458a5.000081877000 " 5.000081877E+00"5.000080824000 " 5.000080824E+00"1.000026952000 " 1.000026952E+00"1.000026104000 " 1.000026104E+00"10.000042000000 " 1.000004200E+01"10.000044850000 " 1.000004485E+01"0.050005200610 " 5.000520061E-02"0.050004621590 " 5.000462159E-02"-5.000079829000 "-5.000079829E+00"-5.000081380000 "-5.000081380E+00"Ian

author: IanJ
author_rank: Unknown
timestamp: February 04, 2017, 12:51:28 pm
content: Hi all,Updated spreadsheet attached.Added ability to change graph scaling easily.Ian.

author: Pipelie
author_rank: Regular Contributor
timestamp: February 04, 2017, 12:58:45 pm
content: Hi IanJHere my test result. I have no idea what is going on.the 3458 seems respond and the "LSTN" on the VFD list after i click the start button.

author: IanJ
author_rank: Unknown
timestamp: February 04, 2017, 01:10:16 pm
content: Quote from: Pipelie on February 04, 2017, 12:58:45 pmPower up the 3458a with the 82357 GPIB connected......but not the USB.Wait till it all settles then plug in USB......wait till you get a green READY light only on the 82357B.I notice that sometimes it wont start, but hitting it again and all is ok.Also, set the NPLC on the 3458a to 10.......I notice that if I set it to 100 then it doesn't connect and I get the error per you do.I am new to all this also, not really sure if you 3458a address would be same as mine. I certainly had to change it from the setting I got.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 04, 2017, 01:44:06 pm
content: Quote from: Pipelie on February 04, 2017, 12:58:45 pmJust noticed on your screenshot you have set FUNCTION to DCV........leave it set to 0. I haven't looked this up yet so not sure what it does. Mine is always set to 0.Ian.

author: Pipelie
author_rank: Regular Contributor
timestamp: February 04, 2017, 01:47:05 pm
content: Yes, when I set the NPLC on the 3458 to 50 or 100 then it doesn't connect, when i set to 10,20 or 25, it's working correct.but Why can't we set the NPLC to the value we want, such as 50 or 100.

author: IanJ
author_rank: Unknown
timestamp: February 04, 2017, 01:52:36 pm
content: Quote from: Pipelie on February 04, 2017, 01:47:05 pmI think the 3458a is busy when mid NPLC and the comms can't connect or times out.On the PARAMETERS sheet on the spreadsheet there looks to be some provision for making more settings.....don't know yet how they work.The guy at Keysight did tell me it's a very basic macro (VBA) he's written and has little if any error checking. The mods I have made fall into the same category....Ian.

author: CalMachine
author_rank: Frequent Contributor
timestamp: February 04, 2017, 02:33:15 pm
content: This macro looks awesome!! I'm going to have to try this out. From my experience with BenchVue, which is extremely limited, I wasn't a big fan of it much.

author: branadic
author_rank: Super Contributor
timestamp: February 04, 2017, 02:51:45 pm
content: Obviously it's a timeout problem. Using Interactive IO tool there is a possibility to set timeout and this is important as timeout is depending on NPLC settings and wether ACAL is active or not.So I suggest to implement the possibility for setting timeout depending on those points including some amount of reserve.What about the limitation of longterm measurements using Excel? I remember the 32.786 lines limitation in the past. Where is it now? I'm sorry, but as a Matlab/Octave user I don't use Excel for measuring or analysing.

author: IanJ
author_rank: Unknown
timestamp: February 04, 2017, 03:48:21 pm
content: Quote from: branadic on February 04, 2017, 02:51:45 pmExcel supports 1,048,576 rows............and I just did a test using a macro and could write to row no. 1048576 no problem.So, 1048576 rows with a 2sec sample time = 24.2 days of data.If any more are required then the macro could easily be adapted to use consecutive columns to store the data.....or I guess write out to a fileIan.

author: TiN
author_rank: Super Contributor
timestamp: February 04, 2017, 04:01:45 pm
content: Excel (especially newer fancy-pancy 2007+ versions) superslow on plotting with multiple thousand samples.That's a reason why I dropped doing anything with data in Excel for few years already and moved to Raspberry Pi + simple plotting on webpage with D3.js, which works for me even today.Also being tied to PC was another deal breaker. It's much more useful for me to have little RPI tied to meter, so I can put it all in another room, start datalog, and forget about it for weeks.

author: IanJ
author_rank: Unknown
timestamp: February 04, 2017, 06:33:18 pm
content: Hi all,Just noticed the sample time entry doesn't work.......I'll fix that later.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 05, 2017, 10:58:36 am
content: Hi all,New version attached.I have fixed the sample time entry.......entered as HH:MIN:SEC as shown, so 00:00:05 is 5 secs. The previous version were all stuck at the same sample time.......so now if you enter 1 SEC it flies!I have also moved the code around and tidied it up, now installed as a module rather than on a sheet.There is one small bug......when you hit STOP it sometimes takes a couple hits as it seems to restart very briefly.The next thing I think I will do is offer a way to disable the chart function via a button......might be helpful on slower PC's to just log the data only........and I think it would be a good idea to also add in ability to save off the data to another file.I have a relatively slow laptop connected and am leaving it running on a 2 sec update and the chart (graph) configured to display a good few days of data.......we'll see how it performs.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 05, 2017, 04:30:23 pm
content: Hi all,New version attached.- Changed the chart type, I had selected smooth type instead of straight lines between plots. Oops!- No longer required to select the chart before hitting the SCALE AXIS button.- Added a very simple EXPORT DATA button which saves off the data (and headers) to a CSV file located in the same folder as the spreadsheet. The current date is included in the filename.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 05, 2017, 05:00:27 pm
content: Hi all,Seems as though that although there's no limit to the number of rows in Excel there is a limit to the number of data points on a graph....32k........there is a way round it.....looking at it now.Ian.UPDATE:Looks like there is no 32k limit on certain versions of Excel, a non-commercial 2007 version I have is limited to 32k but on a full 2010 version I have I filled all 1048576 rows with data and they appeared to plot ok. I had made a small error in the chart config and was limited to 200 points.The chart does slow down and takes a few seconds to load or even access the GRAPH page but it does work.Ideally, I'll modify things so that the graph doesn't process and plot till the user hits a button which would speed things way up.......I'll look at this in the next few days.For now and for my own use characterizing my new Precision Digital Voltage Sources here:http://www.ianjohnston.com/index.php/onlineshop/handheld-precision-digital-voltage-source-v2-detailthen this will do just fine.New version attached.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 05, 2017, 07:23:03 pm
content: Hi all,Achhhh, I couldn't resist making the mods now.........New version attached.Added a SHOW/HIDE button on the chart page to make the chart visible/invisible. By default when you hit the START button on the main page to begin logging it will make the chart invisible in the background so that when you navigate to the chart page it does not slow up excel. You can make the chart visible at which point it will plot all data points when you hit the SHOW/HIDE button or when you make any mods to the axis.Ian.

author: Assafl
author_rank: Frequent Contributor
timestamp: February 06, 2017, 08:06:53 am
content: Fromhttps://support.office.com/en-us/article/Excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3Excel 2007:Worksheets referred to by a chart 255Data series in one chart 255Data points in a data series for 2-D charts 32,000Data points in a data series for 3-D charts 4,000Data points for all data series in one chart 256,000Excel 2010 & Higher:Worksheets referred to by a chart 255Data series in one chart 255Data points in a data series for 2-D charts Limited by available memoryData points in a data series for 3-D charts Limited by available memoryData points for all data series in one chart Limited by available memory32 & 64 bit (I don't think it is likely the 32 bit limitation is ever exceeded):32-bit environment is subject to 2 gigabytes (GB) of virtual address space, shared by Excel, the workbook, and add-ins that run in the same process. A data model’s share of the address space might run up to 500 – 700 megabytes (MB), but could be less if other data models and add-ins are loaded.64-bit environment imposes no hard limits on file size. Workbook size is limited only by available memory and system resources.(BTW - A June update for 32-bit Excel 2016 added support for LAA that lets it access 4-gig in 64-bit and 3-gig in 32 bit Windows. See:https://support.microsoft.com/en-us/help/3160741/large-address-aware-capability-change-for-excel)I have been using Excel 2016 (64-bit) for about a year and it is blazingly fast on low-to-mid level hardware (16G RAM, i5, 64-bit). (NB - the 64-bit choice was not for hobby DMM logging - I used to analyze network security logs which were gigs in size which I would sometimes try winnow and pivot - and not always successfully).

author: IanJ
author_rank: Unknown
timestamp: February 06, 2017, 11:50:09 am
content: Hi,Hmmmm, I might take a look at Excel 2016 for my own use if it's much faster!PS. The 3458a spreadsheet filled with 1048576 captured data records is about 20mb in size and which includes the final output & 3458a raw string.I have been trying the 3458a spreadsheet at work where we have Excel 2013 and it fails on a couple points albeit it may be the squeaky tight security model we have.........but anyway I'll make some more mods tonight to fix this and hopefully make the spreadsheet more compatible.Ian.

author: acts238willy
author_rank: Regular Contributor
timestamp: February 06, 2017, 08:33:33 pm
content: Has anyone used Open Office's spreadsheet?I don't have excel - and it's a chore to get Benchviewon this old computer, only to find that it won't work.

author: e61_phil
author_rank: Frequent Contributor
timestamp: February 06, 2017, 10:50:13 pm
content: Quote from: acts238willy on February 06, 2017, 08:33:33 pmPython is a very nice and easy to learn language which is very powerfull to control your gear.Here someone used Python together with OpenOffice for data acquisition:https://forum.openoffice.org/en/forum/viewtopic.php?t=37405&p=171732

author: Assafl
author_rank: Frequent Contributor
timestamp: February 07, 2017, 07:45:19 am
content: Quote from: acts238willy on February 06, 2017, 08:33:33 pmTried it on the RPi 3 - and the log csv had a 100k lines or so with 6 columns per line. The thing just hung there, took minutes to filter it, and never got to a graph.... Mathematica also took time but was faster.Eventually just got it to the desktop and response was immediate.Mind you: The RPi 3 is not the best device for a spreadsheet so it not fair to compare Excel on a 16G i5 machine with an NVMe SSD, with Open Office on a RPI 3 (even with a good class SD card..).

author: enut11
author_rank: Super Contributor
timestamp: February 07, 2017, 09:46:42 am
content: @IanJHi I got excited when I saw your post as I have wanted to get some data logging on my HP3456A for some time. I have an Agilent 82357B.However, Win 10 refuses to recognise the 82357B at all. My other PC, a laptop with Win XP recognises the 82357B but crashes on running the spreadsheet (Excel 2007). I tried both the original and final versions of your spreadsheet. Help.enut11

author: branadic
author_rank: Super Contributor
timestamp: February 07, 2017, 11:10:54 am
content: Have you installed the driver for 82357B? The driver is available in Keysight IO Libraries Suite:http://www.keysight.com/en/pd-1985909/io-libraries-suite?nid=-33330.977662.00&cc=DE&lc=ger&cmpid=zzfindiosuite

author: IanJ
author_rank: Unknown
timestamp: February 07, 2017, 11:55:05 am
content: Quote from: enut11 on February 07, 2017, 09:46:42 amYes, it doesn't look like you have the drivers loaded/available to the 82357B. It's a 900mb download of which the drivers are just a few mb.Before you open the spreadsheet wait until the 82357B has just one green LED lit.Worth also checking the address of your 3458a matches the spreadsheet.If I can get my 3458a back up and running tonight then I'll have a new version of the spreadsheet to upload.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 07, 2017, 06:03:15 pm
content: Hi all,New version attached.- Added more info to the header like temperature, No. of cals, error code status, current value read etc.- Have turned on the GPIB buffer, apparently this has to be on to be able to get full access to the status register.- Capturing more input value ranges.Things NOT implemented yet:-- If you set a large NPLC but a small sample time you'll likely crash the spreadsheet. There is some error checking to try and capture this via the status register but not sure if it's working yet......not really sure how it works....I need to get my head around it.Ian.

author: branadic
author_rank: Super Contributor
timestamp: February 07, 2017, 07:19:06 pm
content: I don't use Excel either but have LibreOffice installed. Seems the macro is not compatible with it.

author: enut11
author_rank: Super Contributor
timestamp: February 08, 2017, 12:23:22 am
content: Quote from: branadic on February 07, 2017, 11:10:54 amThanks branadic. Done that. Now Excel has trouble connecting to the HP3456A and refuses to run.enut11

author: enut11
author_rank: Super Contributor
timestamp: February 08, 2017, 12:32:37 am
content: Quote from: IanJ on February 07, 2017, 11:55:05 amThanks Ian. Drivers loaded. Green light on. My HP3456A address is 23 so changed to that. When I run macro, error cannot connect to instrument. Does it matter that I am not using an HP3458A?enut11

author: Bud
author_rank: Super Contributor
timestamp: February 08, 2017, 05:49:26 am
content: Try my crude adaptation spreadsheet for 3456A.(Parameters sheet is not used).Worked with my Agilent clone adapter.

author: HighVoltage
author_rank: Super Contributor
timestamp: February 08, 2017, 12:31:25 pm
content: OK, I just tried your version 10 for the first timeThe Keysight I/O library was installed, so the USB adapter was found without problemsAs soon as I opened up your Excel file and enabled editing and hit start, all worked well and the collection of data started.No changes made to the settingsA few observations so far:- Once in a while I get "Syntax Error" listed in the Last Error Message but then it continues with the next reading- Every time I hit the start button, the first reading is copied to the Error Registry (decimal): spot and just stays there.- If I set the NPLC: to 100 the software hangs and does nothing and does not recover and requires a restart of the Excel Macro- In your Value column I see a value with lots of additional zeros and a wrong decimal place- Current Value is not showing any value, just ####Improvements request- Can you add to log the internal temperature with each reading- Can you leave a field to add a string during initialization, may be just below the NPLC entry?In general it seems to be a great way of storing the data from the 3458A

author: TiN
author_rank: Super Contributor
timestamp: February 08, 2017, 12:55:30 pm
content: QuoteHave a mercy for input relays K6,K7,K1, their life time is not inifinite...Better to have every 50th or 100th or other bigger n-th reading. I mean you don't really need to know temperature every 10 seconds anyway.

author: IanJ
author_rank: Unknown
timestamp: February 08, 2017, 06:43:59 pm
content: Hi all,New version attached.- Fixed a problem with STOP, it now actually stops everything including the internal timer which was left running in previous versions.- Added in some error handling.- Added a 'resume' button......the idea that after you hit stop you can resume from where it left off at any time. I'm guessing if you want to stop, then manually CAL and then carry on again.Ian.

author: quarks
author_rank: Frequent Contributor
timestamp: February 08, 2017, 07:11:33 pm
content: Hello Ian,thanks a lot for sharing.It works well with my 3458A.byequarks

author: IanJ
author_rank: Unknown
timestamp: February 08, 2017, 07:15:39 pm
content: Quote from: HighVoltage on February 08, 2017, 12:31:25 pmI get the same syntax problem with last message......I'm just passing on what the library gives me so need to look deeper.The next version will update the error register every time. At the moment it only reads it at the start.large NPLC like 100 is a problem I have yet to get to. There's an issue with trying to talk to the 3458a whilst it's 'busy' and I've yet to bottom this out. For now, if you set a high NPLC then just make sure your sample time set is greater than the NPLC time.....albeit I haven't tried that.Assuming you set 10vdc the 3458 responded with E+01 which means a x10 multipier needs set on the string...thus you should see 10.0nnnnn.....not sure why it's not processing properly for you. Will do some more testing.Would be nice to know what you get for 0.1v, 1v ranges etc.....The #### on current value is just because the string is too long for the cell.......because of above problem.Not sure what you mean by add a string during initialization?Ian.

author: IanJ
author_rank: Unknown
timestamp: February 08, 2017, 09:40:17 pm
content: Hi all,New version attached.- Bugfix.......as noticed by HighVoltage some parameters on the status panel appearing where they shouldn't be.- Error register now updating at each sample reading.My 3458a and 82357B are just horrific together.......sometimes GPIB stops listening for an hour or so then back on again. Sloooooo development!!!Ian.

author: IanJ
author_rank: Unknown
timestamp: February 09, 2017, 06:58:58 pm
content: Hi all,New version attached.- Tidy up code.- Added the text "PAUSED" on the row after a STOP/RESUME so there's a record of when the logging had technically been interrupted.Ian.

author: Tony_G
author_rank: Super Contributor
timestamp: February 09, 2017, 09:28:22 pm
content: This is outstanding.Made a couple of changes to v12 on the Graph page - Put MAX(Datalog!D:D) and MIN(Datalog!D:D) in for the Y values so now the graph autoscales to the data in the list and set the max X to be Datalog!E8.This gives me an auto-scaling graph - Perf probably sucks but I'm going to let it capture a bunch of data and check it out.TonyG

author: Theboel
author_rank: Frequent Contributor
timestamp: February 09, 2017, 11:30:34 pm
content: Hi All,Are this macro only applied for 3458A ?

author: IanJ
author_rank: Unknown
timestamp: February 10, 2017, 01:19:58 pm
content: Hi all,New version attached.Tony_G's idea of auto-scaling the y-axis I think is a great one......so i've implemented an additional button on the graph page to facilitate this.One caveat, some versions of Excel (2007 I think) only allow 65536 rows maximum to scan, but of course the limit on others is 1048576. So, you may get an error when you hit the auto-scaling button.Theboel - My work is centred around the 3458a......but it may work with tweaks for other similarly old meters by HP/Agilent/Keysight.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 11, 2017, 04:42:25 pm
content: Hi all,New version attached.- Slight mod to the auto-scale function, cells C3 & C4 on the graph page now update to reflect the auto-scaling Y-axis values if applied.The attached also has 26hrs of data after I hooked up a voltage reference (not mine) set to 5v. As can be seen I paused the logging 7 times to ACAL DCV.I only stopped it because my logging failed......dang faulty GPIB..!Ian.

author: enut11
author_rank: Super Contributor
timestamp: February 11, 2017, 08:51:15 pm
content: Quote from: Bud on February 08, 2017, 05:49:26 amHi Bud. Thanks for the sheet. I connected my 82357B to Win XP laptop running XL2007. Got the green light on the adapter. This is what I got. Any idea on how I can fix the spreadsheet?enut11

author: Bud
author_rank: Super Contributor
timestamp: February 11, 2017, 11:07:11 pm
content: Do you have Keysight IO Libraries Suite installed? The Excel macro relays on it as the underlaying GPIB communication engine.

author: enut11
author_rank: Super Contributor
timestamp: February 12, 2017, 12:56:15 am
content: Hi Bud. Yes, installed the Keysight I/O libraries on the old Win XP PC. I suspect it is a limitation with XL 2007.I have had success with my Win 10 desktop PC. It now recognises the 82357B and turns on the green light. All I did was change USB port. Strange.Your 3456A.zip file worked and I am now happily logging data from my home made LM399 10v reference.. Thank you a lot for this modified version.Would you mind sharing how you did it in case I want to adapt it for another meter?enut11

author: Bud
author_rank: Super Contributor
timestamp: February 12, 2017, 06:04:45 am
content: Sorry I did inline edits in the code and did not keep track of them. To see the code click Developer tab , then Visual Basic as shown in the attached picture. It will open the project view and in the left pane click Sheet1, all code is there.

author: enut11
author_rank: Super Contributor
timestamp: February 12, 2017, 11:51:41 am
content: Hi BudWhen I put a short across the HP3456A input, I get the following output into XLValue-7.00000002407108E-10String from 3456A-000.0007E-3ie, there seems to be a difference of x1000 between the 'string' and the 'value' which is recorded.enut11

author: IanJ
author_rank: Unknown
timestamp: February 12, 2017, 02:46:10 pm
content: Quote from: enut11 on February 12, 2017, 11:51:41 amThose are configurable in the macro code.....the macro reads the last 4 digits of the string sent via GPIB and converts to a number and multiplies it by whatever value to get it reading correct in say VDC..........but E-3 is a bit unfamiliar and doesn't conform to the 4-digits. I'd need to know what was the actual reading on the meter.Sample:Code:If InStr(inst_value, "E-08") <> 0 Then ' 0.00001mVinst_valueFinal = inst_valueF / 100000000GoodRead = TrueEnd IfAnd another example:Code:If InStr(inst_value, "E-03") <> 0 Then ' 1mVinst_valueFinal = inst_valueF / 1000GoodRead = TrueEnd IfIan.

author: enut11
author_rank: Super Contributor
timestamp: February 12, 2017, 06:24:19 pm
content: Hi3456A meter reading with a short was:-00.0007 -3'-3' being the exponent indicating millivolts.enut11PS1: I did notice that when I edit the string in XL that I have to backspace 4 times to delete what appears to be only 3 characters, ie 'E-3 ', so there must be another hidden character after the 3?PS2: It is only voltages below 100mV that are affected

author: IanJ
author_rank: Unknown
timestamp: February 12, 2017, 08:24:58 pm
content: Quote from: enut11 on February 12, 2017, 06:24:19 pmVersion 16 below has some changes in line with this issue you could copy n paste........I haven't looked at it properly though as I don't have a 3456A.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 12, 2017, 08:30:30 pm
content: Hi all,New version attached.1. New user variable on the main screen, an attempt to make sure the macro's stay within the limits of the users version of Excel and the number of row limitations etc. A new HELP sheet explains in a bit more detail.2. Added an experimental scroll bar below the graph. Set the width of the chart and then scroll around the entire data with that width. Be nice if it was faster, but thats Excel!Ian.

author: Bud
author_rank: Super Contributor
timestamp: February 12, 2017, 08:45:08 pm
content: Quote from: enut11 on February 12, 2017, 11:51:41 amTry this version (the Graph sheet borrowed from IanJ's work)More parameters have been implemented, but not all error conditions checked, i.e. range matching the device mode, up to the user to set up parameters properly.

author: Tony_G
author_rank: Super Contributor
timestamp: February 12, 2017, 09:07:17 pm
content: I was having a problem with accidently hitting the stop button multiple times and erroring out. This can be addressed with:Code:Sub StopBtn_Click()On Error GoTo errHandlerTimerActive = FalseSheets("Datalog")..Value = "STOPPED"Application.OnTime timetorun, "Refresh", , False ' kill refreshExit SuberrHandler:Resume NextEnd SubNow 'On Error Goto/Resume Next' is a fairly big stick to solve this issue with but I'm not an Excel guy so it was the easiest way to address the issue (which was the second time you click the stop button it tries to unscheduled an activity that has already been unscheduled and therefore it fails).TonyG

author: enut11
author_rank: Super Contributor
timestamp: February 13, 2017, 02:34:21 am
content: Quote from: Bud on February 12, 2017, 08:45:08 pmHi Bud. Nice implementation of the XL Sheet for the HP3456A. Works well. Sub 100mV log error solved. Also like the pic of the meter front panel.Thanks IanJ. I like the instant graph at the end of logging.enut11

author: Bud
author_rank: Super Contributor
timestamp: February 13, 2017, 06:25:38 am
content: Happy logging!

author: IanJ
author_rank: Unknown
timestamp: February 13, 2017, 04:59:56 pm
content: Hi all,The 82357A GPIB USB interface is doing my nut in (it is a clone!).......so today hooked up a 82350B GPIB PCI interface and happily the 3458a is logging away fine with that. Hopefully it will be reliable and not reveal my connectivity issues have been with my 3458a all along.The PC I installed it into also has Excel 2016 on it, so will be eager to see any differences.Home for my 3458a these past few months has been my server cupboard......far more temperature stable than my workshop.Out of interest the whole underside of the PC/NAS shelf has tin foil (raided from the wife's workshop, I mean kitchen), and with an extra layer under the wifi router.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 13, 2017, 05:50:54 pm
content: Hi all,New version attached.- Bug fix, wrong data type (int instead of long) meant No. rows were limited and START failed/hung.- User can now preset 3off variables that relate to their version of Excel limitations. Apparently, 1048576 & 32000 are possibles.Ian.

author: Tony_G
author_rank: Super Contributor
timestamp: February 13, 2017, 05:52:02 pm
content: [Just as I hit submit I see that Ian already posted a fix - Leaving for posterity]I've been playing with the macro & my 5440B and there is a bug in the type definitions.The line:Code:Lastrownum = Sheets("Datalog")..Valuewill error out if you change the Last Row Available value to something bigger than 16 bits. To fix this, change the definition to a long:Code:Dim Lastrownum As LongFound this because I wanted to capture 24 hours of data at 1 second intervals.TonyG

author: Bud
author_rank: Super Contributor
timestamp: February 14, 2017, 06:42:41 am
content: After some fight with the Keysight IO libraries and Agilent clone adapter I was able to add HP 5334A frequency counter, I will share the script after some polishing.

author: Tony_G
author_rank: Super Contributor
timestamp: February 14, 2017, 04:01:08 pm
content: I just tried to use _17 and I got a "Can't find project or library" error - Checking the references in Tools->Reference showed that it used an earlier version of the 488.2 Formatted IO library than what I had installed - Just an FYI if someone else runs into this (BTW I'm using the beta of the Keysight IO Libraries, seems pretty good with new UI that groups things that I use more logically)Also I'd propose this change again to StopBtn_Click():Code:Sub StopBtn_Click()On Error GoTo errHandlerTimerActive = FalseSheets("Datalog")..Value = "STOPPED"Application.OnTime timetorun, "Refresh", , False ' kill refreshExit SuberrHandler:Resume NextEnd Subthis works around multiple clicks of stop button - You could dig deeper into the error and only trap the one specific to the .OnTime call (1004 I think) if you wanted to be more focused.TonyG

author: IanJ
author_rank: Unknown
timestamp: February 14, 2017, 08:26:51 pm
content: Quote from: Tony_G on February 14, 2017, 04:01:08 pmGood idea about multiple stops pressed.Ian.

author: IanJ
author_rank: Unknown
timestamp: February 14, 2017, 08:34:04 pm
content: Hi all,New version attached.1. Multiple STOPS were bringing up and error.....all masked off now so hit it as much as you like it'll be ignored.2. Pressing RESUME when running i.e. without hitting STOP first also masked off.3. Pressing STOP or RESUME when the logging hasn't even been started for that session masked off.The above a bit of a quick hack using flags but seems to work fine.Flags are great but sometimes a pain....you can end up going round in circles....Ian.

author: enut11
author_rank: Super Contributor
timestamp: February 15, 2017, 02:15:48 am
content: So far I have only been using an early version of this logging spreadsheet modified by Bud to work with the HP3456A. Works well.However, if IanJ keeps developing it for HP3458A I may have no choice but to get one

author: IanJ
author_rank: Unknown
timestamp: February 15, 2017, 11:28:45 pm
content: Hi all,I was thinking of adding in some functionality to backup the cal data in the 3458a. There are a few utilities out there but I can't seem to find the GPIB commands to run to then be able to download the file from the 3458a........if anyone knows then I'll look to add this to the macro.The longer I own my 3458a the longer I keep thinking I should have the cal backed up!Ian.

author: Pipelie
author_rank: Regular Contributor
timestamp: February 16, 2017, 01:38:12 am
content: Quote from: IanJ on February 15, 2017, 11:28:45 pmHi, IanJI think you can find it here:https://xdevs.com/article/hp3458a_gpib/https://github.com/bsdphk/pylt/blob/master/hp3458a.pyhttps://www.eevblog.com/forum/projects/3458a-calram/http://on5vl.e-monsite.com/medias/files/program-hp3458a-calram-mread.txt

author: IanJ
author_rank: Unknown
timestamp: February 17, 2017, 02:29:30 pm
content: Hi all,Found a small bug......will hopefully fix this weekend.If I am logging away quite nicely, say 2.00000vdc from my hand held voltage source and the batteries die then the output obviously drops to zero......and it looks like at that point the spreadsheet hangs.......almost as if the resultant input voltage to the 3458a is out of range of the parser......but I'm not so sure it is......since I go all the way to E-10.Could be some other wierdness.Ian.UPDATE:Looks like it has to do with range switching. If I vary my source from 2v to 10v and anywhere in between it's fine, but if I drop to 1v then the spreadsheet hangs.Looking at the Keysight IO Monitor there's an error logged:Excel.exe, VISA::viRead, VI_ERROR_TMOThen it times out, and a viClose.UPDATE 2:I see whats happening......if NPLC is set to 50 then 2v is ok, 1v is not. Set NPLC to 10 and all is fine.I need to sort the NPLC thing!!Ian.

author: IanJ
author_rank: Unknown
timestamp: June 25, 2017, 07:06:36 pm
content: Hi all,Am building a new, much more temperature stable workshop and plan on making good use of the excel macro for some long term testing.One thing I was hoping to do if indeed the 3458a experts thinks it's appropriate, is to have the macro run ACAl DCV every hour or so automatically. Is this really required to do?.......or is it the case it's not required to do if my workshop is temperature stable 24/7.If it is appropriate, does anyone know the GPIB syntax for ACAL DCV.......I can't seem to find it.Thanks,Ian.

author: TiN
author_rank: Super Contributor
timestamp: June 25, 2017, 07:36:17 pm
content: Code:hp3458a.write ("ACAL DCV")delay(140 seconds). But I'd run ACAL on every 1C of ambient temp change, instead of every hour. It's little point to rerun ACAL if temperature is stable (which is NOT easy to get).

author: IanJ
author_rank: Unknown
timestamp: September 03, 2017, 09:48:32 am
content: Hi all,I have added temperature data logging to the spreadsheet.Go to the new TEMPer1 tab on the spreadsheet and follow the instructions there.I have a couple of irons in the fire regarding getting temp logging into the spreadsheet and this is the first attempt that works. It's a bit finnicky to setup up but seems reliable. It's also a bit slow (to change) but as it's a cheap probe I had lying around I thought I'd give it a go.USB temp probe = TEMPer1 (from PCSensor.com but you can get on Ebay etc)Uses a free third party app, not the PCSensor app from Thermohid.co.ukThe thermohid app acts as a web server and the Excel spreadsheet picks it up the data from there.Forgot to mention in the instructions to setup the thermohid app to change the READY EVERY setting on it's main page to say 30secs.Also, you'll see on the graph below that the temperature seems mega stable at the start......but it is working, I'm just not sure why it seems to be sat at 22.3degC.......my room can't be that good!- Update: The temp sometimes just seems to stick at 22.31, always 22.31, but if you touch the probe with your finger it'll jump it back into operation again. The native app running on it's own does the same thing. I'm guessing a firmware/driver bug!Update 5/9/17: Appears it's my KVM switch, coz although it's on a different USB port of the PC it somehow has an effect on the TEMPer1 USB comms.Still working on a much more elegant solution......but for now here is 3458A_19_TEMPer1.Ian.

author: IanJ
author_rank: Unknown
timestamp: September 03, 2017, 10:26:50 am
content: Quote from: Flinstone on September 03, 2017, 10:12:21 amThe Thermohid app website lists the following:-HidTEMPer (without external probe)HidTEMPer1 (with external probe)HidTEMPer2 (internal and external probe)HidTEMPer2V1.1 (internal and external probe. New)HidTEMPerHUM (internal and relative humidity)HidTEMPerHUMV1.0 (internal and relative humidity. New)HidTEMPerNTC (internal and external probe)HidTEMPerNTCII (internal and two external probes. ThermoHID currently only supports one probe)HidTEMPer (gold) (without external probe, waterproof shell)HidTEMPerV1.2 (without external probe. New)HidTEMPer1K2 (internal and K-Type thermocouple. New)Quote "Note: It does NOT support the older USB TEMPer devices that use a USB serial port (pre mid-2009)Example: Device Manager reports the TEMPer Hum device as USB-Serial CH340If anyone still wants me to incorporate this device then let me know as I now know how to drive it."Seehttp://www.thermohid.co.uk/Ian.

author: IanJ
author_rank: Unknown
timestamp: September 03, 2017, 11:27:24 am
content: Hi all,Just a quick note.......Ian over atwww.dogratian.com/productshas modified his software so that it will serve Excel directly........so I'm waiting on a couple of his temp probes and hopefully this will be the final, non cludgy solution to getting temperature logging into the Excel spreadsheet. No need to have a separate app runing as Excel calls his .exe directly to get the data.PS. His temp probes and interface is 14bit resolution.Ian.

author: IanJ
author_rank: Unknown
timestamp: September 11, 2017, 08:24:51 pm
content: Hi all,Version 20 of the spreadsheet attached which utilizes a different temperature sensor to version 19. This one uses the DogRatIan BME-280/SHT10 based sensors per:http://www.dogratian.com/products/index.php/menu-sensors/menu-usb-pa-type-a-bmp085&http://www.dogratian.com/products/index.php/menu-sensors/menu-usb-tnh-sht10I have tested with both sensors and they work ok, the TNH-SHT10 sensor is the more accurate.Install the driver from DogRatIan's site and get the COM port it's been added as.......you'll need to input that to the spreadsheet config area. You can test the sensor at the DOS prompt level if you want to.Attached also is the executable which the spreadsheet will call, you don't need to run any other program separately. You only need add the path to the spreadsheet config area also so the macro knows where the exe is.Both temperature and humidity are logged, but I haven't added humidity to the graph.PS. I have only been running this a short time, still lots of testing to do and some optimization to do.Update: There's a wee issue, to config properly you'll need to set the com port manually in the macro as well as the config screen. The following line change COM10 to whatever com port your system adds the port as:Code:ShellRun (TempExePath & "get_pa_msw.exe -d COM10:115200,N,8,1 -a")I'll fix this properly in the next version.Ian.

author: IanJ
author_rank: Unknown
timestamp: September 12, 2017, 06:23:55 pm
content: Hi all,New Version 21 attached. The main changes as follows:-- No need to manually edit macro to set COM port/baud rate. Simply change the values on the main form.- Have added a new button to auto scale the Y-axis (voltage) based on a centre value and window (+/-) that the user enters onto the form. This makes it much easier/quicker to zero in down at the uV level.Notes:- This version uses the DogRatIan BME-280/SHT10 temperature & humidity sensor.- When the temperature sensor is read you will see a popup appear then disappear very quickly. This is normal and not much I can do about it at the moment.To do:- Re-write the method the macro uses to access the temperature sensor serial port. At the moment it uses CMD but I'd rather it sends via the serial port properly for reliability. The issue here though is that apparently different version of Excel require different methods to access the port hence why I used the CMD method in the first place. Hmmmm!Ian.

author: quarks
author_rank: Frequent Contributor
timestamp: October 06, 2017, 08:07:12 am
content: I also have tested v21, but unfortunately so far I could not get V21 running (see att.).Looks like the same problem Flintstone has.On the other hand V15 is still running well with my setup.Any hints what could be wrong?

author: Tony_G
author_rank: Super Contributor
timestamp: October 06, 2017, 02:31:06 pm
content: Quote from: Flinstone on September 30, 2017, 06:48:34 pmI assume you've checked and the file is in fact missing?On my machine I don't have the VisaCom directory, I have a VisaCom64 one - This may be related to an architecture problem, are you running a 64 bit OS and 32 bit edition of Office? I say that because "Program Files" is the 64 bit program folder and "VisaCom" implies the 32 bit folder when considered with my installation having a "VisaCom64" and being a 64 bit install.Maybe Ian built it on a 32 bit machine and it's looking in the wrong location.You could try and correct that in the add-in by removing the library and then re-adding it.TonyG

author: Tony_G
author_rank: Super Contributor
timestamp: October 07, 2017, 04:06:37 pm
content: Unfortunately I'm in London right now so I can't get a sensor and try it out. Hopefully Ian sees the thread and can respond.TonyG

author: IanJ
author_rank: Unknown
timestamp: October 07, 2017, 04:51:56 pm
content: Hi Flintstone,Haven't had much time to look at this issue, but here's some info.I am running this on a 32-bit Win7 PC.I have attached my most recent excel file and the exe I was actually using.Standalone test gives same results as you.Ahhhh, but wait a minute......I just noticed on your screenshot you are getting a negative number from your 3458a (Current Value).......there are issues there and is also one of the reasons why certain voltage ranges needs certain maximum/minimum NPLC settings. Can you apply a voltage more than +1vdc and less than +10vdc and see what happens.I think maybe (hopefully! ) your temp sensor is failing because the macro is failing due to the voltage range and therefore not reaching the routines for the temp sensor properly.The 3458a GPIB macro code really needs a good going over so that it's not so easy to trip up.Ian.

author: IanJ
author_rank: Unknown
timestamp: October 08, 2017, 03:43:34 pm
content: Flintstone,I have looked through the macro code to see if I'd left any issues like hardcoded paths, baudrates etc but can't see anything as yet.Could you try a vaud rate of 115200 on the spreadsheet, thats what I run mine at.Could you also try a root path for the EXE instead of what you have.....i.e. copy your EXE to F: and set accordingly.I wonder if it's a permission problem and your macro won'r run the EXE. Is your drive F: local, or is it a mapped drive across a network for instance?With the above positively tested then it looks like the macro in your case is not getting the number from the device, it's getting something else......so to test this could you change those NaN cells, at least the first 10 rows to GENERAL (right click, format cells)......then let me know what you get.Could you attach your spreadsheet so I can take a look at it.......after you have captured some data.Ian.

author: IanJ
author_rank: Unknown
timestamp: October 08, 2017, 05:18:29 pm
content: Could you try copying the EXE and your excel file to c:\windows\system32 and try running from there. I am wondering if it's a problem with Set oShell = CreateObject("WScript.Shell") on your system.Am also a bit concerned you need to set the baud rate under device manager.......I never needed to set anything there at all.PS. My OS is 32-bit and I didn't need to modify the path of BasFrmIO.dllHmmmmm!Ian.

author: IanJ
author_rank: Unknown
timestamp: October 08, 2017, 09:50:19 pm
content: I get the 4 lines also, the macro reads the first 2.Also, here's my Device manager port settings (all default):Communication Device Class ASF example (COM11)Port settings: 9600, 8, None, 1 NoneAdvanced: Use FIFO checked, both sliders at max, Com Port Number= COM11Driver: Atmel Ic., 08/01/2013, 6.0.0.0 etc........It concerns me that you need to force the baud rate.......which may be related as to the failure of the macro to get the data.I will try to write a small test excel spreadsheet tomorrow for you that all it does is get the temperature & humidity, no 3458a GPIB.Ian.

author: IanJ
author_rank: Unknown
timestamp: October 09, 2017, 05:49:32 pm
content: Hi Flintstone,See attached stripped down spreadsheet which all it does is get the temp/humidity when you press a button. There's no 3458a GPIB stuff or libraries loaded.I have just tried this on a 64-bit Win7 PC and it's fine......I assume it will work on my usual 32-bit Win7 logging PC as well.One other thing......my USB-Tnh has version 2.01 2014-OCT-04 stamped on the Pcb.Ian.

author: IanJ
author_rank: Unknown
timestamp: October 09, 2017, 08:51:44 pm
content: Hi Flintstone,Dogratian sells both the V1 & V2 on his site it looks like........I suggest you contact him an maybe exchange for the same version as I am using. You can mention to him that you are using the sensor with Excel as per me..........he is aware of this thread after we had a dialog when I was looking into using his products for the 3458a logging. He sent me the EXE in an email so am not sure it's a special version.......an then again maybe the firmware is special version also.I suspect that despite the appearance that at the DOS CMD prompt the results are the same against both sensors it looks like they react differently when running from a shell script within an Excel macro.To be fair, the method I am using to communicate in Excel with the sensor is not ideal, it's a bit of a hack really......if it was proper serial comms with the device then probably either version could be used.PS. Send him that latest TEST spreadsheet if you communicate with him.Ian.

author: IanJ
author_rank: Unknown
timestamp: October 11, 2017, 07:02:27 pm
content: Hi all (Flintstone),Here's a new version that interfaces with the temp/humidity sensor properly. No more shell dos prompt.It requires running a wee Windows app in the background that just sits and grabs the data from the sensor.The app then sends data using the Windows Clipboard to Excel in the background.Simply run the EXE, setup the com port to your sensor and hit START and you should see the data on the app. Then open the Excel spreadsheet per normal.The Windows app and version 22 of the spreadsheet are in the zip.Upsides:- Faster & cleaner than the old method.Downsides:- It takes over usage of the Windows clipboard so after you hit START on the app you can't really use the clipboard for any other sort of copy/paste.The wee app is actually a stripped down version of Dogratian's VB app he kindly provided the source code on his site. I just removed the bells n whistles from it, added some code to copy the data to the clipboard and compiled my own EXE.PS. I tried to read/write the serial port from Excel macro but it's a nightmare to do so came up with this method. I have tested it for about 10mins only so not sure how reliable it will be.Ian.

author: dogratian
author_rank: Newbie
timestamp: October 12, 2017, 01:12:59 am
content: Hello, everybody. I am here to clarify the version about the USB sensor.1) The version stamp on the PCB is the hardware version.Version 1.xx hardware is for no plastic case.Version 2.xx hardware is for the sensor with hardware case.2) To check the firmware version, use a terminal program and type in "GV". It will response the firmware version.Version 2.xx firmware was released 3 years ago. All sensors bought after that should be Version 2.xx.The baud rate to access the sensor is not important. It is because data is direct handle at USB layer and no actual serial communication. However 115200 is my suggested value.