Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   No clue where to start on Programming... (http://www.chiefdelphi.com/forums/showthread.php?t=101358)

Team3763 Adam 28-01-2012 11:04

No clue where to start on Programming...
 
Good evening Delphi,

My name is Adam of Team 3763. Our team has just recently started Programming, and I am our so called "lead programmer."

To simply state it, I have gone through and installed ALL required files onto the HOST Computer. These Files include: FRCLabVIEWupdate4.00for2012, FRC2012Utilities, and the FRC2012DriverStationUpdate. I have gone through ALL tutorial steps found here: file:///C:/Program%20Files/National%20Instruments/LabVIEW%202011/manuals/FRC_Programming_Guide/index.html#exampleprog. Now, I am at a loss as to what to do next. I'm unsure of what to do next. This is our first year with programming, but our second year with FRC. Any and ALL help would be appreciated. We wish to use an Xbox360 WIRED controller, however we CAN, if need be, use the standard provided Joysticks.

All help is appreciated from anyone. Please reply ASAP.

Thank you,
Adam of Team3763 - Wildcards

Shrubadub 28-01-2012 11:09

Re: No clue where to start on Programming...
 
I would use the standard joysticks that is what i use. To have base for programming use the FRC example provided by labview.

billbo911 28-01-2012 11:12

Re: No clue where to start on Programming...
 
Do you have any other teams in your area that can walk you throught the basics? That is how we have helped new teams in our are, or teams with new programmers.
For now, start with getting the motors spinning for Teleop driving.

Team3763 Adam 28-01-2012 11:17

Re: No clue where to start on Programming...
 
We have one team nearby that I know of, however I believe they're lacking in the field of Programming. I've looked through a majority of examples provided in LabVIEW. It's just a matter of "ok what do I do now?" and where to start. Once I get passed this, I think we'll be good so far as programming goes. It's just comprehending the basics.

Tommy F. 28-01-2012 11:45

Re: No clue where to start on Programming...
 
http://www.frcmastery.com/ has some great tutorials for LabVIEW. I suggest you take a look at these if you already haven't.

rsisk 28-01-2012 13:11

Re: No clue where to start on Programming...
 
You can't go wrong with the resources at WPI either: http://thinktank.wpi.edu/tag/1

The 2 minute lesson:

In Labview, generate a default project for your robot. Be sure to put your team number in for the IP address (10.37.63.2) when you generate the project.

In Project Explorer, Expand the Build Specification thingy, right click on FRC Robot Boot Up Deployment and BUILD, after that finishes, same thing but click RUN AS STARTUP.

If all that succeeds, you now have a robot that will drive with a single joystick and a left and right motor.

To add more functionality, open up BEGIN.VI, press Ctrl-E to get to the block diagram. This is where you connect the programming world of Labview to the physical world of your robot. Check out the definition for the motors and the joystick to see how this is done.

To add other functions, right click in the block diagram to bring up the functions toolbox. Down at the bottom you will see the WPI LIBRARY, this is where most (all?) of the robot related functions are located. You can add motors, joysticks and other stuff here.

The bulk of your programming will take place in TELEOP.VI, this is the LOOP that runs while your robot is in telop mode. Same ideas apply as in BEGIN.VI, except here you will open references to the things you defined in BEGIN.VI, and do stuff with them; read sensors, send signals to motors.

That is the basics, after that, go check out examples, spend time on FRCMASTERY, hook up with other teams and all will be good.

commonsense 28-01-2012 13:56

Re: No clue where to start on Programming...
 
I agree with all the rest of them. I am a first year labView programmer in lead position. However I have done other languages before. Do you have any other experience? I learned a lot from the tutorials, and the programer from last year (now in college). For where you are I would just suggest setting up your cRIO with the default code and getting it to deploy. After that, start from the basics. Add a motor with a default power value into your code. For a motor to run you need an "Open VI" and a "Set Refnum VI" wired together in the "Begin VI". Then in your telleop VI write a "Get Refnum VI" wired to a "Set Output VI" with an output value. And in the "End VI" write in a "Get Refnum VI" wired to a "Close VI" with the same refnum name you put into the other Refnum name terminals. The wiring is easy using the color coding. Also to give a constant value to a terminal right click on the terminal and chose Create then Constant. Once you have this, start adding in other controlls, doing the same setup, and hook them together in a logical order.
ps. some of the VIs might be the wrong name since I was working off of memory.

Team3763 Adam 30-01-2012 16:35

Re: No clue where to start on Programming...
 
Quote:

Originally Posted by rsisk (Post 1115243)
You can't go wrong with the resources at WPI either: http://thinktank.wpi.edu/tag/1

The 2 minute lesson:

In Labview, generate a default project for your robot. Be sure to put your team number in for the IP address (10.37.63.2) when you generate the project.

In Project Explorer, Expand the Build Specification thingy, right click on FRC Robot Boot Up Deployment and BUILD, after that finishes, same thing but click RUN AS STARTUP.

If all that succeeds, you now have a robot that will drive with a single joystick and a left and right motor.

To add more functionality, open up BEGIN.VI, press Ctrl-E to get to the block diagram. This is where you connect the programming world of Labview to the physical world of your robot. Check out the definition for the motors and the joystick to see how this is done.

To add other functions, right click in the block diagram to bring up the functions toolbox. Down at the bottom you will see the WPI LIBRARY, this is where most (all?) of the robot related functions are located. You can add motors, joysticks and other stuff here.

The bulk of your programming will take place in TELEOP.VI, this is the LOOP that runs while your robot is in telop mode. Same ideas apply as in BEGIN.VI, except here you will open references to the things you defined in BEGIN.VI, and do stuff with them; read sensors, send signals to motors.

That is the basics, after that, go check out examples, spend time on FRCMASTERY, hook up with other teams and all will be good.

Thank you so much for this help along with everyone else who has provided input. I'm starting to get a "better" hang on programming. However, I have run into yet ANOTHER problem.

While in LabVIEW::

-Went to Robot Main.vi
-Pressed Ctrl+E which opened the Robot Main.iv Block Diagram.
-Double-clicked the Begin.vi and opened up the Begin.vi Front Panel
-Pressed Ctrl+E and opened the Begin.vi Block Diagram.


Now from here I tried 2 different options for adding 2 MORE motors.

Option one:
After opening the Begin.vi Block Diagram I did the following:
-Added another...Pink-ish text box and titled it "Left and Right Motors 2."
-From here I wired up EXACTLY how the first 2 motors were wired up. (Refnum, Drive - Open 2 motors, etc...)
-I COPY and PASTED the 2 PWMs provided on-screen and titled them PWM 3/4.
-With NO ERRORS, I deployed the code onto the cRIO.
-Afterwards, we switched over to the Classmate Driver Station.
-We had Robot Code and Communication, however when moving the joystick, only 2 of the 4 motors spun. (The 2 motors that were already written in the program.
**Option one failed.

Option two:
-Instead of ADDING another "Drive - Open 2 motors," I DELETED the provided Drive - Open 2 motors and REPLACED that with a Drive - Open 4 motors, adding 2 more PWMs, 3 and 4, where the other 2 motors were wired.
-With everything wired correctly and NO ERRORs displayed on screen, we moved over to the Classmate.
-Again, only 2 of the 4 motors were spinning. And again, only the 2 motors that were previously programmed.
**Option 2 Failed.

Right now, we are JUMPING all 4 motors together, but this is causing one motor to stay constant running, while the other 3 react to the position of the joystick.

Any and ALL help reguarding adding 2 more motors to the Begin.vi Block Diagram would be appreciated.

~Team 3763. Adam.

Alan Anderson 30-01-2012 17:18

Re: No clue where to start on Programming...
 
Option two should have worked for you, assuming you kept the same name for the RefNum so that the Drive block in Teleop would find it properly.

When you say you "deployed the code onto the cRIO", what exactly do you mean? Did you Build the project first?

Team3763 Adam 30-01-2012 21:19

Re: No clue where to start on Programming...
 
I have done the whole "Build" through the Build Specifications part of the Project Viewer. Deploying the code to the cRIO is when you press the arrow in the upper left hand of the screen that points right. This transfers all programmed code onto the cRIO ready for use on the cRIO and Driver Station. It is also known as "Run."

Option two might not have worked for this reason, and I think I hit a breakthrough.

I used the same refnum function blocks and everything, however this was only under the Begin.vi Block. I had never taken into account that the Teleop.vi is I guess for lack of a better word, the "control station" of programming. I looked under the Teleop.vi block, and I found a pathway I would call it where would show Left and Right Motors ---> Drive RefNum Get ---> Drive Arcade Drive. Along with that, the joystick information is also directed INTO the Drive Arcade Drive.

Now, I THINK that because I never made a replicate of this path, motors 3 and 4 had nothing "controlling" them. No joystick function, no Drive RefNum Get. Nothing.

However being that I am home now, I cannot "test" my theory for the time being.

Any schematics, drawings, anything involving LabVIEW and how to wire up ADDITIONAL motors would be so helpful!

Looking forward to all responses,
Adam of Team 3763 - Wildcards

Team3763 Adam 30-01-2012 21:44

Re: No clue where to start on Programming...
 
A HUGE shoutout to commonsense of Team 3452!

I have rewrote a fresh, new program and I have high hopes of this one working!!

Come tomorrow I'll get back to all of you, read any new posts, and let you all know how I did. I have a great feeling about this, for once!

Once again a shoutout to commonsense of Team 3452!
And of course everyone else who has contributed in some sort of way!

This is Adam of Team 3763 signing off until another day. Thank you everyone!

Team3763 Adam 31-01-2012 15:14

Re: No clue where to start on Programming...
 
Each time I try to Deploy the new code onto the cRIO, a Conflict Resolution window appears. Below will be a Screenshot of the window.

If anyone knows why this is occuring and can help fix this, please reply. ASAP.

http://imgur.com/lTOrP

RufflesRidge 31-01-2012 15:23

Re: No clue where to start on Programming...
 
Quote:

Originally Posted by Team3763 Adam (Post 1117182)
Each time I try to Deploy the new code onto the cRIO, a Conflict Resolution window appears. Below will be a Screenshot of the window.

If anyone knows why this is occuring and can help fix this, please reply. ASAP.

http://imgur.com/lTOrP

This is a warning, not an error. The ways to stop it from happening are much slower than just clicking OK. There are no ill effects from just clicking OK.

Team3763 Adam 31-01-2012 15:27

Re: No clue where to start on Programming...
 
Quote:

Originally Posted by RufflesRidge (Post 1117187)
This is a warning, not an error. The ways to stop it from happening are much slower than just clicking OK. There are no ill effects from just clicking OK.

That is a MAJOR relief, thank you.

vhcook 31-01-2012 16:00

Re: No clue where to start on Programming...
 
Quote:

Originally Posted by Team3763 Adam (Post 1117182)
Each time I try to Deploy the new code onto the cRIO, a Conflict Resolution window appears. Below will be a Screenshot of the window.

If anyone knows why this is occuring and can help fix this, please reply. ASAP.

http://imgur.com/lTOrP

Basically what this message is telling you is that you are replacing the code that is in the cRIO with the load you are deploying. Since that's what you meant to do, it's ok. The error you want to watch out for is "Failed to connect to RT target" which means your programming computer isn't talking to the cRIO.

If you're deploying and running by clicking the run arrow (which is what I'm gathering from your description), make sure you do so from Robot Main, not one of the other VIs like Teleop, so that all the setup code runs. This method is fine for testing since you can set probes to see what's happening, but will not stay if you disconnect the laptop or reboot the robot. You also don't have to Build before running this way.

When you have some code you'd like to stay in the robot after it's rebooted, use "Run at Startup" (not "Deploy") from the same right-click menu where you did the Build. You do need to complete a build before using this option.


All times are GMT -5. The time now is 11:37.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi