K8090 use multiple boards with DLL

I have build two K8090 cards and they work fine connected to 1 PC with the test program. However I need to deselect a card to use the other.
I would like to write a program that allows me to work with the 2 cards.
The DLL does not seems to allow 2 cards to be in connect mode at the same time and to sent commands to each card based on an address.
Can you please comment on this statement and tell me if there is any possibility to run the 2 cards in parallel?
Regards

There should be no problem, each card has its own COM port to which you can connect. You should be able to use dozens of cards simultaneously.

For the DLL: OpenDevice returns a unique handle to each device that was opened, for example:

HANDLE hFirst = OpenDevice("COM1");
HANDLE hSecond= OpenDevice("COM2");

// Then pass the handle of the K8090 that you want to control
SendCommand(hFirst , ?, ?, ?, ?);
SendCommand(hSecond, ?, ?, ?, ?);
SendCommand(hSecond, ?, ?, ?, ?);
...

CloseDevice(hFirst);
CloseDevice(hSecond);

And in .NET you can just add two (or more) K8090Board components to your project

hello
ok but with iphone it’s possible to do a server for multicard
because i use 3 card with 3 differente computeur with 3 differente ip “with mobile k8090 app”

with “k8090 remote app” it’s possible to install infinit server with differente com port card on the same computeur but in the iphone k8090 remote app it’s not possible to rename the label off relay card “just marked relais 1 ,relais2,relais3…”

it’s possible to modifi the relais name in the app???

and possibility to use iphone and pc on the same time for control the k8090 card?

if you do a update with this it’s verry good…!..
do a free lite version and a extended pay version with more fonctionality it’s verry good project for home automation!..

thanks

You are correct, the iPhone app/server can’t handle more than one card

Thank you.
Do you have the same example in basic?
If not, I will try to translate what you wrote to visual basic express 2010 as I don’t know the langage you use for this example. I am not very familiar with using components.

The K8090 demo software includes two examples in VB.NET 2008 (which also work for 2010)

Indeed. I looked at those examples.
What I don’t understand is how you replace the HANDLE in VBasic. More specifically how do you declare the HANDLE: Dim HANDLE as ???


Your example:
Code:
HANDLE hFirst = OpenDevice(“COM1”);
HANDLE hSecond= OpenDevice(“COM2”);

// Then pass the handle of the K8090 that you want to control
SendCommand(hFirst , ?, ?, ?, ?);
SendCommand(hSecond, ?, ?, ?, ?);
SendCommand(hSecond, ?, ?, ?, ?);

CloseDevice(hFirst);
CloseDevice(hSecond);

HANDLE hFirst = OpenDevice("COM1");
HANDLE hSecond= OpenDevice("COM2");

// Then pass the handle of the K8090 that you want to control
SendCommand(hFirst , ?, ?, ?, ?);
SendCommand(hSecond, ?, ?, ?, ?);
SendCommand(hSecond, ?, ?, ?, ?);
...

CloseDevice(hFirst);
CloseDevice(hSecond);

This is C code that demonstrates using two K8090 cards because your original question does not mention .NET. In .NET, try to understand and use the code from the examples. You might need to learn the basics of .NET first (eg. how to use components and controls).

Each example contains a K8090 component that handles the low level stuff, to make programming as simple as possible.