DrDAQ resistance to 2decimals in excel example

Post your VB and VBA discussions here
Post Reply
chrissalon
Newbie
Posts: 0
Joined: Sun Nov 15, 2015 1:49 pm

DrDAQ resistance to 2decimals in excel example

Post by chrissalon »

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.

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

Re: DrDAQ resistance to 2decimals in excel example

Post by Glovisol »

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

chrissalon
Newbie
Posts: 0
Joined: Sun Nov 15, 2015 1:49 pm

Re: DrDAQ resistance to 2decimals in excel example

Post by chrissalon »

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?

Hitesh

Re: DrDAQ resistance to 2decimals in excel example

Post by Hitesh »

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,

chrissalon
Newbie
Posts: 0
Joined: Sun Nov 15, 2015 1:49 pm

Re: DrDAQ resistance to 2decimals in excel example

Post by chrissalon »

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,

Post Reply