My team wants to have separate autonomous modes to switch between at Worlds. We currently have just a booleon on the dashboard to switch between single ball auton and double ball auton, but we also want to have a mode where we just drive forward. We figured a drop-down menu would be the easiest way to switch between each mode but we can’t seem to figure out how to do it.
The menu control in LabVIEW displays strings, but its datatype is a numeric which starts at zero and counting up. So this is quite easy to send to the robot to select which action to take.
A slightly more complex form is used by the testing code. You can take the value of the drop-down and the property that returns the list of strings. Then you index the strings and write that to a SD variable. On the robot, you can wire the string directly to the case structure. Be careful that the strings match in case, spacing, etc.
I love the creative way the person above does it. But there is a much simpler and convenient way. And it will give you your desired result of a drop down menu!
In the robots code create a case structure in which the auton code modes will be placed. The condition of this case structure will be connected to a dashboard nimber variable. Go to the WPI robotics library palate then go to dashboard and then find the SD read number VI. Name the variable what you want and remember it. Make sure the case structure has enough cases to hold all your modes of course.
Now in the dashboard code. Go to the numerics palate and get an Enum constant. Right click it, and change it to a control.
Right click it again and select edit items and click insert. Add as many modes as you want and take note of the values next to each item (or mode) you enter. As these are the case the mode will be in in the robot’s code.
Now you need to get a SD write number VI. Name it the same as the other dashboard variable.
And lastly, connect the Enum control to the SD write number VI.
Done! :D. Feel free to PM me for questions. I’m happy to help.
Since the support for the cypress board is going away… Will the IO screen be on the 2015 DS? So the question is really is it on the Beta DS? While we never used the cypress board, we have used the IO page for setting configurations & defaults. If it does, you can accomplish the same thing with smart dashboard.
The IO screen has been removed from the 2015 DS. However, the default labview dashboard has 4 buttons and 4 sliders that can be used for that purpose. As you mentioned, it is trivial to do the same thing with smart dashboard.
In our team we just put an Enum control on the dashboard and send it as a number to the robot (with the vi’s that has SD on the corner).
On the robot we convert it back to the enum and use a case structure to define each auton state.
I currently don’t have the code but if it was’nt clear enough ask me for more info, I’ll be happy to help anytime
I’ve just noticed that it’s actually a pretty old post, maybe my comment is not relevant
The DS had the virtual I/O on it before Network Tables and Smart Dashboard existed. The LCD screen was on the front to match the QB DS. As mentioned, the templates show how to do the equivalent within the DB, allowing the DS to lose some baggage and do some other things better.