This page is archived and will no longer be updated by National Instruments.
1. Set Up - Resources
LabVIEW Development Suite for FRC 2014
Imaging cRIO & Windows IP Configuration
Troubleshooting cRIO connections
2. LabVIEW Basics - Resources
Learn LabVIEW - Video Training
3. Vision, PID, & Simulation Resources
4. Advanced Programming Resources
Full FRC LabVIEW Training (Beginner & Advanced) 4.5 hrs each
It seems that the 2015 Joystick Palette has replaced the Get VI with a Get Value VI. The Get Value VI outputs an array (instead of the cluster output I saw last year). Is there any documentation listing & accessing the position of each buttion/axis in the array? If so where can I find it?
Thanks.
Follow up
I found that I could map the buttons and joystick axises using the simulation tool. I am still interested in knowing if there is any official documentation.
There is also a VI in the Joystick Palette called Get Info that will tell you about your joystick. We recommend you use that to find the Axes.
The buttons are simply in the same order as last year. Naturally since the buttons are in an array (0-based index) you have to subtract 1 from the number printed on the joystick buttons (1-based index).
This is the porting guide. It's really helpful
http://wpilib.screenstepslive.com/s/4485/m/13811/l/292165-labview-porting-guide-2014-to-2015
So we now have to manualy find the axes then use the index number instead of having labled clusters?
Yes, you now have to specify which index you want (assuming you know which index), and that is the only value you will receive. The programmers from my team and I felt this was a bit more error-pron than simply choosing the labeled index we want from a cluster of values, so we decided to ignore it. Fortunately, LabView has a built in tool that can convert an array to a cluster. We then unbundled that cluster, giving us a similar completely-labeled data layout like we had last year. Either approach works.
Hope this helps,
Nick May
Sent from my iPhone
In the past the labelled cluster was misleading. It was always the same thing (static) and, depending on what joystick you have, it would be wrong. The new method allows you to find the correct axis no matter what type of joystick you use since the DS will now send the list of axes so you know what index they are in.
I am having a trobling time with buttons in the 2015 LABVIEW. I looked at the porting guide from 2014 to 2015 and tried to program buttons with arrays. I had little success (The robot did what I programmed but it wasnt the right button I had to press, and with less power than programmed). Than I tried what mavismay(higher in the comments) said with converting the array to a cluster. Having the same amount of success as last time. I am wondering if anyone can help me with the buttons. It would be greatly appriciated.
-Calvin
So you tried both ways and neither worked? If you can upload some screenshots of the code in question, I can look and see for you. It's always hard to understand the problem without context.
Thanks,
Nick
Sent from my iPhone
Thank You for helping me. Here is example code of what I am trying to accomplish.
Much appreciated
-Calvin
Alright, sorry it took me so long to get back to you, but I finally got a
chance to take a quick look. Anyway, from what you've shown me, you are
using the "unbundle cluster" correctly, I think any problems you are having
are on the logic end of the program. So, for example, if your power is not
at what you desire, up the numerical values you are feeding to the motors.
Also, you probably noticed by now that you have to hold the buttons to get
them to work. That is because you are using simple case structures; these
reset every 10 milliseconds with the rest of the teleop VI. If the buttons
you assigned are not working correctly, that could also just be a simple
case of misunderstanding which button corresponds to which on your
controller (I've done that a million times).
I hope this all makes sense. Feel free to ask any more questions if you
still need help.
- Nick
It all makes sence and thank you for the help. Ill will play around with the code. This help means a lot to me.
-Calvin
Hello,
So Im messing around with our teams pratice bot in order to learn encoders and how they work, and I can't seem to get the program to work. The robot will drive but it will not stop at the set point. Does anyone know why?
Please see my attached Picture.
-Calvin
How confident are you about the PID gains? If they are not tuned to the system I can see how you may never see a motor drive value of less than 0.1 What if instead of looking at the motor drive value you looked at the difference between the set value (50) and the encoder value typically called the error value. This value may give you a better indication of how close you are to the target.
I did do something like that than I found another example online that showed me that code. So I wanted to try it out to see if it would work. But here is what I origanally done.