LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3 conditions

Solved!
Go to solution

I have a fairly simple task to do but for some reason I can't get it to work. I'm sure it's a very simple fix but I've been stuck on it for a while now so I thought I'd come to you guys for help. Basically what I have is an "average" temperature and I have 4 temperatures being read. I want to have a string indicator show whether the incoming temperature is cold, hot, or the perfect temperature. Being the perfect temperature will result in a blank string. This is part of a much larger VI, so I just made a quick replica of it and isolated it so that it is easier to see by you guys. My initial thought was to nest two select functions for each temperature but I can't get the results that I'm looking for. Thanks in advance! 

0 Kudos
Message 1 of 14
(3,882 Views)

With the description based on the average temperature, simply wire the average temperature to a case structure (3 cases representing the temperature ranges for each).

0 Kudos
Message 2 of 14
(3,875 Views)

@pjr1121 wrote:

With the description based on the average temperature, simply wire the average temperature to a case structure (3 cases representing the temperature ranges for each).


Wire the average temperature to a case structure how? What gets wired into the case selector terminal?

0 Kudos
Message 3 of 14
(3,865 Views)
The average temperature, as already stated. I would suggest that you use integer values for the case statement and temperature.
0 Kudos
Message 4 of 14
(3,851 Views)

Something like this

Capture.PNG

...1 is cold, 2..7 is null


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 14
(3,845 Views)

@JÞB wrote:

Something like this

Capture.PNG

...1 is cold, 2..7 is null


The way that the larger VI works is that there is a maximum temperature and a minimum temperature which are input. These two temperatures are averaged out and that's why I have a local variable for average instead of just wiring a constant. I was just using the random number generators to simulate the logic so I don't think that a case structure would work in this case, or at least not in the way you showed. I apologize for the mixup. I just thought that it would be doable with the select function just wired in a different way that I hadn't thought of so I didn't think to explain the rest of the VI.

0 Kudos
Message 6 of 14
(3,840 Views)

@jmejiagusmer wrote:

The way that the larger VI works is that there is a maximum temperature and a minimum temperature which are input. These two temperatures are averaged out and that's why I have a local variable for average instead of just wiring a constant.


 

Are you saying the cut-off values for the Cold, Null, and Hot ranges are varaible based on user input?

0 Kudos
Message 7 of 14
(3,831 Views)

What's wrong with using the Select function that you already have in your VI?  You just have your "Cold" and Empty String swapped.

 

Alternatively, you could subtract the Average from the actual values and then wire the result into the case selector.  Negative values will be too cold, positive too hot, and 0 just right.


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 8 of 14
(3,806 Views)

@crossrulz wrote:

What's wrong with using the Select function that you already have in your VI?  You just have your "Cold" and Empty String swapped.

 

Alternatively, you could subtract the Average from the actual values and then wire the result into the case selector.  Negative values will be too cold, positive too hot, and 0 just right.


Nothing is wrong with the select functions. I just wasn't getting the logic correct and your suggestion seemed to have helped except that when the two numbers are very close, I'm getting some strange results and I'm not sure why? I have included the updated VI and screenshots of the last run so that you can see what I mean. In this particular case, I am getting a boolean true when my exit temp 1 is 0.161412 and my average is 0.173414. I have no idea why this would give me a true when it's clearly false?? Since I know that the boolean is returning true when it should be returning false, this doesn't even have anything to do with the select functions. This appears like it would be a problem with either the greater than function or the boolean array? I am very confused with this result. 

 

Download All
0 Kudos
Message 9 of 14
(3,795 Views)

Here is a block diagram of a sub-vi I wrote to do what I think you want to do.

 

Use the output as a case sellector for Cold, Hot, and Just Right.

 

X-X-1-2-3.png

========================
=== Engineer Ambiguously ===
========================
Message 10 of 14
(3,784 Views)