LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"secret command" to avoid typing all cases in a Case structure to manage a true table

Solved!
Go to solution

The question is simple. I don't know if there is a command (similar to "..") to represent a group of cases of a true table into a "Case structure".

I attach an example in LV2011 in zip (it has been impossible to upload the vi!!)

 

Vicen

LabVIEW 2010/2011 with WinXP/10

 

Download All
0 Kudos
Message 1 of 8
(5,475 Views)

You could do this with VI scripting, but you'll have to weigh whether or not that's worth your time. It depends on how often you plan on doing this or how big your table will end up being.

 

This article may prove useful.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 8
(5,471 Views)
Solution
Accepted by topic author vicens

For the sitution where we only have a handful of booleans I like to cast as an enum to make it esy to decode the combinations.

 

CaseDrivenEnum.png

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 8
(5,456 Views)

@Ben wrote:

For the sitution where we only have a handful of booleans I like to cast as an enum to make it esy to decode the combinations. 

Ben


I like this. I am going to use this now.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 8
(5,448 Views)

Thank you, James and Ben. I'll work with these two possibilities.

Answering the question... I suppose there isn't a "magic command", is it?

 

Vicen

0 Kudos
Message 5 of 8
(5,445 Views)

Try ...

 

"First value in range" ... "last in range"

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 8
(5,440 Views)

@Ben wrote:

"First value in range" ... "last in range"


In this case, I think that would only work if he reversed the array.  Currently the "Do Not Care" are in the MSb.  Reverse the array and they go into the LSb, making the range for the case structure possible.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 8
(5,428 Views)

Here's an example of reversing the array and then using the range capability of the case structure.  The snippet has all of the cases configured if you want to use it.  Do note that I have not tested it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 8
(5,424 Views)