K8055 coding in VB2008 express

Hi
I dont know much about coding (had a K8000 board, and made a couple of small .exe´s to it). Now I have changed it to K8055, and the supplied software, and sourcecode works fine. What I need is a .exe, that opens the card, sets all the digital outputs to 1, and then disconnects. And a .exe, that does the opposite.
I call these exes from another program, and I need this process to be automatic!
Have tried to modify supplied source, but with no luck. Can anybody help, please?

If problems to create external exe’s - one alternative may be to put the K8055 control functions inside your VB2008 code…
You may download one example project from: vel255.diinoweb.com/files/K8055_VB_2005_rnd.zip

This project is for VB2005 but your VB2008 automatically converts it.

Hi
Thanks for the fast reply.
I have tried to download the suggested files, but exept from switching off at once, I dont see any diffrence from ste original code.
I have tried to modify the code:

[/code]
Public Class Form1
Inherits System.Windows.Forms.Form

Private Declare Function OpenDevice Lib "k8055d.dll" (ByVal CardAddress As Integer) As Integer
Private Declare Sub CloseDevice Lib "k8055d.dll" ()
Private Declare Sub Version Lib "k8055d.dll" ()
Private Declare Function SearchDevices Lib "k8055d.dll" () As Integer
Private Declare Function SetCurrentDevice Lib "k8055d.dll" (ByVal CardAddress As Integer) As Integer
Private Declare Function ReadAnalogChannel Lib "k8055d.dll" (ByVal Channel As Integer) As Integer
Private Declare Sub ReadAllAnalog Lib "k8055d.dll" (ByRef Data1 As Integer, ByRef Data2 As Integer)
Private Declare Sub OutputAnalogChannel Lib "k8055d.dll" (ByVal Channel As Integer, ByVal Data As Integer)
Private Declare Sub OutputAllAnalog Lib "k8055d.dll" (ByVal Data1 As Integer, ByVal Data2 As Integer)
Private Declare Sub ClearAnalogChannel Lib "k8055d.dll" (ByVal Channel As Integer)
Private Declare Sub SetAllAnalog Lib "k8055d.dll" ()
Private Declare Sub ClearAllAnalog Lib "k8055d.dll" ()
Private Declare Sub SetAnalogChannel Lib "k8055d.dll" (ByVal Channel As Integer)
Private Declare Sub WriteAllDigital Lib "k8055d.dll" (ByVal Data As Integer)
Private Declare Sub ClearDigitalChannel Lib "k8055d.dll" (ByVal Channel As Integer)
Private Declare Sub ClearAllDigital Lib "k8055d.dll" ()
Private Declare Sub SetDigitalChannel Lib "k8055d.dll" (ByVal Channel As Integer)
Private Declare Sub SetAllDigital Lib "k8055d.dll" ()
Private Declare Function ReadDigitalChannel Lib "k8055d.dll" (ByVal Channel As Integer) As Boolean
Private Declare Function ReadAllDigital Lib "k8055d.dll" () As Integer
Private Declare Function ReadCounter Lib "k8055d.dll" (ByVal CounterNr As Integer) As Integer
Private Declare Sub ResetCounter Lib "k8055d.dll" (ByVal CounterNr As Integer)
Private Declare Sub SetCounterDebounceTime Lib "k8055d.dll" (ByVal CounterNr As Integer, ByVal DebounceTime As Integer)






Private Sub Connect_to_Card()

    OpenDevice(0)

End Sub






Private Sub Set_All_Digital()

    SetAllDigital()

End Sub




Private Sub Form1_Closed()

    CloseDevice()

End Sub

End Class

Now, this doesn´t work. What I want, is the digital outputs to be set, at once, the program i launched, and stay on, until another program (to switch them off(ClearAllDigital)) is launched.
I use PCStage (home.clara.net/lowernab/index.html), to fire the .exe´s. This program can also fire VBS, so maby there is a way to adress the K8055 this way?

Rgds.

In your modified code you have to put timer or some other means to call the functions

OpenDevice(0)
SetAllDigital()
CloseDevice()

YES YES YES

Now it works :smiley: :smiley:

Thanks a lot !!!

And one small request:

Is there a code, that will colse the window, when it has done its job?

You may try

Me.Close()