Using Multiple K8055 Cards with VB6

After getting a reply by email from Velleman about using up to 4 K8055 cards
in a single application, I was referred to a download page and this forum. I
did find examples of the newer DLL that supports multiple cards however the
only code examples I found were for Delphi or C (I forget which). The visual
basic example codes I found did NOT contain the 2 new functions. After
studing the sub/function declarations I came up with this for visual basic:

Public Declare Function SearchDevices Lib "k8055d.dll" () As Long
Public Declare Function SetCurrentDevice Lib "k8055d.dll" (ByVal CardAddress As Long) As Long

With only one card to test with for the moment, I was able to get the proper
responce from SearchDevices for the card address I’d chosen. My question is,
did I get the second function properly defined for vb?

A second (probably a dumb one) question is, can I have all four cards opened
at the same time and address only the one pointed to using the SetCurrentDevice
function? Or do I need to open each card, do my i/o work, then close the card
before moving on to the next card?

My final question is, does the new functions work with my origional K8055 card?
The SearchDevices appears to work fine. This question is not as important since
I will have to order several new cards for my next project anyways.

[quote]With only one card to test with for the moment, I was able to get the proper
responce from SearchDevices for the card address I’d chosen. My question is,
did I get the second function properly defined for vb?[/quote]Yes, both of the declarations are correct for VB6. (If you in the future move to VB 2008 Express, then you have to do a lot of changes… E.g. all “As Long” have to be changed to “As Integer” etc.)

[quote]A second (probably a dumb one) question is, can I have all four cards opened
at the same time and address only the one pointed to using the SetCurrentDevice
function? Or do I need to open each card, do my i/o work, then close the card
before moving on to the next card?[/quote]You can (have to) use the SetCurrentDevice function to address the cards. All the cards will be opened all the time.

[quote]My final question is, does the new functions work with my origional K8055 card?[/quote]Yes, they work.

Thanks for your time and information. It was exactly what I was hoping for. :smiley: