Dashboard Auto Selector Only Works on Un-Deployed Robot Code

We have an enum to internally differentiate between autonomous modes, and we are utilizing the default dashboard autonomous selector to pick which to run. I’ve included a picture of the selector in a red box as reference. To do this, I’m extracting a string array from the enum and sending that array via network tables in Begin.vi (see screenshot). I then read the selected value from the dashboard via network tables in periodic tasks and convert it back into an enum (see screenshot).

This all works great when I run robot main, but when I build and run as startup, the selector no longer gets populated. When running robot main, I can see in the dashboard’s variables tab that the Auto List variable is set to a string array. However, as soon as I run as startup, Auto List shows up as an empty array.

Additionally, I tried the default 2017 robot project and it exhibited the same behavior. This one used a constant string array published to the dashboard instead of an enum-based array.

I’ve tried rebuilding, power cycling the robot, closing and re-opening the driverstation/dashboard, closing and reopening LabVIEW before rebuilding/deploying, but nothing has worked so far. I am running driverstation 17.0a11 with the default dashboard now. After doing some research, I noticed a new version is available that I will try ASAP. I’m posting this question regardless because I couldn’t find any release notes to indicate whether this is a fixed bug or not.

I would be willing to share additional source code if necessary to debug the problem, but I believe having the same behavior in the example project indicates a deeper problem than just our code.

Thanks!

Dashboard.png
Begin.png
PT.png


Dashboard.png
Begin.png
PT.png

If i remember correctly you can add strings into the selector in the dashboard code and then send the output string to the robot and the robot read the string inside the autonomous code. You would just use a case selector and make a case for each auto program you want.

You are right, this is one way to do it. However, this is not a portable solution and introduces more points of failure (as we add more options, we need to make changes in multiple spots or risk mismatches). The enum method ensures the dashboard should always show the autonomous modes available in this version of the robot code. The default robot code for 2017 sends an array of strings to the dashboard which then populates the dashboard selector.

My issue is that this works perfectly fine when I run robot main (i.e. not run as startup), but the dashboard does not receive the selector values when I build and run the code as startup.

Turns out the solution was pretty simple. The issue is that RT targets do not seem to process data relating to front panel elements, so the enum control I was extracting strings from never existed when running as startup. See this thread here: How to programatically get enum strings in RT code? - NI Community

My fix is screen-shotted below for reference. Basically, I loop through all values in the enum typedef and convert each to a string value. These strings are built into an array and everything works great.

Fix.PNG


Fix.PNG

Glad to see you got to the bottom of this. To confirm. Built EXEs do not contain panels, so property nodes or other UI features will error out once built.

Greg McKaskle