Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Can't get data from Network tables (http://www.chiefdelphi.com/forums/showthread.php?t=146223)

Jeringo 24-03-2016 21:54

Can't get data from Network tables
 
I have recently set up grip on my DS PC and have it post to network tables on roboRIO-4749-FRC.local. I can use outlineviewer.JAR to see the network tables but can't use java to display on the smartdashboard. Could someone give an example from what they have done to get network table values?

Jeringo 24-03-2016 22:14

Re: Can't get data from Network tables
 
right now i have this

Code:

public NetworkTable table = NetworkTable.getTable("Grip/TowerTarget");
Width = table.getNumber("width", 0.0);
SmartDashboard.putNumber("width :", width);

should i use this instead?

Code:

public NetworkTable table = NetworkTable.getTable("Grip/TowerTarget");
Width = table.getNumberArray("width", 0.0);
SmartDashboard.putNumber("width :", width[0]);


Xanawatt 25-03-2016 10:16

Re: Can't get data from Network tables
 
You will need to use the second option. You need to put all of the networktables code in teleopperiodic or you will only get one value at the beginning of the code.


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

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