Go to Post ...It's two years old, but GP is GP. - Brandon Martus [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 08-02-2011, 17:48
siggy2xc siggy2xc is offline
Registered User
AKA: Tyler Siegrist
FRC #1756 (Argos)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2009
Location: peoria
Posts: 70
siggy2xc is an unknown quantity at this point
3 outputs for 2 booleans

I have 2 booleans and would like to be able to use 4 different case structures depending on which are pressed.

False, False
True, False
False, True
True, True

What would be the best way to do this?
Reply With Quote
  #2   Spotlight this post!  
Unread 08-02-2011, 17:57
Wicked Wicked is offline
Registered User
FRC #0354 (G-House Pirates)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: New York
Posts: 46
Wicked is an unknown quantity at this point
Re: 3 outputs for 2 booleans

You might be able to use some combination of the Boolean functions in the palette to do this.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-02-2011, 21:34
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,713
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: 3 outputs for 2 booleans

Just nest one Case statement within another one.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #4   Spotlight this post!  
Unread 08-02-2011, 23:31
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: 3 outputs for 2 booleans

Thats the hard to understand way. The easy way to do it is to build an array (Build Array) and then put that array into a number (Boolean Array to Number) then put that number into a case structure (that will change the true/false selector to a 0, Default/1 selector). Now it helps to know binary at this point. You right click the selector and add a case after. Do this until you have 4 cases (0, Default; 1; 2; and 3). If both booleans are off the case is 0 (false, false). If boolean 1 is on and 2 is off the case is 1 (true, false). If boolean 2 is on and 1 is off the case is 2 (false, true). If both are on the case is 3 (true, true). See the attached picture for wiring.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	26
Size:	7.7 KB
ID:	10034  
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #5   Spotlight this post!  
Unread 09-02-2011, 00:26
siggy2xc siggy2xc is offline
Registered User
AKA: Tyler Siegrist
FRC #1756 (Argos)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2009
Location: peoria
Posts: 70
siggy2xc is an unknown quantity at this point
Re: 3 outputs for 2 booleans

Thanks j.cole! saves me a lot of time
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 08: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