I tried the .net webservice approach, the code is running without errors but I'm getting 0 as the postback temperature. It's seems that the call th03_get_temp(temperature, Port, 1, False) allways returns 0.
Here's the code i'm using, hoping for some insight:
Declare Function th03_open_unit Lib "C:\PICO\DRIVERS\win32\th0332.DLL" (ByVal Port As Integer) As Boolean
Declare Sub th03_close_unit Lib "C:\PICO\DRIVERS\win32\th0332.DLL" (ByVal Port As Integer)
Declare Sub th03_set_channel Lib "C:\PICO\DRIVERS\win32\th0332.DLL" (ByVal Port As Integer, ByVal channel As Integer, ByVal THtype As Integer, ByVal Factor As Integer)
Declare Sub th03_poll_driver Lib "C:\PICO\DRIVERS\win32\th0332.DLL" ()
Declare Function th03_get_temp Lib "C:\PICO\DRIVERS\win32\th0332.DLL" (value As Long, ByVal Port As Integer, ByVal channel As Integer, ByVal filtered As Boolean) As Boolean
Declare Function th03_set_ref_update Lib "C:\PICO\DRIVERS\win32\th0332.DLL" (ByVal Port As Integer, ByVal Rate As Integer) As Boolean
Declare Function th03_get_version Lib "C:\PICO\DRIVERS\win32\th0332.DLL" (value As Integer, ByVal Port As Integer) As Boolean
Declare Function th03_get_cycle Lib "C:\PICO\DRIVERS\win32\th0332.DLL" (cycle As Long, ByVal Port As Integer) As Boolean
Declare Function GetTickCount Lib "kernel32" () As Long
Dim Port As Integer
Dim version As Integer
Dim temperature As Long
Dim ok As Boolean
dim i as Long
dim ticks As Long
Public Function GoGetTemperature() As Long
Port = 1
Call th03_open_unit(Port)
Call th03_set_channel(Port, 1, 1, 10)
for i=1 to 20
ticks = GetTickCount()
do while (GetTickCount() < ticks + 1000)
th03_poll_driver
loop
call th03_get_temp(temperature, Port, 1, False)
next
return(temperature)
The get_temp function returns 1 when there is a temperature reading and 0 when there is no reading.
Check that the port is being opened and the value is one when you use the function open_unit.
I would suggest that you test the unit on the port that you are using to see if you are getting values back. Take a look at our examples especially the VB and the C code. There is no need to poll the driver.