I have several question

Ok whenever you program in labview does how do you choose what I/0 is being used?
Also i looked everywhere in these programming posts, and i can’t find one that answers my question.
Is these a default control for the joysticks?
I can’t find one. If i have to program the joysticks myself, how do i make it to where the duty cylce increases as i move the joystick? Stuff like that it doesnt explain in the getting started book that labview provides thats why im asking.
And if you know a post that explains some of this please post it because i keep getting in trouble with chiefdelphi.com for reposts

Since labview hasn’t actually been used in the past for programming FIRST robots, I would have to say that there probably isn’t any default code out yet. The key word in that sentence is yet. When the season gets closer I am sure some default code will be released.

Also for programming the joysticks, what you do in C is grab the analog input from the joysticks (a number from 0 to 254 with 127 as center) and output it to the wheel motors as a pwm value (also 0 to 254 with 127 as center). Most teams also modify the value a bit before they output it (i.e. a bigger deadzone in the middle, half speed, etc.). You don’t actually change the duty cycle, but instead output the pwm value to the victor which takes it and uses it to set its duty cycle.

ok well i thought i had to program using labview but i guess not. thanks now i can save me alot of time

Well, as we are going to a new control system, the cRio by National Instruments, this year, labview is an option for programming. National Instruments has confirmed (several times in fact) that C and C++ will also be options though.

I believe that you could get a bunch of help from the LabView version that will be coming with the FTC kits… It is Labview for FTC. I would imagine it will have some of the remote control commands all worked out and will have a default program (but for FTC).

I will look into my crystal ball here and I would predict that we will get a Labview for FRC included in our KOP this year… I would imagine it will have the Labview default code and a bunch of other easily applicable modules for remote control, motor control… etc…

If you have an FTC team near you check with them… but after next week…
the kits went out today…(September 5th) and should be in their hands next week…

I think that NI will be coming through for us with a relatively easy way to interface controllers… I don’t know WHAT kind of controllers but something.

Hope this helps a little…

I encourage you to keep trying to program in LabVIEW, I know it can be intimidating and frustrating but it’s a very good product and it will be great for the students to get exposure to such an important industry tool.

I’m eager to see what default code and vi’s we’ll get from FIRST but LabVIEW already has so many of the needed solutions to controlling robots. We don’t have our Vi’s posted but you can see images of how we controlled a kitbot using labVIEW, our cRio, a laptop, joystick, and a wireless router on our website: http://www.team1817.org/cRio_report.html

Disclaimer: This is just a side project for us to play around with LabVIEW and may be nothing like the new FIRST control system

In LabView you can use a kind-of ‘wizard’ block to manage the input device (to which the joystick is connected) and that will put put a varying signal (varying according to the joystick position). You can then scale this to a range of 0-255 or whatever you prefer.

I’m not giving the gory details because they change according to the specific input device. For the NI USB-6009 Data Acquisition (DAQ) Device we have, the “DAQ Assistant” can be configured for several different kinds of analog or digital input (for example, resistance, voltage, strain, temperature, current, acceleration…).

The signal from this DAQ Assistant block can be coupled to a second block to scale it, the output as a PWM pulse train by a third block to a Victor, for example. The cool thing is that to program it, you can drop in “Virtual” blocks to simulate your hardware, you don’t even need to have a physical device.

Read the tutorials. Get a Lego Mindstorms NXT kit (which uses a form of LabView). Get LabView and run it, play around. You have 121 days…GO!



I know NI has released some VIs for the simulation of motors and optical encoders (among other things), but they haven’t actually released the VIs that are going to be in the default code. (It seems that the default code consists of an output-disable when E-stop is pressed or when they lose input from the operator interface, a VI to take the ethernet camera data and convert it to a picture datatype, and some sort of OCR.)

I don’t have the default code, but I’ve uploaded some useful VIs I made. Feel free to take a look at them and use them in whatever you plan to do. http://sotabot.com/robot/programming.html
I plan to upload more useful information for teams in the near future.

Excellent, thanks kamocat … we can all use all the help we can get, as we walk down this new path :slight_smile:

I recommend posting this question on the NI FIRST forums. These forums are moderated and supported by NI Engineers that have (a lot) of experience programming in LabVIEW AND programming with the VIs for FRC. If you want more explanation and sample code like I have provided I strongly recommend posting your questions there.

You are absolutely right! LabVIEW FRC edition will be shipping with the KOP, and it will contain default code to interface with sensors, motors, robot drive, etc.

You won’t need to use the DAQ Assistant (“wizard block”) to interface with your joysticks. You simply drop down a joystick VI and select which port your joystick is plugged into (the numbers correspond to which USB ports on the driver station).

Attached is a sneak-peak screen shot of a portion of the joystick API that should answer the original question.