Implementing NetworkTables

As the title says how would I implement Network tables to send/receive data from the robot? I keep seeing posts where they say “Robot code” and “Smartdashboard code”. I understand how to use Network tables in the robot code, but what I don’t understand is the Smartdashboard code part. Like where do I write that?

If all you want do do is display and send numeric data (or use one of the built in widgets), you don’t need to code anything for SmartDashboard. All you need to do is call SmartDashboard.putNumber early in the code (so that it pops up in the SmartDashboard) and then SmartDashboard.getNumber to retrieve the number from the SmartDashboard.

There’s some documentation about the SmartDashboard here: http://wpilib.screenstepslive.com/s/3120/m/7932

NetworkTables is the underlying networking technology to send and receive values between the robot and the SmartDashboard and LabVIEW dashboard. It can also be used by your own programs to distribute values between the robot and clients, for example, vision processing or custom dashboards. In this example:

http://wpilib.screenstepslive.com/s/3120/m/7912/l/80205-writing-a-simple-networktables-program-with-a-java-client-pc-side

you can see how to write a robot-side and client-side (PC) program that reads and writes some values to NetworkTables.

Brad

What about not just using SmartDashboard? For example, using the regular dashboard with NetworkTables? How do you create a client on the cRIO to connect to it?

EDIT: Brad replied with it, thanks :slight_smile:

Brad, thank you for finally getting this documentation up. NetworkTables looks like a powerful resource, but without documentation like this it was virtually unusable. Thank you so much for finally getting this up, so far it looks like it’s exactly what teams need to be able to functionally use NetworkTables and exactly what I was hoping you guys would put out. Hopefully updates to the Java API documentation comes next!

How do you use it with image processing from RoboRealm though? On this page, it says that you need to set up a desktop program. My question is what template you use to make it and where it goes in what classpath. Thanks!