TC-08, old dll

Post any questions you may have about our current range of USB data loggers
Post Reply
mijq
Newbie
Posts: 0
Joined: Wed Nov 03, 2010 12:03 pm

TC-08, old dll

Post by mijq »

Hi

I'm completely new to TC-08 and trying to set up a vb.net (visual studio 2010) program to log temperatures.

The vb program that I found via your software page is vb6 and cannot be opened using my version of vb.net.
Also the usbtc08.dll seems old.

I have tried to use the stuff anyway and have managed to open the tc-08 and get the info, but when I try the
usb_tc08_get_single call I get an arithmetric overflow error. The value in temp_buffer(0) is above 1e25.

Is part of the truble that am using a 64 bit windows 7?

Can you suggest a solution?

/mikkel

mijq
Newbie
Posts: 0
Joined: Wed Nov 03, 2010 12:03 pm

Re: TC-08, old dll

Post by mijq »

OK, I got a little further so now the temp_channel array recievess meaningful values, but the arithmetic (divide by zero) error subsists. It can be overruled by enclosing the usb_tc08_get_single call in a try block.

Not pretty, but usable.

Next problem arose when I tried to create a wrapper dll class for the usbtc08.dll. This gave a 'System.DllNotFoundException'.

I guess that be because the usbtc08.dll is not registered in the win7 system?

I tried using regsvr32, but that failed because the dll has no DllRegisterServer entry point was found.

?????

/Mikkel

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: TC-08, old dll

Post by Martyn »

You may wish to contact our technical support team directly at support@picotech.com and they will be able to help you with your questions.

Kind regards
Martyn
Technical Support Manager

sparky3600
Newbie
Posts: 0
Joined: Sun Sep 25, 2011 12:37 am

Re: TC-08, old dll

Post by sparky3600 »

Hi I am having a bit of a problem with the usb_tc08_get_unit_info function.

The function compiles and runs ok but the structure is not populated.

below is the code I have used to try and return the unit info.

Code: Select all


Imports System.Runtime.InteropServices

Public Class Form1
    Declare Function usb_tc08_open_unit Lib "usbtc08.dll" () As Short
    Declare Function usb_tc08_get_unit_info Lib "usbtc08.dll" (ByVal handle As Short, ByRef info As tUSBTC08Info) As Short

    Structure tUSBTC08Info
        Public size As Short
        Public DriverVersion As Short
        Public PicoppVersion As Short
        Public HardwareVersion As Short
        Public picovar As Short
        Public szSerial As String
        Public szCalDate As String
    End Structure

    Public info As tUSBTC08Info

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim handle As Short = usb_tc08_open_unit()
        MessageBox.Show(handle)
        'info.size = Marshal.SizeOf(info)
        Dim infook As Short = usb_tc08_get_unit_info(handle, info)
        MessageBox.Show(infook)

    End Sub
End Class
Can someone please share a small example of how to get this to work or point out in my code where I am going wrong, I am very new to dealing with dll functions so dont really know what I am doing.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: TC-08, old dll

Post by Martyn »

Make sure you preload the info structure with dummy values before passing to the driver.
Martyn
Technical Support Manager

Post Reply