Go to Post IRI: where egos go to die...uhm..I mean fly! - Koko Ed [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 13-01-2009, 09:28
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: More than boolean Case Structure...

There are a couple ways of transitioning from a set of Booleans to logic decisions.

First, you can nest lots and lots of cases. LV doesn't have if/elses, but a Boolean case is pretty similar. Honestly, this is the hardest to read or modify, but it is an option.

Second, you can make an array of Booleans. Because the buttons are initially returned in a cluster, you can easily convert them to an array. Go either the array of cluster palette on the diagram, and there will be a bullet shaped node with [] and a vertical set of boxes.

If you only care about one button, many people will simply search the array for True, then switch on the numeric index returned from search. -1 means no bottons, 0 means at least first button pressed, etc.

If you care about combinations, most people will convert this array of Booleans to a number. It is in the Numeric>>Conversion palette. This will give you a 12 bit number storing all 4096 combinations. You can switch from the number and start filling in cases. You can add a new case diagram for some new code. You can then change the numbers that will activate that case by clicking on the text and typing into it. To run on multiple buttons, use either .. or ,s, for example [1, 4, 8] lists three independent numbers, [0..1024] is the short way of doing all numbers in between and including, and you can mix them too such as [0, 4..8]. Unfortunately, you cannot display the case in hex, so you will be doing the math conversions in your head, no problem right?

Greg McKaskle
Reply With Quote
 


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
CRio more than nationals lenny8 FRC Control System 6 16-11-2008 12:33
More than One Regional? smurfgirl Regional Competitions 35 26-03-2008 14:21
More than 1 autonomos... Jimmy_Team7011 Programming 5 16-03-2008 15:33
more than 4 ir controls? Vanquish Programming 2 12-01-2008 14:52
Robowarriors: More visited than CD! Tim Arnold General Forum 11 26-10-2007 11:54


All times are GMT -5. The time now is 18:06.

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