From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure based on a parameter

Solved!
Go to solution

Hi everybody!

 

So I was wondering if we could create a case in a case structure, that's based on a parameter.

 

So here is what I mean:

I have a case structure inside a for loop (i=0,..,N-1). I would like for the case structure to have 3 cases: default, i=0 and i=N-1.

The problem is that N can change from time to time. It is not a fixed value.

 

Therefore, is it possible to create a case that's litterally "N-1" ?

 

 

Thanks in advance!! 🙂

 

Valentine

0 Kudos
Message 1 of 4
(2,368 Views)
Solution
Accepted by topic author VGans

No.

 

But why couldn't you put the N into the equation that determines which case to run.  You do the calcualtions and comparisons in the code leading up to the selector terminal.

0 Kudos
Message 2 of 4
(2,354 Views)

Thanks I didn't even think about that. So stupid! 😄

 

Thanks a lot! 🙂

0 Kudos
Message 3 of 4
(2,351 Views)

Maybe something like this:

 

N.JPG

0 Kudos
Message 4 of 4
(2,348 Views)