Author Topic: 3458a logging via Excel macro  (Read 28345 times)

0 Members and 1 Guest are viewing this topic.

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 1594
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: 3458a logging via Excel macro
« Reply #75 on: September 12, 2017, 06:23:55 pm »
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.
« Last Edit: September 13, 2017, 10:44:30 am by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 
The following users thanked this post: quarks

Offline quarks

  • Frequent Contributor
  • **
  • Posts: 874
  • Country: de
Re: 3458a logging via Excel macro
« Reply #76 on: October 06, 2017, 08:07:12 am »
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?
 

Online Tony_G

  • Frequent Contributor
  • **
  • Posts: 909
  • Country: us
  • Checkout my old test gear channel (link in sig)
    • TGSoapbox
Re: 3458a logging via Excel macro
« Reply #77 on: October 06, 2017, 02:31:06 pm »
However when I run V21 (V20) with get_pa_msw.exe installed at F:\ and the SHT10 communicating through COM3 at 115200 - I observe that the 3458A unit goes in Talk-mode (no beep) and the VB macro stops with VB error message: "compile error - "can't find project or library". The problem is related with a missing VISA COM 488.2 Formatted I/O 5.5 (library)

I 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
« Last Edit: October 06, 2017, 02:34:38 pm by Tony_G »
 

Online Tony_G

  • Frequent Contributor
  • **
  • Posts: 909
  • Country: us
  • Checkout my old test gear channel (link in sig)
    • TGSoapbox
Re: 3458a logging via Excel macro
« Reply #78 on: October 07, 2017, 04:06:37 pm »
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

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 1594
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: 3458a logging via Excel macro
« Reply #79 on: October 07, 2017, 04:51:56 pm »
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.

Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 1594
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: 3458a logging via Excel macro
« Reply #80 on: October 08, 2017, 03:43:34 pm »
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.
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 1594
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: 3458a logging via Excel macro
« Reply #81 on: October 08, 2017, 05:18:29 pm »
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.dll

Hmmmmm!

Ian.
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 1594
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: 3458a logging via Excel macro
« Reply #82 on: October 08, 2017, 09:50:19 pm »
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 None
Advanced: Use FIFO checked, both sliders at max, Com Port Number= COM11
Driver: 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.
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 1594
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: 3458a logging via Excel macro
« Reply #83 on: October 09, 2017, 05:49:32 pm »
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.
« Last Edit: October 09, 2017, 05:53:04 pm by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 1594
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: 3458a logging via Excel macro
« Reply #84 on: October 09, 2017, 08:51:44 pm »
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.
« Last Edit: October 09, 2017, 08:57:44 pm by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 1594
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: 3458a logging via Excel macro
« Reply #85 on: October 11, 2017, 07:02:27 pm »
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.


« Last Edit: October 11, 2017, 07:41:52 pm by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Offline dogratian

  • Newbie
  • Posts: 1
  • Country: kr
Re: 3458a logging via Excel macro
« Reply #86 on: October 12, 2017, 01:12:59 am »
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.
« Last Edit: October 17, 2017, 12:09:32 am by dogratian »
 
The following users thanked this post: IanJ, TiN


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf