Page 1 of 1

Phidgets Convination

Posted: Sun Apr 24, 2011 12:26 pm
by black_unicorn
Hello everyone.

Assuming that connect to a 1019 - PhidgetInterfaceKit 8/8/8 w / 6 Port Hub, more than 1014 - PhidgetInterfaceKit 0/0/4.

How I can manage and differentiate each Relay?

Currently in my code (where physically drive a 1019 - PhidgetInterfaceKit 8/8/8 w / 6 Port Hub and 3051 - Dual Relay Board) do the following:

Code: Select all

**************************************************
[i] / / To connect to the plate[/i]
 InterfaceKitPhidget private ik;
 ik = new InterfaceKitPhidget ();
 ik.openAny ();

[i] / / To activate the relay NUMBER 1[/i]
 ik.setOutputState (0, true);

[i] / / To activate the relay NUMBER 2[/i]
 ik.setOutputState (1, true);

[i] / / To deactivate the relay NUMBER 1[/i]
 ik.setOutputState (0, false);

[i] / / To deactivate the relay NUMBER 2[/i]
 ik.setOutputState (1, false);
 **************************************************

From already thank you very much for the help you can give me.

Re: Phidgets Convination

Posted: Wed Apr 27, 2011 4:17 pm
by AdamS
If you want to controll the 1019 and the 1014 in the same software, or at least make sure that in this case you want to make sure that you are opening the 1014, you would want to avoid using the openAny function. openAny will open the first interface kit it sees, and this will be random and could be either of the boards.

So it is best to use open(1234) where 1234 is the serial number for the board you specifically want to open.

Re: Phidgets Convination

Posted: Wed Apr 27, 2011 8:21 pm
by black_unicorn
AdamS:

Thank you very much for your prompt response.

Is there a function that returns me to all different Phidgets that may have connected to my USB's?

Thanks for your help again.

AdamS wrote:If you want to controll the 1019 and the 1014 in the same software, or at least make sure that in this case you want to make sure that you are opening the 1014, you would want to avoid using the openAny function. openAny will open the first interface kit it sees, and this will be random and could be either of the boards.

So it is best to use open(1234) where 1234 is the serial number for the board you specifically want to open.

Re: Phidgets Convination

Posted: Thu Apr 28, 2011 9:59 am
by AdamS
Well, you could use the Phidget Manager object for that.

It has events you can link to to see when a Phidgets device is a attached and also return a list of attached Phidgets devices.

Take a look at the PhidgetManager (sometimes called PhidgetControlPanel) example.

Re: Phidgets Convination

Posted: Thu Apr 28, 2011 2:41 pm
by black_unicorn
Ok. Thank you very much, will study the API PhidgetsManager then.

One last query.

Suppose the same case but with a SBC2 connected via Wi-Fi.

Is it the same? But with open (java.lang.String ipAddress, int port)

Thanks again.

AdamS wrote:Well, you could use the Phidget Manager object for that.

It has events you can link to to see when a Phidgets device is a attached and also return a list of attached Phidgets devices.

Take a look at the PhidgetManager (sometimes called PhidgetControlPanel) example.

Re: Phidgets Convination

Posted: Thu Apr 28, 2011 3:54 pm
by AdamS
yes, that is what you would do. What you are connecting to on the SBC is an interface kit, so all your doing is connecting to a remote interface kit where you would use the open command with ip address, port, and the serial number as well.

Re: Phidgets Convination

Posted: Thu Apr 28, 2011 7:25 pm
by black_unicorn
¬°Thanks for all your help!

AdamS wrote:yes, that is what you would do. What you are connecting to on the SBC is an interface kit, so all your doing is connecting to a remote interface kit where you would use the open command with ip address, port, and the serial number as well.