From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Temperature Conversion From Celsius to Fahrenheit

Hi Friends 

I Make a simple program in which temperature is converted from Celsius from Fahrenheit.

In this program I use Slide bar for Celsius temperature that is multiply by 1.8 and sum with 32. The result temperature which is Fahrenheit; displayed on temperature gauge with three LED for temperature information

I'm Abdullah, Student of Electrical Engineer

Screenshot 2022-01-19 223041.jpgScreenshot 2022-01-19 223002.jpg 

0 Kudos
Message 1 of 5
(1,859 Views)

H Abdullah,

 


@Abdullah2133 wrote:

I Make a simple program in which temperature is converted from Celsius from Fahrenheit. 


Is there a specific problem with your VI?

 

Why don't you use the digital display of the gauge indicator (to avoid two indicators for the very same value)? (The same applies to the "T in °C" control...)

Why don't you use the InRangeAndCoerce function to test for a certain range?

Why don't you use an array approach to test for your 3 temperatur ranges instead of implementing 3 individual comparison checks?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,852 Views)
  • Do you have a question?
  • Does the program work the way you like?
  • Are you looking for feedback and suggestions?

 

(Sorry, I cannot open your VI because I don't have access to LabVIEW 2021. Consider "save for previous" to get a wider audience.)

 

Some questions and suggestions:

 

  • Is this a subVI (connectors assigned etc.) or a toplevel VI?
  • If it is a toplevel VI, why isn't there a toplevel loop with a small wait (or event structure?)
  • What do you expect to happen to the LEDs if the temperature is exactly 50 or 130?
  • I would use a radiobutton indicator as container for the LEDs. Try it!
  • Yes, use the digital display of the Meter instead of yet another indicator.
  • You can probably eliminate all comparisons by thresholding into an array of limits, then wire to the radiobutton indicator.
  • ...
0 Kudos
Message 3 of 5
(1,838 Views)

Just to give you some ideas, here's my version. Arguably less complicated :D:

 

altenbach_0-1642618658163.png

 

 

Note that there are a few tricks that you should learn how to do:

 

  • The radiobutton container is transparent
  • The meter uses a custom scale
  • The digital displays use a custom format
  • I use captions on the front panel (to be more wordy while keeping the labels short on the diagram)
  • etc.
0 Kudos
Message 4 of 5
(1,822 Views)

If you want it to be even "simpler", LabVIEW has built-in unit management.  On a floating point numeric control or indicator, show the unit label:

Kyle97330_0-1642622124724.png

Put in degrees C and degrees F, and your code is super simple, just a wire!

Kyle97330_1-1642622328906.png

Note that this does make a wire with a different data type (the wire is natively in Kelvin), so if you want to convert it to a normal float wire, you need to use the Convert Unit function:

Kyle97330_2-1642622570453.png

A lot of people don't like units because of the different data type wire issue, as it doesn't work well when trying to reuse subVIs across different unit wire types, but I find it pretty useful.  

Message 5 of 5
(1,794 Views)