LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to do this with case structure?

Essentially I want the case structure to do: If case1 = run OR case2 = run, do this, else do case3++

 

I'm using a string case structure right now, where for example, the inputs could be SWEEP_A or SWEEP_B but I want the case structure to use case SWEEPAorB. This is so I can have different names for the input string BUT run the same case (this is to avoid redundant code for what I'm doing).

 

Thanks.

 

 

 

0 Kudos
Message 1 of 8
(2,950 Views)

Do your boolean comparisons before the case structure with and OR, then have 2 cases, a True and a False,

 

The case structure can also run on multiple conditions.  Just type them into the top with a comma between them.  I can't translate your "case1=run" terminology to anything.  But let's say a string = "A" Or a string = "B" and either way you want the same case 1 to run, then enter A, B into the selector at the top of case 1,  Use Default for the other case.

 

So in your situation use SWEEP_A, SWEEP_B IN CASE 1, and Default in Case 2.

0 Kudos
Message 2 of 8
(2,944 Views)

For more complex logic use can use create a boolean array and convert it to a number.

 

Case Selection Methods.png



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 8
(2,926 Views)

Type this into the case heading:

 

"SWEEP_A","SWEEP_B"

 

comma seperate the valid strings for this case.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 4 of 8
(2,893 Views)

Timmar is correct if I understand your post.  If you want Sweep_A or B to trigger the same case, separate them with a comma.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 5 of 8
(2,882 Views)

Timmar,  Moreesem

 

Isn't that what I said in message 2?

0 Kudos
Message 6 of 8
(2,878 Views)

RavensFan,

 

Yes, I guess

 

It took me 2 reads of your post before I figured out that you had said the same/similar thing.

 

I didn't recognise it without the quotes around the strings.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 7 of 8
(2,875 Views)

@Ravens Fan wrote:

Timmar,  Moreesem

 

Isn't that what I said in message 2?


Yes it is.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 8 of 8
(2,856 Views)