Test and Measurement Forum

DrDAQ resistance to 2decimals in excel example

Post your VB and VBA discussions here

DrDAQ resistance to 2decimals in excel example

Postby chrissalon » Wed Dec 23, 2015 12:54 pm

How can one get the reading of the resistance to 2 decimals.
I get rounding off. A value of 2.538 in Picolog give 2.00 in the excel example that comes with SDK.
Is it driver related or the way it is declared? When I covert the VBA to Xojo I also get 2.00.
In one of the forum post one explains the resistance problem but I assumed it is fixed as Picolog gives the right value.
chrissalon
Newbie
 
Posts: 0
Joined: Sun Nov 15, 2015 1:49 pm

Re: DrDAQ resistance to 2decimals in excel example

Postby Glovisol » Tue Dec 29, 2015 7:40 pm

chrissalon wrote:How can one get the reading of the resistance to 2 decimals.
I get rounding off. A value of 2.538 in Picolog give 2.00 in the excel example that comes with SDK.
Is it driver related or the way it is declared? When I covert the VBA to Xojo I also get 2.00.
In one of the forum post one explains the resistance problem but I assumed it is fixed as Picolog gives the right value.


Dear Chrissalon. please go here

topic15421.html

and to related posts before and after and you will find several ways to read resistance with two or more decimals.

glovisol
Glovisol
Advanced User
Advanced User
 
Posts: 114
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

Re: DrDAQ resistance to 2decimals in excel example

Postby chrissalon » Sun Jan 03, 2016 12:13 pm

Thanks for your response Glovisol.
I looked at the posts but they don't answer my query. Maybe I did not phrase it right.
I want to read the resistance using VBA in excel.
Call UsbDrDaqGetSingle(handle, 6, value, overflow)
This returns in 1K readings not 1.250K or 1250 ohms.
I am using the current driver from the PicoSKD.
Am I using the right Call function?
chrissalon
Newbie
 
Posts: 0
Joined: Sun Nov 15, 2015 1:49 pm

Re: DrDAQ resistance to 2decimals in excel example

Postby Hitesh » Mon Jan 04, 2016 10:47 am

Hi chrissalon,

Please use the UsbDrDAQGetSingleF function as defined in the usbDrDaqApi.h header file in the SDK:

Code: Select all
PREF0 PREF1 PICO_STATUS PREF2 PREF3 (UsbDrDaqGetValuesF)
   (
      int16_t handle,
      float    *values,
      uint32_t *noOfValues,
      uint16_t *overflow,
      uint32_t *triggerIndex
   );

You will need to add this function definition to your VBA code. The parameters are the same as the UsbDrDaqGetValues function but the values are returned as floating point numbers.

Edit: The dll should be available through SDK version 10.6.10 or later.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2000
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: DrDAQ resistance to 2decimals in excel example

Postby chrissalon » Mon Jan 04, 2016 12:21 pm

Thanks for your support Hitesh,
Function works well in VBA and in fact works well using Xojo Programming.
(see my previous post (DrDaq Access using VB).
Much appreciate your feedback.
Regards,
chrissalon
Newbie
 
Posts: 0
Joined: Sun Nov 15, 2015 1:49 pm


Return to VB and VBA (Excel, Access)

Who is online

Users browsing this forum: No registered users and 1 guest