LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combine 2 while loops using OR

Solved!
Go to solution

Hello everyone, I am new to LabVIEW and I am currently working on a project. As you can see there are 2 different while loops containing information for thermocouples 1 and 4 with different conditions to fulfill. For thermocouple 1, the temperature must not go beyond 15 Degree Celsius and below -105 degrees celsius. On the other hand, for thermocouple 4 the temperature must not go beyond 80 degrees celsius and -40 degrees celsius. I am planning to use the OR function to combine the condition inside the 2 while loops, However, if i were to do so, the too-cold boolean LED function would not light up. I am not sure what is wrong with the logic here. 

Screenshot 2024-05-25 124116.png

0 Kudos
Message 1 of 34
(730 Views)

Hello,
1. Why do you use two loops?
2. Look at the "In Range and Coerce" function, it can help you.

0 Kudos
Message 2 of 34
(696 Views)

Make your code scalable! Build an array of results and compare with an array of ranges, all in one single loop. You can use "OR array elements" to trigger if at least one of the probes is out of range and act accordingly.

 

Also, instead of manipulating boolean colors with property nodes, use colorboxes instead

 

There is also the "in range and coerce" function to simplify your Rube Goldberg comparisons. However, you might just want to threshold into a range of levels and index into an array of colors.

 

If you want help, attach your VI. We cannot operate on pictures.

0 Kudos
Message 3 of 34
(671 Views)
Solution
Accepted by topic author plssendhelp1506

See if this can give you some ideas....

 

altenbach_0-1716680736234.png

 

Message 4 of 34
(664 Views)

@altenbach wrote:

See if this can give you some ideas....

 

altenbach_0-1716680736234.png

 


I really like how you explain in one post and then give some example code to build on.  🙂

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.
0 Kudos
Message 5 of 34
(642 Views)

Just some weekend Fingerübungen. 😄

 

This thread is a classic example of asking the wrong questions, basically telling us how it must be done ("combine 2 while loops using OR"???)  instead of what the requirements are. ("Show one of three colors based on temperature reading (low, good, high)" for multiple temperature sensors).

 

To be honest, even after almost 30 years of LabVIEW programming, I still don't know how to "combine 2 while loops using OR". I don't even know what that means! 😄

 

 

0 Kudos
Message 6 of 34
(621 Views)

thanks a lot for your suggestion. I will try it out as soon as possible. 

0 Kudos
Message 7 of 34
(609 Views)

I will take note of this experience and strive not to repeat the same mistake in the future. Thanks for helping me 😆 

 

0 Kudos
Message 8 of 34
(607 Views)

Thanks! I will try it out later 

0 Kudos
Message 9 of 34
(606 Views)

Hello everyone, I did some modification but I am still facing a little issue here. By right when the thermocouple 1 and 4 reaches 200 degree celsius it is supposed to be in red colour but over here it turn green instead. I am not sure what is wrong here....also is it workable to insert PID controller here ? 

Screenshot 2024-05-27 144101.png

0 Kudos
Message 10 of 34
(587 Views)