Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   General LabVIEW questions from a VERY new user (http://www.chiefdelphi.com/forums/showthread.php?t=110934)

ctccromer 28-01-2013 15:15

Re: General LabVIEW questions from a VERY new user
 
1 Attachment(s)
how do you put the blue Stop thing though?

EDIT: Is there one of these VI's that is a MOTOR vi, not a DRIVE vi? That would make things WAYYYYYYYYYYYYYY simpler, and easier to understand. Pic attached

Alan Anderson 28-01-2013 18:50

Re: General LabVIEW questions from a VERY new user
 
Quote:

Originally Posted by ctccromer (Post 1223412)
how do you put the blue Stop thing though?

After you've placed the enum control, right-click on it and choose Properties from the popup menu. Select the Edit Items tab. You can insert new items and rearrange the items in the list. The "Items" column holds the name of the enumerated values; you can double-click on one and edit it to be whatever you like. Greg picked "Stop" and "Go" for his example.

Quote:

EDIT: Is there one of these VI's that is a MOTOR vi, not a DRIVE vi? That would make things WAYYYYYYYYYYYYYY simpler, and easier to understand. Pic attached
You don't need a combined "drive and delay" vi for a motor that has the safety disabled. Just put a Delay in the frame next to the Motor Set Value.

ctccromer 28-01-2013 19:00

Re: General LabVIEW questions from a VERY new user
 
The only timing VI's i found besides that one are all seemingly independent. The one attached above wires directly to a drive system. So I need one to wire directly to a SetMotorOutput vi. Or if not, then I don't know how to use one. Once again, all I'm trying to do is:
1) Send a motor control the value of -1
2) Wait 0.25 seconds
3) Send a motor control the value of 1
4) Wait 0.25 seconds
5) Send a motor control the value of 0 (and leave it that way until I call this function again)

Alan Anderson 28-01-2013 21:46

Re: General LabVIEW questions from a VERY new user
 
Quote:

Originally Posted by Greg McKaskle (Post 1222713)
...I attached an image of the general code that would be pretty easy to duplicate and set to other mechanisms. The other case handles stop and delays for 20ms. Look through the code and see if you see any issues or have any questions.

Greg, shouldn't that last frame be after the For Loop? You don't want to Stop execution after each set/delay; you want to Stop after they're all done.

Greg McKaskle 28-01-2013 23:02

Re: General LabVIEW questions from a VERY new user
 
Yes. Reset the global after the planned movements are complete.

Greg McKaskle

ctccromer 30-01-2013 08:54

Re: General LabVIEW questions from a VERY new user
 
I finally figured out the sequence. It was actually much easier than we were making it.

But now I'm starting to get into Autonomous programming. I think I understand the coding part of it fine, but I do have a few questions about the general use of Autonomous mode:
1) I was told you can have up to.. I think it was 10? different Autonomous modes. At competition, how do I choose one before the match starts?
2) When practicing during the build season, how do I simulate the Autonomous mode part of the game? Do i change the drive station to Autonomous, Enable, and after 15 seconds it will automatically flip over to teleop, or is it more complicated than that? I'm unable to test anything with our robot at the moment but I also don't want to accidentally mess anything up

Thanks!

Mark McLeod 30-01-2013 09:11

Re: General LabVIEW questions from a VERY new user
 
1 Attachment(s)
There isn't a limit on the number of discrete autonomous routines you write.

You can choose the mode to run from the Driver Station, using the I/O tab, or wired selectors, or by choosing with a button press or a sequence of presses.
You can install a switch on the robot itself to choose between autonomous modes. Switch values are available in your cRIO code. Lots of options.

Choosing Autonomous mode on the Operation tab will just run Autonomous mode as long as it's enabled. No time limit is imposed.

Using Practice mode will by default go through a typical field cycle of Disable/Autonomous/Disable/Teleop/Disable. Options are provided on the Setup tab to adjust the times, so for instance you can reset the Teleop period to be 0 seconds if you don't want to bother with that mode, but still get the Autonomous time limit and other transitions.

ctccromer 30-01-2013 22:36

Re: General LabVIEW questions from a VERY new user
 
Awesome, i played around with the drive station and understand that part.

Still a little confused how I can tell the drive station or robot to pick (ex) Autonomous Mode 2 of 5. So if we wanted we could have an Auto Mode for the back of the period and the front, and choose between them at the last minute.

EDIT: Also so y'all know, I'm planning on making a video (after build season ends) where I go through our robot's entire code and explain absolutely everything I can. This way anyone that's in the position I was/am next year will be able to watch it and learn a ton without having to ask a million questions like me :)

ctccromer 05-02-2013 23:05

Re: General LabVIEW questions from a VERY new user
 
Quote:

Originally Posted by ctccromer (Post 1224969)
Still a little confused how I can tell the drive station or robot to pick (ex) Autonomous Mode 2 of 5. So if we wanted we could have an Auto Mode for the back of the period and the front, and choose between them at the last minute.

And also how to separate multiple Autonomous Modes in the programming

Alan Anderson 06-02-2013 07:42

Re: General LabVIEW questions from a VERY new user
 
Quote:

Originally Posted by ctccromer (Post 1224969)
Still a little confused how I can tell the drive station or robot to pick (ex) Autonomous Mode 2 of 5. So if we wanted we could have an Auto Mode for the back of the period and the front, and choose between them at the last minute.

Either use the Dashboard to set a value that you then read on the robot using the SmartDashboard functions, or just use what's on the I/O tab of the Driver Station.

Quote:

Originally Posted by ctccromer (Post 1228494)
And also how to separate multiple Autonomous Modes in the programming

Turn Autonomous Independent into a single large Case block. Put each mode's code in a separate case and use the value you receive from the Driver Station (or the Dashboard) to select which case gets executed.


All times are GMT -5. The time now is 01:33.

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