msaccess import

Post general discussions on using our drivers to write your own software here
Post Reply
Posts: 1
Joined: Fri Oct 13, 2006 12:07 pm
Location: Zurich

msaccess import

Post by hanss » Fri Oct 13, 2006 1:06 pm

I just purchased the TC08 and am trying to import temperature values into msaccess using vb. I have made a little progress, but am still having problems. I would appreciate any help! I am enclosing the zipped access file: thermal2.mdb with the examples.

Zürich, Switzerland

Here is what I have (see enclosed thermal2.mdb):

Access Form name: form1

form1 has 3 text boxes (t1, t2, and t3) as well as the folllowing buttons and desired functions when clicked:

open (open TC-08)
get (import temperature values from channels 1,2 and 3 into text boxes t1, t2, and t3)
close (close TC-08)

This is vb that I have so far:

*******open button (this works!):

Private Sub open_Click()
Call usb_tc08_open_unit
End Sub

******* get button (only puts zeros into the text boxes):

Private Sub get_Click()
Dim ok As Integer
Dim tc08_handle As Integer
Dim temp_buffer(9) As Single
Dim overflow_flag As Integer

Call usb_tc08_set_mains(tc08_handle, True)
ok = usb_tc08_set_channel(tc08_handle, 0, Asc("K"))
ok = usb_tc08_set_channel(tc08_handle, 1, Asc("K"))
ok = usb_tc08_set_channel(tc08_handle, 2, Asc("K"))

Call usb_tc08_get_single(tc08_handle, temp_buffer(0), overflow_flag, 0)

t1.Value = temp_buffer(0)
t2.Value = temp_buffer(1)
t3.Value = temp_buffer(2)

End Sub

********close (nothing happens):

Private Sub close_Click()

Call usb_tc08_close_unit(-1)

End Sub
(11.39 KiB) Downloaded 429 times

Advanced User
Advanced User
Posts: 656
Joined: Thu Jul 07, 2005 12:41 pm
Location: St Neots, Cambridgeshire

Post by Michael » Thu Nov 16, 2006 12:05 pm


How are you getting on with this?

Please let me know.

Michael - Tech Support
Pico Technology
Web Support Forum

Post Reply