Phidgets Convination

Supporting Java SE version 7 and up
black_unicorn
Phidget Mastermind
Posts: 127
Joined: Fri Mar 05, 2010 7:42 pm
Contact:

Phidgets Convination

Postby black_unicorn » Sun Apr 24, 2011 12:26 pm

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.

AdamS

Re: Phidgets Convination

Postby AdamS » Wed Apr 27, 2011 4:17 pm

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.

black_unicorn
Phidget Mastermind
Posts: 127
Joined: Fri Mar 05, 2010 7:42 pm
Contact:

Re: Phidgets Convination

Postby black_unicorn » Wed Apr 27, 2011 8:21 pm

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.

AdamS

Re: Phidgets Convination

Postby AdamS » Thu Apr 28, 2011 9:59 am

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.

black_unicorn
Phidget Mastermind
Posts: 127
Joined: Fri Mar 05, 2010 7:42 pm
Contact:

Re: Phidgets Convination

Postby black_unicorn » Thu Apr 28, 2011 2:41 pm

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.

AdamS

Re: Phidgets Convination

Postby AdamS » Thu Apr 28, 2011 3:54 pm

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.

black_unicorn
Phidget Mastermind
Posts: 127
Joined: Fri Mar 05, 2010 7:42 pm
Contact:

Re: Phidgets Convination

Postby black_unicorn » Thu Apr 28, 2011 7:25 pm

¡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.


Return to “Java”

Who is online

Users browsing this forum: No registered users and 0 guests