LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone please help me figure out this enum problem (My code is a lot simpler than the previous one I posted)?

Solved!
Go to solution

@GRCK5000 wrote:

Note: I do not want to add case 3.


Why the aversion to adding 3 or your case 2?  That would meet your requirement.  Is there another situation where you need the "3" case?  What would the exact logic be for selecting the cases?  Do you just want the maximum of the two "enum" values?


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 11 of 19
(1,185 Views)

Hi,

you don`t want to add (3) to you case , you want to keep the same structure , you could change the case (2) as your default case. and when the result is (3) it goes to your default case.

Best Regards.

0 Kudos
Message 12 of 19
(1,180 Views)

This is just a portion of the code I am working on. I have an extremely large code with 4 enums. What I am describing here is basically what I am trying to do with these 4 enums. By adding more case structures, I feel like my code will be way larger than it already is. 

Note: Each of these 4 enums have 12 items (Numbers from 1 to 12). 

 

I know there is a condition to force it to go to case 2 and I am still trying figure it out. 

0 Kudos
Message 13 of 19
(1,171 Views)

Okay, let's say I change case 2 to default and keep Enum I input 1 as shown below:

GRCK5000_0-1651678580616.png

Then I change Enum II input to 2 as shown below:

GRCK5000_1-1651678640109.png

I click on highlight execution, the run. Then VI. Yes, it will go to case 2 because it's the default case. 

Now here is the problem, while it's running. I change Enum I input to 0. Now instead of going to 0 case., it will remain in the case 2 structure. I would like to go to 0 if I change input  to 0.

 

 

 

0 Kudos
Message 14 of 19
(1,167 Views)
Solution
Accepted by topic author GRCK5000

@GRCK5000 wrote:

By adding more case structures, I feel like my code will be way larger than it already is. 

Note: Each of these 4 enums have 12 items (Numbers from 1 to 12).


Nobody said anything about adding more case structures.  We are recommending you add to the condition that you currently have for case 2.

 

So you have 4 enums with 12 elements each.  Do you have a list of values and what cases you want called in every combination?  Or a simplified logic that we could program up?


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 15 of 19
(1,167 Views)

I am telling you, crossrulz. You'll never believe how big my code is. It's ridiculous.  I am still trying to figure the best way to make it small. It's been a struggle, I won't lie. Also, I am more of a visual learner. Maybe you can post a code. Maybe it will help me better understand what you mean.

0 Kudos
Message 16 of 19
(1,164 Views)
Solution
Accepted by topic author GRCK5000

Hi,

adding (3) to your case is that what is mean :

Emna20_0-1651679272319.png

 

and for making the default case you should know all the possible combination depand on the input.

Message 17 of 19
(1,158 Views)

See. I am more of a visual learner. Now I learn something today. I didn't know I could do that with case structure. That's why I like this forum because of you guys. Thanks a lot crossrulz and Emna20. 

Thanks for being so patient with me. I thought you guys would just give up on me.

0 Kudos
Message 18 of 19
(1,148 Views)

For a deep dive into case structures, you can right-click on the border of any case structure and select "Help".  There's a LOT of stuff there.  (You can right-click on just about anything and get more detailed help in the same manner.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 19 of 19
(1,103 Views)