Go to Post When it is so boring and slow on here in the summer it is funny how all of us just jump at something technical. - sanddrag [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, 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
  #2   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