Problem with PT104 driver (PT10432.DLL)

Post general discussions on using our drivers to write your own software here
Post Reply
livevilfr
User
User
Posts: 2
Joined: Tue Sep 22, 2009 1:57 pm

Problem with PT104 driver (PT10432.DLL)

Post by livevilfr »

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.

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

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

Guest

Post by Guest »

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 ?

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

Try using a Short (rather then Ushort).

http://msdn.microsoft.com/en-us/library ... S.71).aspx

Robin

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

Post by livevilfr »

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,

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

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

Post Reply