Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Who Remembers Last Years Framework? (http://www.chiefdelphi.com/forums/showthread.php?t=81273)

Must Be Drama 27-01-2010 16:51

Who Remembers Last Years Framework?
 
i am used to programming that way; the way they expanded and made everything relatively confusing
when i put something in telop it DOESNT run in TELEOP.
im currently programming off of lastyears robot; im just trying to learn the new framework but its not working any heeelp?

Mark McLeod 27-01-2010 17:02

Re: Who Remembers Last Years Framework?
 
In the Project Explorer window you'll see "Team Code". These are the files you will be changing. Leave the others alone. Here are the most important vi's:
  • Begin.vi - this is where you should Open all the devices you'll be using.
  • Finish.vi - this corresponds to Begin.vi and is where you should close all your devices.
  • Teleop.vi - is your regular teleoperated driver code (what was inside the infinite While loop last year. Don't use an infinite While loop here anymore.
  • Autonomous Independent.vi - where you'll program your autonomous moves.

Must Be Drama 27-01-2010 17:04

Re: Who Remembers Last Years Framework?
 
do i really have to open the stuff in the begin vi?

Brandon_L 27-01-2010 19:22

Re: Who Remembers Last Years Framework?
 
Im having the same issues as well, Im used to opening say a motor or joystick out of the loop, doing whatever in the loop, and closing outside it. This year you cant do that in the sub vi and in lost, but for testing purposes I was able to place some code that worked in the same case structure as the teleop sub vi and it worked but is that legal? If someone could get last years default would we beable to use that?

Tom Line 27-01-2010 21:53

Re: Who Remembers Last Years Framework?
 
You don't /have/ to open anything in the Begin.vi, however it only runs once at startup and is ideal to open everything in one easy to remember place.

The idea with this framework is to open a given motor in the begin and use the setref .vi to give it a name.

Then in teleop.vi, outside of the case statement there, use the getref vi with the correct name, wire it into the case statement to do whatever you need to do with it.

If you look at how they set up the arcade drive in the default project you'll get a good idea of how to do it.

The precise reason they changed it this year is to make it easier for teams to help others - there will no longer be confusion about which framework you're using. All you have to say is "labview" now and everyone who has used labview can help you figure it out. It will require relearning a bit if you used the basic framework last year, but the default project is a great starting point to see how to do it.

lon.bushweiler 28-01-2010 10:47

Re: Who Remembers Last Years Framework?
 
It sounds like you used the simple framework last year. The changes between last years advanced framework and this years are pretty subtle. I find their use of references really helps clean up the code.

If you have more specific questions, we are here to help.

Good luck.

Mark McLeod 28-01-2010 11:30

Re: Who Remembers Last Years Framework?
 
Quote:

Originally Posted by Must Be Drama (Post 907984)
do i really have to open the stuff in the begin vi?

The trouble with adding an Open/Close directly to Teleop is that in this framework we leave and reenter Teleop 50 times a second, so you'll be opening and closing your device really fast- more than 6,700 times during a single match, and probably as high as 10,000 times counting delays of game.

Last year's Basic Framework remained in the infinite Teleop loop, so the Opens and Closes outside the infinite loop only got executed once.
Autonomous was the same way, so your devices probably got Opened and Closed, maybe 2 times in a whole match.

Joe Ross 28-01-2010 15:14

Re: Who Remembers Last Years Framework?
 
Quote:

Originally Posted by Mark McLeod (Post 908499)
The trouble with adding an Open/Close directly to Teleop is that in this framework we leave and reenter Teleop 50 times a second, so you'll be opening and closing your device really fast- more than 6,700 times during a single match, and probably as high as 10,000 times counting delays of game.

You can also do the opens in the init case in telop.vi, which is only called the first time telop.vi is called after being in a different mode. You can do the close in the stop case.


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

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