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.