waitForAttachement hangs

Supporting Java SE version 7 and up
winter

waitForAttachement hangs

Postby winter » Fri Jun 10, 2011 1:22 pm

Hello,

The waitForAttachement never returns for me. Please check the following code:

package com.securekey.qa;

import com.phidgets.*;
import com.phidgets.event.*;

public class Test{
public static final void main(String args[]) throws Exception {
ServoPhidget motor;

System.out.println(Phidget.getLibraryVersion());

motor = new ServoPhidget();
motor.openAny();
System.out.println("waiting for MotorControl attachment...");
motor.waitForAttachment();
}
}

winter

Re: waitForAttachement hangs

Postby winter » Fri Jun 10, 2011 1:54 pm

After I closed the Phidget Control Panel, the problem is gone.

rsabine
Fresh meat
Posts: 3
Joined: Wed Jan 11, 2012 9:35 am
Contact:

Re: waitForAttachement hangs

Postby rsabine » Thu Jan 26, 2012 11:56 am

I just got my 1066 advanced servo controller and HS-485HB servo in the mail today. The Phidget Control Panel works just fine but I can't seem to any JAVA programs to get past the

servo.openAny();
System.out.println("waiting for Servo attachment...");
servo.waitForAttachment();


my console just sticks with this message:

Phidget21 - Version 2.1.8 - Built Jan 23 2012 10:51:57
waiting for Servo attachment...

I have tried Eclipse and NetBeans with and without the control panel...

User avatar
Patrick
Lead Developer
Posts: 3157
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: waitForAttachement hangs

Postby Patrick » Thu Jan 26, 2012 1:04 pm

Do you still have the phidget opened from the control panel example?

-Patrick

rsabine
Fresh meat
Posts: 3
Joined: Wed Jan 11, 2012 9:35 am
Contact:

Re: waitForAttachement hangs

Postby rsabine » Thu Jan 26, 2012 2:57 pm

Yes and no... I have tried to run the java program with the control panel running in my tray and with out it running. Which should it be? I have not found any instruction that says I should close it except a mention that the local machine can only have one open control.

Do you think there is another thing running that might effect the java program that does not effect the control panel program?

rsabine
Fresh meat
Posts: 3
Joined: Wed Jan 11, 2012 9:35 am
Contact:

Re: waitForAttachement hangs

Postby rsabine » Thu Jan 26, 2012 5:09 pm

Sorry, i was inattentive. I tried ServoExample.java, not the AdvancedServoExample.java.


Return to “Java”

Who is online

Users browsing this forum: No registered users and 0 guests