Velleman K8055 with new PC - win10

Hello,

an former colleague installed a Velleman K8055 to count a signal and displayed it in excel.

It works well with win xp and excel 2000 and a macro in a list.

Now we use a new PC with win 10 and new office.

I am downloaded a new K8055.dll and copy it in windows system32.

The K8055 demo works well and I can see the counter and reset it too.

But the macro in the excel list doesn’t work.

Is there an other Visual Basic version?

How can I translate the macro?

Or is there an other mistake?

Sorry for my English :slight_smile:

I am adding the maco code, so I hope someone can find a error…

Option Explicit
Private Declare Function Version Lib “k8055d.dll” () As Long
Private Declare Function SearchDevices Lib “k8055.d.dll” () As Long
Private Declare Function SetCurrentDevice Lib “k8055d.dll” (ByVal CardAddress As Long) As Long
Private Declare Function OpenDevice Lib “k8055d.dll” (ByVal CardAddress As Long) As Long
Private Declare Sub CloseDevice Lib “k8055d.dll” ()
Private Declare Function ReadAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long) As Long
Private Declare Sub ReadAllAnalog Lib “k8055d.dll” (Data1 As Long, Data2 As Long)
Private Declare Sub OutputAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long, ByVal Data As Long)
Private Declare Sub OutputAllAnalog Lib “k8055d.dll” (ByVal Data1 As Long, ByVal Data2 As Long)
Private Declare Sub ClearAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub SetAllAnalog Lib “k8055d.dll” ()
Private Declare Sub ClearAllAnalog Lib “k8055d.dll” ()
Private Declare Sub SetAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub WriteAllDigital Lib “k8055d.dll” (ByVal Data As Long)
Private Declare Sub ClearDigitalChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub ClearAllDigital Lib “k8055d.dll” ()
Private Declare Sub SetDigitalChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub SetAllDigital Lib “k8055d.dll” ()
Private Declare Function ReadDigitalChannel Lib “k8055d.dll” (ByVal Channel As Long) As Boolean
Private Declare Function ReadAllDigital Lib “k8055d.dll” () As Long
Private Declare Function ReadCounter Lib “k8055d.dll” (ByVal CounterNr As Long) As Long
Private Declare Sub ResetCounter Lib “k8055d.dll” (ByVal CounterNr As Long)
Private Declare Sub SetCounterDebounceTime Lib “k8055d.dll” (ByVal CounterNr As Long, ByVal DebounceTime As Long)
Dim i As Long
Dim j As Long
Dim k As Long
Dim h As Long
Dim s As Long

Private Sub CommandButton1_Click() ’ herstellen der Verbindung und Zählerstand holen
OpenDevice (0) 'verbinden mit Gerät 0 (Jumper SK5,SK6 - 0,1,2,3)
h = OpenDevice(0)
If h = 0 Then
i = ReadCounter(1)
j = ReadCounter(2)
k = i + j
s = k * 2
ActiveSheet.Cells(6, 17) = " "
ActiveSheet.Cells(9, 17) = "MP1- " & i
ActiveSheet.Cells(10, 17) = "MP2- " & j
ActiveSheet.Cells(12, 17) = “Doppelbeutel”
ActiveSheet.Cells(13, 17) = "Summe- " & k
ActiveSheet.Cells(15, 17) = “Einzelbeutel”
ActiveSheet.Cells(16, 17) = "Summe- " & s
ClearAllDigital
CloseDevice
Else
ActiveSheet.Cells(6, 17) = “Zähler nicht gefunden”
End If
End Sub

Private Sub CommandButton3_Click()
OpenDevice (0)
ResetCounter (1)
ResetCounter (2)
h = OpenDevice(0)
If h = 0 Then
i = 0
j = 0
k = 0
s = 0
ActiveSheet.Cells(6, 17) = " "
ActiveSheet.Cells(9, 17) = "MP1- " & i
ActiveSheet.Cells(10, 17) = "MP2- " & j
ActiveSheet.Cells(12, 17) = “Doppelbeutel”
ActiveSheet.Cells(13, 17) = "Summe- " & k
ActiveSheet.Cells(15, 17) = “Einzelbeutel”
ActiveSheet.Cells(16, 17) = "Summe- " & s
ClearAllDigital
CloseDevice
Else
ActiveSheet.Cells(6, 17) = “Zähler nicht gefunden”
End If
End Sub

If you have 64-bit version of Windows, copy the DLL to \Windows\SysWOW64.

Thank you for your quick response.

It works well.

The Problem was, that there was a K8055.dll in the windows\syswow64.

But it was an old version of it und don’t work with excel.

Now I am copy the new version of the K8055.dll and it seems to work.

I don’t understand, that the K8055 demo windows works and excel not…

Thank you very much :slight_smile:

No problem. Glad to see it’s working again.