LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different messages on string Display

Solved!
Go to solution

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. 

 

0 Kudos
Message 1 of 6
(1,046 Views)
Solution
Accepted by topic author Bkay

 

A very simple problem. Have you done some of the basic LabVIEW tutorials?

 

  • No, you don't need a case structure (... but there are also solutions that use a case structure, of course).
  • You need to define the problem more exactly, for example what should happen if the temperature is 30.5C? What should happen if the temperature is >100C (it is possible to have superheated water!)
  • You have a limited set of messages (3), so write them once into a string array diagram constant and index into it based on temperature, then wire the element to the string indicator.

 

Maybe this old example can give you some ideas. I am sure you can modify it for your scenario.

 

altenbach_0-1628613650226.png

0 Kudos
Message 2 of 6
(1,035 Views)

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.

cbfsystems_0-1645300786309.png

cbfsystems_1-1645300810643.png

cbfsystems_2-1645300826091.png

 

 

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.

cbfsystems_3-1645300856059.png

 

0 Kudos
Message 3 of 6
(1,018 Views)

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.

0 Kudos
Message 4 of 6
(998 Views)

I agree that the solution posted by altenbach is more scalable.  It is a more elegant, better solution.

0 Kudos
Message 5 of 6
(981 Views)

Thank you! The problem is fixed.

 

Greetings

0 Kudos
Message 6 of 6
(964 Views)