SGL with temperature degC or degF do not correctly display values -9, -8, ... -1, 0, 1, ..., 9. For example, when input 1, it displays 0.999994; input 2, it displays 1.99999 .... Attatched is a test VI (LabVIEW 7.0 and 7.1). Could anybody give an explanation?. Thanks,
Right-click on each, --> "format and precision" and select - floating point - 2 digits of precision (or whatever the quality of your data is, i doubt it is microdegrees) - unselect "hide trailing zeroes" if desired.
(A SGL number is rather inaccurate, and e.g. "1" cannot be represented exactly in binary with the number of bits used for the mantissa.)
My guess is that display routines (that display a number in an indicator) are DBL regardless of the type of the control. For 0 degC(SGL) the displayed value -6,10352E-6 is the result of 273.15(DBL) - 273.15(SGL)
The internal value 273.15(SGL) is probably promoted to DBL with single precision (zero padding in the mantissa) and the is substracted 273.15(DBL) for display, resulting -6,10352E-6.
Thanks a lot, Jean-Pierre. From what you posted above, I am quite sure that it is a defect of the conversion routine for the temperature unit. The reference temperature for degC (273.15) and/or degF is stored internally as a DBL. 273.15(SGL) - 273.15(DBL) = -6.10352E-6; 274.15(SGL) - 273.15(DBL) = 0.999994; ...... To solve this problem, there should be two reference temperatures, 273.15(DBL) and 273.15(SGL), for DBL and SGL with temperature unit respectively.