LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Changing Variables in Case Structure?

Solved!
Go to solution

Hi all,

 

I have a case structure. Based on whether the case is t/f I would like to change the value of two variables. If I put the two variables in the true part of the case strcture they can't be in the false part. How would I assign them values outside of the case structure? Could I refer to them numeorus times in the different cases? Thanks.

0 Kudos
Message 1 of 8
(490 Views)

Couldn't you simply assign the values inside the structure, and put the variables outside to the right?

Im afraid im not 100% sure what you are asking.

 

Like this?Untitled.png

0 Kudos
Message 2 of 8
(487 Views)

lab.png

Here's the part of the code. Basically I have 4 values. I then compare two in order to determine which values to use. Should for example the value on left be greater, I want to write the two left values to a pair of vairables. Should the value on the right be greater I wish to write the two values on the right to the pair of vairables mentioned previously. I tried writing them in a case structure but I couldn't put the variables in both the true and false part of the case structure. 

0 Kudos
Message 3 of 8
(482 Views)
Highlighted

Bascially I would like to say in pseudo code if the four top values are w/x and y/z and the two new values are a/b

 

if w > y

a = w

b = x

if y > w

a = y

b = z

0 Kudos
Message 4 of 8
(470 Views)
Solution
Accepted by topic author JustinC
08-27-2015 04:09 PM

So something like this?


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 5 of 8
(465 Views)

Yes! Exactly what I was looking for. Thnaks!

0 Kudos
Message 6 of 8
(460 Views)

Crap, crossrulz just barely beat me to it...

0 Kudos
Message 7 of 8
(455 Views)

@NateTheGreat wrote:

Crap, crossrulz just barely beat me to it...


Yeah, I'm having fun this week.  Altenbach normally just beats me.  But he's busy having fun at NI Week and so I manage to get solutions in.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 8 of 8
(453 Views)