04-23-2010 03:24 AM
A case structure is nothing more than a select for more than two possible options.
You have to select between two items --> use the comparison--> select
You have to select betwenn more than 2 items --> use a case structure with a numeric value as selector.
compared to C it´s similar to use if/else or switch/case .
I my post above, you can download the VI snippets (drag into a block diagram of LV 2009 - When using IE drag and drop, when using Firefox, save as on desktop and then drag/drop)
04-23-2010 03:42 AM
To GerdW
And how to control the four digital inputs through one numeric input
04-23-2010 03:46 AM
04-23-2010 03:51 AM
I mean the decision inputs. which will be 1-4 numeric values and the control input of the select function are also 4 but boolean so how to use them.
04-23-2010 03:52 AM - edited 04-23-2010 03:54 AM
Hi Intelligent,
don't you have one selector input, which allows several values?
The easiest way to get a boolean value is by using a comparison function like "Input==1". Or how is it done in C?
As already said in message #8: "all you need is 4 Selects, 4 comparisons and a default constant". Please read answers you have been given carefully!
04-23-2010 04:05 AM - edited 04-23-2010 04:07 AM
Hi intelligent,
you´re now talking about 4 values and 4 (corresponding) selectors?
In your first post you asked for a 2-bit-multiplexer, now you have a 4-bit?
Independant if you have two or for bits:
You can build an array of Boolans, then convert the boolean array to a number and use this number as selector for a case structure.
You´ll find more hints under:
LabVIEW menu -> Help-> Example Finder -> Fundamelntals--> "Numeric and Boolean" and "Array and Cluster"
Or try GerdW ´s version with the 4 select and so on...
04-23-2010 04:07 AM
04-23-2010 04:13 AM
hi SK@NIG
i was questioning to the solution provided by GerdW
04-23-2010 04:17 AM
Hi Intelligent,
"not be limited of using the comparison (equal to) parameter"
You want to select an output value according to a parameter. So you have to compare that value! You could do the comparison by using functions from the comparison palette or let a Case structure do that for you or use an IndexArray to do so... They all do some comparison!
04-23-2010 04:20 AM