How do I modify Dashboard to view global variable in FRC TeleOp?

Dear CD,
Struggling again to figure out how to add a global variable (previous Post) in TeleOp (np) and then view it on the dashboard (this post) for basic debugging.

You’re wanting to create a new dashboard project and then use Network Tables (look at the code used in Teleop to send the motor values to the dashboard).

A global has a scope specific to an application. It won’t work across your teleop and dashboard. Those are two different applications.

Jeff,

The Network Tables function only allows pre-allocated names, correct? So, in my case if I want to read the Point of View (POV) parameters on the dashboard, I cannot do that, correct? Or does the Network Tables function allow me to expand the parameters being passed to add POV parameters. Based on your previous response the answer seems to be no.

Network tables let you see your own names as well. They’ll appear in the variable tree or you can build your own dashboard project to drop indicators and see your values on a debug tab.

Jeff B,
Got it working finally. Thanks for you assistance. I used the NT write function in Teleop.vi (first using both I32 and DBL conversion functions) and the NT read function in a new, Dashboard.vi to read the POV status.

That’s great to hear!

Out of curiosity, did you see something somewhere that made you believe it would only work for pre-defined variables?

Jeff,
I guess I read that into your previous statement.

A global has a scope specific to an application. It won’t work across your teleop and dashboard. Those are two different applications.

Perhaps adding, "However, you can read a global variable from your teleop routine on the dashboard by using the Network Tables (NT) functions.

One nuance there. You aren’t adding a global variable there. They’re different things. The global variable is still scoped to the single application (robot code or dashboard).

Network Tables are sending information back and forth between each other. That’s what lets you see things in both. We wouldn’t want to call them a global variable. So I guess tweak your second bit by saying you can share values between the robot code and the dashboard using those functions? Would that still ease the confusion (without adding potential other points of confusion)?

JeffB,

Makes sense. Good point. Thanks again for your help.