02-19-2022 01:21 PM
Hello Community
I have a problem and i hope you can help to me.
I am a newbie for programming on labview.
Now i have a temperature measurement and i want show on a string display element if the degress is 0-30 celsius „water is cold“, if the degress is between 31-100 celsius the „water is hot“. If it's under 0 degress the „water it's iced“.
Do i need a case? how can i make this messages? i use daq assistant for read the degress. multiplication 100 for the degress in celsius.
thanks in advance.
Solved! Go to Solution.
02-19-2022 01:37 PM - edited 02-19-2022 02:20 PM
A very simple problem. Have you done some of the basic LabVIEW tutorials?
Maybe this old example can give you some ideas. I am sure you can modify it for your scenario.
02-19-2022 02:01 PM
There is more than one way to do what you want. I can think of at least two ways: using a case structure or using a select node.
1) Case structure. To use a case structure, first convert your temperature reading to an integer; the case structure can not use a float data type to select the case. Create a case for each range: frozen, cold, hot. Edit the selector label of each case to handle the range of interest. A range of values can be specified using the following syntax: "..x" is all values less than or equal to x, "x..y" is all values from x to y inclusive, and "y.." is all values greater than or equal to y.
2) Select node. Test the range of the temperature using condition nodes and select the string to display based on the result of the condition test.
02-19-2022 02:29 PM
An important consideration is scalability. My suggestion is fully scalable and can modified expanded at any time (different limits, different messages, more ranges, etc) by just changing some diagram constant.
The later suggestions will make maintenance and modifications a nightmare! Adding cases, adding conditions later, having the scalar strings scattered in different cases, makes expanding very difficult.
02-19-2022 03:43 PM
I agree that the solution posted by altenbach is more scalable. It is a more elegant, better solution.
02-19-2022 04:06 PM
Thank you! The problem is fixed.
Greetings