Go to Post Don’t forget the purpose of Chiefdelphi. It is to keep the community connected and to help each other out. Moderators have been working days and nights to keep this forum going years after years. Let’s keep this place professional. - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2010, 11:33
Team1824 Team1824 is offline
Registered User
FRC #1824
 
Join Date: Oct 2008
Location: Peterborough
Posts: 14
Team1824 is an unknown quantity at this point
global variables and autonomous independent

Okay, I have been looking around but I haven't really found the answer to this question. I want to have several cases in autonomous independent that will depend on what field position we are in. I have read something about making a global variable in the finish.vi or something but I don't know anything about global variables. my idea is to put a case structure around all of the autonomous independent and then use the variable to select the case. Is this possible? my cases will be named 1, 2, 3 etc. how do I get the global variable to be read as a number and be wired to a case structure? thanks in advance.
__________________
Team 1824
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2010, 13:15
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: global variables and autonomous independent

I think you are wanting to use DS switches to tell the robot what part of the field it is on.

If this is correct, you can read the DS I/O as many times as you like. And it can be stored in a global if that is helpful.

If you only want this info in the autonomous code, the sample code already reads the switch positions and the slider positions on the left. You can use these to tell the robot the field location.

To set the switches, you can either connect the I/O board and attach physical switches using the breadboard or another breakout, or you can leave the I/O board detached and use virtual switches and values onscreen in the I/O tab.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2010, 13:27
Team1824 Team1824 is offline
Registered User
FRC #1824
 
Join Date: Oct 2008
Location: Peterborough
Posts: 14
Team1824 is an unknown quantity at this point
Re: global variables and autonomous independent

yeah I only want it for the autonomous code. how can I use the code to show the field position? I really have no idea about any of this.
__________________
Team 1824
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2010, 13:43
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: global variables and autonomous independent

One way is to read the analog slider and wire it to the case structure. The value will automatically be converted to an integer and you can add cases for 1, 2, and 3.

Set the slider on the DS, run the autonomous, and put something in your code, like a breakpoint or probe so you can verify the right code is running.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2010, 13:47
Team1824 Team1824 is offline
Registered User
FRC #1824
 
Join Date: Oct 2008
Location: Peterborough
Posts: 14
Team1824 is an unknown quantity at this point
Re: global variables and autonomous independent

how do I read the analog slider? is it a .vi or something?
__________________
Team 1824
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2010, 13:54
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: global variables and autonomous independent

On the left side of the Autonomous, it calls Get Analog Input.vi. This returns the four sliders from the screen on the DS. If you plug in the I/O board, the board sets the sliders, not the screen.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 18-02-2010, 15:02
Team1824 Team1824 is offline
Registered User
FRC #1824
 
Join Date: Oct 2008
Location: Peterborough
Posts: 14
Team1824 is an unknown quantity at this point
Re: global variables and autonomous independent

okay I connected the analog one slot on the get analog in.vi to a case structure surrounding the autonomous code. So now I can just set the slider on the little laptop they sent us and it will convert that to different cases right?
__________________
Team 1824
Reply With Quote
  #8   Spotlight this post!  
Unread 18-02-2010, 21:18
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: global variables and autonomous independent

Test it and see.

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread 19-02-2010, 17:25
mswalker mswalker is offline
Mentor
FRC #2583 (Westwood Robotics)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 26
mswalker is on a distinguished road
Re: global variables and autonomous independent

Also check out the "Get Alliance" vi which outputs field position.
Reply With Quote
  #10   Spotlight this post!  
Unread 19-02-2010, 17:31
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Re: global variables and autonomous independent

Quote:
Originally Posted by mswalker View Post
Also check out the "Get Alliance" vi which outputs field position.
I might be mistaken, but I thought that that Get Alliance only shows your DRIVER STATION position, not necessarily your field position.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote
  #11   Spotlight this post!  
Unread 19-02-2010, 23:00
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,533
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: global variables and autonomous independent

Quote:
Originally Posted by Ziaholic View Post
I might be mistaken, but I thought that that Get Alliance only shows your DRIVER STATION position, not necessarily your field position.
That is correct. Other than telling you whether you are on the red team or the blue team, Get Alliance does NOT tell you anything about your field position.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autonomous Independent Code Issue Watchdog not fed pilum40 FRC Control System 0 11-02-2010 12:00
Using Sensors in Autonomous Independent Felipe Sagui NI LabVIEW 2 27-01-2009 17:25
Making global variables in LabVIEW. Joshamuffin National Instruments LabVIEW and Data Acquisition 1 19-01-2009 13:35
HELP!!! Counters, global variables, and the like danielkitchener Programming 2 23-02-2004 23:53
Global Variables, anyone? Darkman_X000 Programming 3 05-02-2004 22:11


All times are GMT -5. The time now is 22:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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