View Single Post
  #1   Spotlight this post!  
Unread 06-02-2017, 22:14
BertTurtle BertTurtle is offline
Registered User
FRC #5940
 
Join Date: Apr 2016
Location: Burlingame, CA
Posts: 9
BertTurtle will become famous soon enough
Issues with retrieving NetworkTables

When we try to retrieve NetworkTables our driver station code crashes with the error:
Code:
Unhandled exception: java.lang.IllegalStateException: Network tables has already been initialized
The code on the coprocessor is:
Code:
NetworkTable.setIPAddress("59.40");
NetworkTable table = NetworkTable.getTable("Vision");
table.putNumber("Test Value", 8);
Then the code on the driver station is:
Code:
NetworkTable.setClientMode();
NetworkTable.setIPAddress("59.40");
table = NetworkTable.getTable("Vision");
SmartDashboard.putNumber("Test Value", table.getNumber("Test Value", 0));
We think it has something to do with NetworkTable.setClientMode() because when we remove that line it doesn't crash but we are not able to retrieve the number.
Reply With Quote