Which LabVIEW example code?

Though this is my 2nd year on my school’s robotics team, it’s my first year to deal with the programming. I’ve only done some of the tutorials in LabVIEW and don’t know how it interacts with the robot and all that junk. So naturally I’m trying to learn all that THIS semester so I’ll be ready in January!
I’m starting today after school, actually, plugging in example code found online and looking up how to get that to communicate with the robot. I’m aware that there’s sample code all over the internet that can be downloaded and immediately used to make the robot move, but I’m not sure exactly which download I should use.

TL;DR: if you know where the sample code I could grab to download and immediately plug in to our robot from last year, so I can learn how to get from LabVIEW code to the robot and everything in between, I’d really appreciate a point to it, since I’m lost among too many resources.

As you say, there is plenty of material on the internet.

I’d suggest starting with the NI fry training site … https://decibel.ni.com/content/docs/DOC-8923.
Or if you prefer movies, try frcmastery.com.

These will lead you through using the default code and explain how it works. Then they will lead you through making small modifications to add a sensor or turn arcade into tank. There are many examples that ship with LV, and learning to use them to explore the WPILib functions is pretty key to quick progress and good understanding of what your code is doing.

Once you get the basics down, you should have little problem downloading code from other teams and sites and making enough sense of it to determine how to integrate it successfully.

Greg McKaskle

The problem with using example code like that is that if your motors and other things aren’t plugged in to the same port in the cRIO modules as the example code specifies, then nothing will work.

To deploy code, you can do one of two things. First turn on the robot, then, get some kind of connection between the computer you have the code on and the robot’s radio. You can do this by plugging an Ethernet cable to into the radio and the computer, or by using wi-fi from the computer to the radio. Either way, you’ll need to set the computer’s IP address to your team number. (Like 10.37.53.29 could be an IP address you set your computer to. You just have to make sure the last 2 digits aren’t already used elsewhere such as the driver station, c-RIO or the default gateway on the radio.)

Then once you get a connection, you can go to your Robot Main vi and click on the run arrow in the top left corner. This should start deploying the code to the c-RIO. Once it’s deployed, turn on your driver station, and the robot should run off the code that you just deployed as long as you keep your computer running the code. (I say turn on the driver station last because we’ve had trouble connecting to the c-RIO while the driver station is on)

Hope this helps you out.

I’ve posted the LABView code from Truck Town Thunder Team 68 on our website (http://www.trucktownthunder.com/index.php/resources/external). You can download the robot and driver station code.

I’ve also attached a zip file (2012 Documentation.zip) containing a number of powerpoint presentations I’m planning on showing the team this year about how we created the code for Rebound Rumble. Please check the notes on each page for more information.

I hope this helps out with your continuing education and good luck

2012 Documentation.zip (4.18 MB)


2012 Documentation.zip (4.18 MB)

Thank you so much to everyone for the help ^^ It all helped me understand a good bit.

After way too many issues with the simplest things (downloading the drive station and what not), and talking with my Robotics teacher/sponsor I think I understand the communication as I need to. And even better, it turns out we still have our team’s code from last year! It’s on the little white FRC laptop (which apparently had its screen broken the other day), but we have it.

So my next questions: to move the LabVIEW files over from that laptop to my own, do I just need to find them on that laptop and copy/paste them over, or is it more complicated than that?
I was told that it’s typically suggested to use one computer for LabVIEW coding and a separate computer for drive station work. Is there any specific reason for this?

I would open the project on the laptop with the code on it, go to File > Save As… and select the option that saves all of the files with its dependencies. The reason for this rather than copying and pasting is that there are other files the project depends on not in the same spot as the rest of the code.

In the past we’ve used two different computers for the code and the driver station because for one, the classmate has a limited amount of HDD space, and two, in competitions, it’s useful to be able to make changes to code if they are needed rather than waiting for the driver station laptop to make it back to the pit.