Go to Post Or you could go to the Waterloo or Greater Toronto regional, walk up to anyone in their pit, and ask. You may end up feeling like you asked for a sip of water and ended up soaked by a fire hose, but you won't walk away disappointed. - Richard Wallace [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-06-2013, 04:11 PM
Hypnotoad's Avatar
Hypnotoad Hypnotoad is offline
Junior Assistant Secretary of Moon
no team
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: California
Posts: 114
Hypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these parts
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() {
}
}
__________________
The following sentence is true.
The preceding sentence is false.
This sentence is false.
This signature is false.
My teeth are false.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-06-2013, 05:33 PM
Djur's Avatar
Djur Djur is offline
WPILib
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Massachusetts
Posts: 182
Djur will become famous soon enough
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.
__________________
WPILib dev (RobotBuilder, SmartDashboard, GRIP)
Reply With Quote
  #3   Spotlight this post!  
Unread 05-08-2013, 03:28 PM
Hypnotoad's Avatar
Hypnotoad Hypnotoad is offline
Junior Assistant Secretary of Moon
no team
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: California
Posts: 114
Hypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these partsHypnotoad is infamous around these parts
Re: NetworkTables issues.

Thanks! That fixed everything up!
__________________
The following sentence is true.
The preceding sentence is false.
This sentence is false.
This signature is false.
My teeth are false.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:45 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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