Go to Post After assisting with the animation last year I realized how cool and useful Inventor was and I started flirting with it. Half a year later I think I have lost all possibility of ever having a girlfriend, and frankly I don't care because I would definately bare the child of this program. - negfrequency [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 22-03-2012, 08:05
dfu1234 dfu1234 is offline
Registered User
FRC #3595
 
Join Date: Mar 2012
Location: Chicago, Il
Posts: 3
dfu1234 is an unknown quantity at this point
Re: Variables, Cameras, and Wait

THANK YOU!

Ok, so, I REALLY like the idea of putting all that processing onto the computer, but I need help with how to actually incorporated it. Do I just extract the folder somewhere and then add the folder via import, or should I put all of these in their proper file location?

Offputting it to a computer also means I can do the actual math instead of a look-up table .

Thanks for all the detail information on the camera. I will try to incorporated (well, not try. HAVE to) later, when I meet up with my team. Let's hope the none-encoded SPIKE is easy enough to set up.

And, the wait command is like this. In Teleop.vi, I want to use a button to change a Boolean variable back and forth. So, I currently have a sort of t flip flop with the button and the variable as the inputs. Here is a picture of it:

Before anyone comments on a glaring flaw in this, there will soon be a while loop in it with button nine the determinate.

What I want to avoid is this: Person presses button 9; Gyro is true. Next tick: Output false into gyro. Next tick: HEY LOOK! Inverse Gyro is true and Button Nine Pressed is true. Let's output and change it! Next tick: etc etc so on and so forth. Considering how fast ticks are, this could utterly screw me. THAT is what I want a wait command/block for.


Team 3595 Massive Attack thanks you heartily.

Last edited by dfu1234 : 22-03-2012 at 08:40.
Reply With Quote
  #2   Spotlight this post!  
Unread 22-03-2012, 12:43
dfu1234 dfu1234 is offline
Registered User
FRC #3595
 
Join Date: Mar 2012
Location: Chicago, Il
Posts: 3
dfu1234 is an unknown quantity at this point
Re: Variables, Cameras, and Wait

Um, in which vi do I put the math? And, what are the output variables? Like I said earlier, I am completely new to labview. After putting this in the project, I am at a loss of what to do. Please help. We are literally at competition right now (practice day, but still.)
Reply With Quote
  #3   Spotlight this post!  
Unread 22-03-2012, 13:23
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Variables, Cameras, and Wait

Do not put loops or waits in Teleop.vi
That would freeze your response to the driver controls and your robot will become jerky and uncontrollable running off to who knows where while your Teleop is waiting (and not processing new packets).

You need to find someone at the competition with you to look over your shoulder and give programming advice. Most events have a Control System Advisor (CSA) who you can ask for help. Pit Admin will know how to get you in touch with them. Also, check with nearby teams or Pit Admin/Help Desk may keep a list of teams that offer programming assistance.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #4   Spotlight this post!  
Unread 22-03-2012, 20:11
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: Variables, Cameras, and Wait

The problem with the code you attached is that it is simultaneously setting Gyro to the value of !(Gyro && Btn9) and to (Btn9 && !Gyro). Your code doesn't really say which should go first or last, and really, you probably meant to set the Gyro global only once on that diagram. If you wanted an if/else, that is called a case statement.

Perhaps what you were wanting to do was to invert Gyro once when button 9 is pressed, regardless of how long it is held. That would be more like the attached. It says that if the button is now true, but in the last message was false, invert the variable Gyro (except I didn't use a variable but a label).

If you wanted something else, please describe the desired behavior thoroughly and I or someone else can show how to do it.

By the way, the node I used, the feedback node is a special variable with very tight scoping so that it works well in parallel environments. It is a wire. No, its a variable. Actually its a piece of diagram state data that guarantees one reader, one writer, and allows for initialization. A related entity is the shift register.

As for your urge to use variables. It is a necessary part of many nonfunctional languages since they have no other good way to transfer data. It may be useful to think of a wire as an unnamed variable that you assign on the upstream/left end and read from on the downstream/right ends. Again, it is guaranteed to have one writer each iteration, and not only does it deliver the value, but allows the downstream element to execute. Functional languages like portions of LV, are very different from procedural languages, and strange at first, but very powerful and often very simple once you understand a few concepts.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-03-22 at 6.51.24 PM.png
Views:	46
Size:	9.4 KB
ID:	12404  
Reply With Quote
  #5   Spotlight this post!  
Unread 29-03-2012, 00:52
blackflame2996's Avatar
blackflame2996 blackflame2996 is offline
Alumni
AKA: David Donahue
FRC #2996 (Cougars Gone Wired)
Team Role: Alumni
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Colorado springs, CO
Posts: 67
blackflame2996 is a name known to allblackflame2996 is a name known to allblackflame2996 is a name known to allblackflame2996 is a name known to allblackflame2996 is a name known to allblackflame2996 is a name known to all
Re: Variables, Cameras, and Wait

I agree, variables are not necessary in LabVIEW. there are very few things that cannot be done with wires and feedback nodes. their main application in our code is transferring info between two sub VI's where wires, for some reason, did not work.
__________________
2009 Regional Winners
2011 Regional Chairman's Award
2012 Regional Winners
2013 Regional Chairman's Award
Reply With Quote
  #6   Spotlight this post!  
Unread 29-03-2012, 00:55
blackflame2996's Avatar
blackflame2996 blackflame2996 is offline
Alumni
AKA: David Donahue
FRC #2996 (Cougars Gone Wired)
Team Role: Alumni
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Colorado springs, CO
Posts: 67
blackflame2996 is a name known to allblackflame2996 is a name known to allblackflame2996 is a name known to allblackflame2996 is a name known to allblackflame2996 is a name known to allblackflame2996 is a name known to all
Re: Variables, Cameras, and Wait

just extract it anywhere, all of the dependencies are in the folder. open the project, and build the exe to use the dashboard. sorry it took so long to respond, had a regional.
__________________
2009 Regional Winners
2011 Regional Chairman's Award
2012 Regional Winners
2013 Regional Chairman's Award
Reply With Quote
  #7   Spotlight this post!  
Unread 01-04-2012, 22:15
MAldridge's Avatar
MAldridge MAldridge is offline
Lead Programmer
AKA: Rube #1
FRC #0418 (LASA Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Austin
Posts: 117
MAldridge will become famous soon enoughMAldridge will become famous soon enough
Re: Variables, Cameras, and Wait

This is my solution to the toggle (see attached). At some point, I will do a write up on the advantages of doing it this way. Essentially, you put 'Grand Unified Button Handler' in your periodic tasks in a 15Hz loop and read your joysticks into it there; then you pull the outputs into a global and read the global wherever you need it. In the GRUB main vi, there is a control labeled 'latched?' you set which ones are latchable and then you set current as default, that way you can quickly change a button from latching to non-latching without rewriting large sections of code.
Attached Files
File Type: zip GRUB.zip (71.7 KB, 6 views)
__________________
'Why are you a programer?' --Team Captain
'Because the robot isn't complicated enough!' --Me
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


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

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