Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   NetworkTables issues. (http://www.chiefdelphi.com/forums/showthread.php?t=116721)

Hypnotoad 06-05-2013 16:11

NetworkTables issues.
 
Hello. I am attempting to use networkTables on the robot. Unfortunately, I am getting the same error over and over:
java.lang.IllegalStateException: Network tables has already been initialized.

Does anyone know why this may be happpening.

I strip the code down to the barebones.

The code is below:

public class RobotTemplate extends IterativeRobot {
NetworkTable table;

public void robotInit() {
NetworkTable.setServerMode();
NetworkTable.setIPAddress("10.6.96.2");
table = NetworkTable.getTable("XYTable");
}
public void autonomousPeriodic() {
}
public void teleopPeriodic() {
table.putNumber("X", 3);
table.putNumber("Y", 4);
}
public void testPeriodic() {
}
}

Djur 06-05-2013 17:33

Re: NetworkTables issues.
 
You're trying to initialize the NetworkTable again. Remove these two lines and you should be good.

Code:

NetworkTable.setServerMode();
NetworkTable.setIPAddress("10.6.96.2");

See the ScreenSteps Live page for tutorials on how to use NetworkTables.

Hypnotoad 08-05-2013 15:28

Re: NetworkTables issues.
 
Thanks! That fixed everything up!


All times are GMT -5. The time now is 09:59.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi