Go to Post Ahem......"where are the President's safety glasses???" - Travis Hoffman [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 31-03-2011, 21:41
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Same code, but one works, one doesnt.

Hi this is team 1514 and we just had one question. We were driving our robot on the practice field today and it worked perfectly fine in autonomus. The switches 1, 2, 3, 4 ,5. They all have the similar code but when it reaches the y it does different things. But number 1,2,3 do NOT work at all. But number 4, and 5 do work for some reason. Why might that be? i have attached a comparison of number 3 to number 5 in the file below: What is the difference between the code? Our bot can go straight and score but it would be nice to have the robot score left and right also.it would be great if it can be fixed by tomorrow before the game

Team 1514
Attached Files
File Type: doc Switch 3 code vs Switch 5 code.doc (885.5 KB, 19 views)
__________________
"A team back in training !"

Last edited by whcirobotics : 31-03-2011 at 22:17.
Reply With Quote
  #2   Spotlight this post!  
Unread 31-03-2011, 23:01
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Same code, but one works, one doesnt.

Saying they "do NOT work at all" doesn't help us know what to look for. Tell us what you expect them to do, and what they actually do.

I can't comfortably follow the code from the fragmented pictures you provided anyway. Can you post the actual vi instead?
Reply With Quote
  #3   Spotlight this post!  
Unread 31-03-2011, 23:15
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: Same code, but one works, one doesnt.

I mean that when the switch is set to 3, which is suppose go straight and then turn left to get out of the way, does nothing at all. The piston does not come up and the robot does not move. The vi was too big so i have removed the switches 1, and 2.
Attached Files
File Type: vi Autonomous Independent.vi (80.5 KB, 6 views)
__________________
"A team back in training !"
Reply With Quote
  #4   Spotlight this post!  
Unread 01-04-2011, 23:52
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Same code, but one works, one doesnt.

On the very far left side, you put the three switches into an array, and then did a boolean array to number conversion. That's probably what you want.. however, the output of a 3 input boolean array to number is going to be from 0-7, not 3-5; it's the binary number of the booleans. For five, the number would be from 0 to 2^5 -1 (31).

What you probably want to do is have the case structure run the switch 1 on 1, the switch 2 on 2, the switch 3 on 4, switch 4 on 8 and switch 5 on 16, and then have a "default" case where it does nothing or gives an error - that would mean that either >two or zero switches are pressed.

Also, it's kind of bad form to have so many case structures running off the same input and doing different things that work together, but you probably don't want to mess with that
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 20:40.

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