05-24-2024 11:33 PM
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.
Solved! Go to Solution.
05-25-2024 05:00 AM
Hello,
1. Why do you use two loops?
2. Look at the "In Range and Coerce" function, it can help you.
05-25-2024 06:16 PM
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.
05-25-2024 06:46 PM
05-26-2024 02:32 AM
@altenbach wrote:
See if this can give you some ideas....
I really like how you explain in one post and then give some example code to build on. 🙂
05-26-2024 11:40 AM
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! 😄
05-26-2024 08:13 PM
thanks a lot for your suggestion. I will try it out as soon as possible.
05-26-2024 08:20 PM
I will take note of this experience and strive not to repeat the same mistake in the future. Thanks for helping me 😆
05-26-2024 08:21 PM
Thanks! I will try it out later
05-27-2024 01:53 AM
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 ?