K8055 & visual basic 2005

I can’t find a demo for visual basic 2005
Can someone send me a link please

Luc

Sorry, all demo’s are written for VB6. We have no experience with VB 2005 but we are sure that the differences will be minor.

I assume you mean Visual Basic .NET for Visual Studio 2005?

Try searching google for “calling unmanaged code from .NET”. This should get you started on how to declare and use the functions provided in the K8055 dll.

Calling regular dll’s from .NET is very slow though since each call has to go through a process called marshaling.

Sorry, no it’s visual basic 2005 express edition for visual studio 8 :slight_smile:

Let me clarify a few things, i know microsoft has made it a bit confusing:

Programming languages:

  • Visual Basic .NET = VB7
  • Visual Basic .NET 2003 = VB.NET for version 1.1 of the .NET Framework
  • Visual Basic (.NET) 2005 = VB.NET for version 2.0 of the .NET Framework
  • Visual Basic 6.0 (abandoned)

Compilers/IDE’s:

  • Visual Studio 2005 (= Visual Studio 8)
  • Visual Studio 2003 (= Visual Studio 7.1)
  • Visual Studio 2002 (= Visual Studio 7.0)

Visual Studio variations:

  • Visual Basic 2005 Express Edition - Free limited version of Visual Studio 2005 for Visual Basic (.NET) 2005

Thus you are probably programming in Visual Basic .NET (2.0) inside a free limited version of Visual Studio 2005 and it should not have any limitations in the use of the language, only in the supported features (intellisense, etc).

Ok, thanks.

My advice to you is to give Delphi a try, it’s a great language for the sort of projects you’re working on. Imho far better than VB 6.0 and especially .NET which is aimed towards database development.

Give it a try :slight_smile: You’ll love it

Well 448, look my signature and please look at the included url (made with VC++2005)
Just click those buttons :slight_smile:
I prefer to keep this language for programming

although I’m a little late to the show, I’ve decided to use the 8055 with vb 2005 because 2005 is free and somewhat contemporary not to mention the easy tie in with sql 2005

I’ve managed to get the board to respond using this code
Note that I can’t get the Check1(x) statement to do anything for me. Thats too bad, as it would be nice to know which boards are connected…

Ah well, it beats trying to import the code from VB6 to 2005 which gave me no end of headaches, and error messages I didn’t understand.

'CODE

Option Strict Off
Option Explicit On
Friend Class Form1
Inherits System.Windows.Forms.Form
Dim DoNothing As Boolean
Dim n As Short
Private Declare Sub Version Lib “c:\8055\k8055d.dll” ()
Private Declare Function SearchDevices Lib “c:\8055\k8055d.dll” () As Integer
Private Declare Function SetCurrentDevice Lib “c:\8055\k8055d.dll” (ByVal CardAddress As Integer) As Integer
Private Declare Function OpenDevice Lib “c:\8055\k8055d.dll” (ByVal CardAddress As Integer) As Integer
Private Declare Sub CloseDevice Lib “c:\8055\k8055d.dll” ()
Private Declare Function ReadAnalogChannel Lib “c:\8055\k8055d.dll” (ByVal Channel As Integer) As Integer
Private Declare Sub ReadAllAnalog Lib “c:\8055\k8055d.dll” (ByRef Data1 As Integer, ByRef Data2 As Integer)
Private Declare Sub OutputAnalogChannel Lib “c:\8055\k8055d.dll” (ByVal Channel As Integer, ByVal Data As Integer)
Private Declare Sub OutputAllAnalog Lib “c:\8055\k8055d.dll” (ByVal Data1 As Integer, ByVal Data2 As Integer)
Private Declare Sub ClearAnalogChannel Lib “c:\8055\k8055d.dll” (ByVal Channel As Integer)
Private Declare Sub SetAllAnalog Lib “c:\8055\k8055d.dll” ()
Private Declare Sub ClearAllAnalog Lib “c:\8055\k8055d.dll” ()
Private Declare Sub SetAnalogChannel Lib “c:\8055\k8055d.dll” (ByVal Channel As Integer)
Private Declare Sub WriteAllDigital Lib “c:\8055\k8055d.dll” (ByVal Data As Integer)
Private Declare Sub ClearDigitalChannel Lib “c:\8055\k8055d.dll” (ByVal Channel As Integer)
Private Declare Sub ClearAllDigital Lib “c:\8055\k8055d.dll” ()
Private Declare Sub SetDigitalChannel Lib “c:\8055\k8055d.dll” (ByVal Channel As Integer)
Private Declare Sub SetAllDigital Lib “c:\8055\k8055d.dll” ()
Private Declare Function ReadDigitalChannel Lib “c:\8055\k8055d.dll” (ByVal Channel As Integer) As Boolean
Private Declare Function ReadAllDigital Lib “c:\8055\k8055d.dll” () As Integer
Private Declare Function ReadCounter Lib “c:\8055\k8055d.dll” (ByVal CounterNr As Integer) As Integer
Private Declare Sub ResetCounter Lib “c:\8055\k8055d.dll” (ByVal CounterNr As Integer)
Private Declare Sub SetCounterDebounceTime Lib “c:\8055\k8055d.dll” (ByVal CounterNr As Integer, ByVal DebounceTime As Integer)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

Private Sub Connect_Click()

    Dim CardAddress As Long
    Dim h As Long
    


    CardAddress = 0
    'CardAddress = 3 - (Check1(0).Value + Check1(1).Value * 2)
    h = OpenDevice(CardAddress)
    Select Case h

        Case 0, 1, 2, 3
            Label1.Text = "Card " + Str(h) + " connected"
        Case -1
            Label1.Text = "Card " + Str(CardAddress) + " not found"
    End Select

End Sub


Private Sub Form_Terminate()
    CloseDevice()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Connect.Click
    Connect_Click()
End Sub

End Class

'CODE

Cheers, Mike