none
Issue with XP compatibility code for vellermen K8055 development board when running on Microsoft 8.1 64-bit RRS feed

  • Question

  • Hi guys and thanks for taking time to view my question/problem:-

    I have just bought a new PC that came with Microsoft 8.1 [64-bit].  Due to OS we have at work, all my development and coding has been done on XP professional SP3.  I currently have a system that tracks product along a production line, trending results in a graph using excel 2010.  I use the vellermen 8055 development board to gather my data but when I have tried to run the existing code for communicating to the 8055 i have had numerous coding issues due to the 64-bit environment.  Having altered my code as per forum help I still have an issue when trying to connect to the board [address set to 00]. Already I have added the PtrSafe command to function code in the API section, which now seems to run fine, i have an issue when trying the connection code. All i keep getting is 'file does not exist'.  I have placed the relevant k8055d.dll file in both WINDOWS/SYSTEM32 and WINDOWS/ SysWOW64, the compiler still says the file doesn't exist.  I have tried all sorts of code to rectify but can't get the board to open.  I thought maybe it was a driver issue but can connect easily using one of the demo programs that vellermen provide [source code is not accessible as the project has been packaged].  I would appreciate any feedback and fixes from you guys.  If it is a quick fix then I apologise for my ignorance, but any feedback would be appreciated.  I have supplied my code for your convenience.  Kind regards in advance:-

    Option Explicit
    Private Declare PtrSafe Function Version Lib "K8055d.dll" () As Long
    Private Declare PtrSafe Function SearchDevices Lib "K8055d.dll" () As Long
    Private Declare PtrSafe Function SetCurrentDevice Lib "K8055d.dll" (ByVal CardAddress As Long) As Long
    Private Declare PtrSafe Function OpenDevice Lib "K8055d.dll" (ByVal CardAddress As Long) As Long
    Private Declare PtrSafe Sub CloseDevice Lib "K8055d.dll" ()
    Private Declare PtrSafe Function ReadAnalogChannel Lib "K8055d.dll" (ByVal Channel As Long) As Long
    Private Declare PtrSafe Sub ReadAllAnalog Lib "K8055d.dll" (Data1 As Long, Data2 As Long)
    Private Declare PtrSafe Sub OutputAnalogChannel Lib "K8055d.dll" (ByVal Channel As Long, ByVal Data As Long)
    Private Declare PtrSafe Sub OutputAllAnalog Lib "K8055d.dll" (ByVal Data1 As Long, ByVal Data2 As Long)
    Private Declare PtrSafe Sub ClearAnalogChannel Lib "K8055d.dll" (ByVal Channel As Long)
    Private Declare PtrSafe Sub SetAllAnalog Lib "K8055d.dll" ()
    Private Declare PtrSafe Sub ClearAllAnalog Lib "K8055d.dll" ()
    Private Declare PtrSafe Sub SetAnalogChannel Lib "K8055d.dll" (ByVal Channel As Long)
    Private Declare PtrSafe Sub WriteAllDigital Lib "K8055d.dll" (ByVal Data As Long)
    Private Declare PtrSafe Sub ClearDigitalChannel Lib "K8055d.dll" (ByVal Channel As Long)
    Private Declare PtrSafe Sub ClearAllDigital Lib "K8055d.dll" ()
    Private Declare PtrSafe Sub SetDigitalChannel Lib "K8055d.dll" (ByVal Channel As Long)
    Private Declare PtrSafe Sub SetAllDigital Lib "K8055d.dll" ()
    Private Declare PtrSafe Function ReadDigitalChannel Lib "K8055d.dll" (ByVal Channel As Long) As Boolean
    Private Declare PtrSafe Function ReadAllDigital Lib "K8055d.dll" () As Long
    Private Declare PtrSafe Function ReadCounter Lib "K8055d.dll" (ByVal CounterNr As Long) As Long
    Private Declare PtrSafe Sub ResetCounter Lib "K8055d.dll" (ByVal CounterNr As Long)
    Private Declare PtrSafe Sub SetCounterDebounceTime Lib "K8055d.dll" (ByVal CounterNr As Long, ByVal DebounceTime As Long)
    Private Declare PtrSafe Function SetTimer Lib "user32" ( _
        ByVal HWnd As Long, ByVal nIDEvent As Long, _
        ByVal uElapse As Long, ByVal lpTimerFunc As LongPtr) As Long
    Private Declare PtrSafe Function KillTimer Lib "user32" ( _
        ByVal HWnd As Long, ByVal nIDEvent As Long) As Long
    Dim TimerID As Long
    Dim TimerSeconds As Single
    Dim CardAddress As Long
    Dim n As Long

    Sub Button1_Click()
        Dim h As Long
        n = 0
        h = OpenDevice(0)
        If h = 0 Then
            ActiveSheet.Cells(1, 4) = "Card 0 Connected"
            TimerSeconds = 1 ' the timer interval is now 1 sec.
            TimerID = SetTimer(0&, 0&, TimerSeconds * 1000&, AddressOf TimerProc)
        Else
            ActiveSheet.Cells(1, 4) = "Card 0 Not Found"
        End If

    End Sub

    Sunday, October 26, 2014 2:42 PM

Answers

  • Hello cobolt100,

    This forum is for questions about Excel Development, does your question have anything to do with Excel Development? If it doesn't, you could post in VBA forum where you can get more helpful answers.

    Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, October 27, 2014 8:25 AM
    Moderator