Test and Measurement Forum

Problem with PT104 driver (PT10432.DLL)

Post general discussions on using our drivers to write your own software here

Problem with PT104 driver (PT10432.DLL)

Postby livevilfr » Tue Sep 22, 2009 2:46 pm

Hi,

I'm using (trying to use :roll:) the PT104 data logger to get temperatures from 3 PT100 probes. My program is in VB.NET and I'm using the provided dll.

When I use the pt104_open_unit function, I always get something returned, even when testing another com port. The driver information says that 'TRUE' is return when the driver successfully opens the PT-104. I'm using the following declaration :
Code: Select all
Declare Function pt104_open_unit Lib "pt10432.DLL" (ByVal Port As Integer) As Integer

(I get the same result when I try to return a Boolean).

I've got the same problem when I'm setting up the channels with pt104_set_channels : I always got 1 (or TRUE) returned.

I know that the PT-104 is working since I got a temperature reading, but I need to check whether the logger is connected, as well as the probes.
livevilfr
User
User
 
Posts: 2
Joined: Tue Sep 22, 2009 1:57 pm

Postby Robin » Tue Sep 22, 2009 3:21 pm

Hi

Do you have the same problem if you use our Excel example (PT10432.xls)?

It could be something to do with data types. The driver function returns a short (16 bits). It looks like you are specifying a 32-bit integer as the return type. Have you tried using a short?

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Postby Guest » Tue Sep 22, 2009 5:06 pm

Thank you for your answer. I didn't try with Excel, I'll try tomorrow to see what exactly is returned.

So you think I should try to modify the declaration as follows :

Code: Select all
Declare Function pt104_open_unit Lib "pt10432.DLL" (ByVal Port As Integer) As Ushort


Am I right ?
Guest
 

Postby Robin » Wed Sep 23, 2009 8:06 am

Try using a Short (rather then Ushort).

http://msdn.microsoft.com/en-us/library/7tb7bdw6(VS.71).aspx

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Postby livevilfr » Wed Sep 23, 2009 10:00 am

Thanks for the advice, it works when using Short (or Ushort).

But I still got 'TRUE' returned when I'm using pt104_set_channel, even when no probe is connected. It seems to me that it just indicates that PT104 is working correctly on this channel, not that a reading can be taken.

Is there a way to check if a probe is connected instead of 1) setting the channel, 2) taking a reading and 3) evaluating the value returned ?

Is there a way to "unset" a channel once opened ?

Thanks in advance,
livevilfr
User
User
 
Posts: 2
Joined: Tue Sep 22, 2009 1:57 pm

Postby Robin » Wed Sep 23, 2009 10:53 am

Hi

The return value indicates that the PT104 is connected to the PC. It is not possible to check directly whether a probe is connected using the API.

Calling pt104_set_channel and setting data_type to 0 will disable a channel.

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests