Test and Measurement Forum

Two PT-104 USB on a same computer

Post your VB and VBA discussions here

Two PT-104 USB on a same computer

Postby eqiom » Thu Mar 03, 2016 6:02 pm

Hello

I'm running a computer with Windows Seven 64 bits and Excel 2016. I have 2 PT-104 USB :
On the CQ493/053 I have four temperature measurement device
On the CV669/077 I have two temperature measurement device

With Picolog, I'm able to see the six measurement device
Capture 3.JPG


If I'm trying the MS Excel VBA Example for USB PT-104 (64-bit) USBPT104_x64.xls, when I push the button Get Data:
It seems that the macro is finding only the CQ493/053 device, how I can modify the macro to have the two PT-104 ? and then to have the six channels ?

At first, No Data appear in the cells A2, B2, C2 & D2 and some data appear only in A3 & B3,
Capture 1.JPG


then nothing happen during 1 minutes (more or less) and suddenly all the data appear in the table ? Why the data are not appearing subsequently ?
Capture 2.JPG


This is the file I recorded with executing the macro
USBPT104_x64_EQIOM.xls
Example of USBPT104_x64 run on the computer with the two PT-104 USB
(57 KiB) Downloaded 67 times


Thanks a lot
eqiom
Newbie
 
Posts: 0
Joined: Wed Mar 02, 2016 1:39 pm

Re: Two PT-104 USB on a same computer

Postby Hitesh » Fri Mar 04, 2016 9:34 am

Hi eqiom,

The example is designed to collect data for one USB PT-104 device.

If you wish to collect data from two devices, you will need to modify the example accordingly.

Please note that when you call the UsbPt104OpenUnit() function it will return a unique handle value for the device that it opens a connection to. You do have the option to specify the serial number of the device that you wish to connect to.

Once the handle value has been obtained, you can then use this value to call the subsequent functions to setup the devices and collect data. Please also refer to the Programmer's Guide for further information on the functions available from the driver.

Could you please e-mail support@picotech.com and we can provide you with an updated dll to see if it resolves the issue with the delay.

Regards,
Hitesh

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

Re: Two PT-104 USB on a same computer

Postby eqiom » Fri Mar 04, 2016 4:24 pm

Hello,

I'm trying to use UsbPt104Enumerate to get the device information, so in the Function Declarations, I wrote:

Code: Select all
Declare PtrSafe Function UsbPt104Enumerate Lib "usbpt104.dll" (ByVal details As String, ByVal length As Integer, ByVal communicationType As Long) As Long


and in the Sub GetData () I had:

Code: Select all
status = UsbPt104Enumerate (details, length, CT_USB)
Cells (30, "I").value = str


and Excel is crashing, what is wrong ?
can you give me an example of using UsbPt104Enumerate ?

Thanks a lot
eqiom
Newbie
 
Posts: 0
Joined: Wed Mar 02, 2016 1:39 pm

Re: Two PT-104 USB on a same computer

Postby Hitesh » Mon Mar 07, 2016 4:15 pm

Hi eqiom,

The length parameter is defined as a uint32_t (unsigned integer) data type in the header file so you should use a 'Long' data type i.e.

Code: Select all
Declare PtrSafe Function UsbPt104Enumerate Lib "usbpt104.dll" (ByVal details As String, ByVal length As Long, ByVal communicationType As Long) As Long

The string details needs to be allocated some memory so try defining it as a String with blank spaces e.g.

Code: Select all
details = "          "
length = Len(details)

Your line

Code: Select all
Cells (30, "I").value = str

might need to be changed to:

Code: Select all
Cells (30, "I").value = details

Regards,
Hitesh

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

Re: Two PT-104 USB on a same computer

Postby eqiom » Tue Mar 08, 2016 6:45 am

Thank you a lot

Regards
eqiom
Newbie
 
Posts: 0
Joined: Wed Mar 02, 2016 1:39 pm


Return to VB and VBA (Excel, Access)

Who is online

Users browsing this forum: No registered users and 0 guests