LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unit indicator is not updated in Numeric Control

Hi,

I observe the following problem in LabView 7.0: I have a numeric control with unit indicator. Depending on the value, the unit indicator should change its prefix (kilo,milli,etc.) and the displayed value is scaled accordingly. However, this does not work correctly: The value gets scaled, but the unit is not updated. I.e.,

1. value is 100 mm, display is 100, unit is mm
2. values is .01 mm, display is 10, unit is still mm, but should be µm!

More striking: The unit gets updated correctly once the user clicks on it (only an indicator!).

Any ideas?

Regards
Matthias
0 Kudos
Message 1 of 12
(3,957 Views)
Dear Matthais,

I think, value in the control gets scaled when u change the unit in the unit string, but not the unit when u change the value in the control.

So if u need to scale the value & the unit, u need to program by using convert unit function.

Morevoer unit gets updated correctly only once u click on it. this is ture. i also experienced the same results.

Hope it helps. Your feedbacks are welcome.

Best Regards,
Nirmal Sharma
0 Kudos
Message 2 of 12
(3,957 Views)
Hi,

from a physical point of view: A physical quantity is a number and a unit. I can convert the unit into any other compatible unit without losing information. I can express the length of my finger in inches, cm or km. The corresponding number changes, but the physical quantity stays the same.

The Numerical Indicator obviously tries to optimize the display of the physical quantity by choosing a suitable prefix of the unit. It correctly changes the number, but does not update the displayed unit string. Only, when I click it...

The value (the physical quantity) that I wire into the numerical indicator is always in mm, but when the value gets too small, like .01 mm, the numerical indicator decides to display it as 10 µm, which is correct of
course. Only that the indicator shows 10 mm.

Regards
Matthias
0 Kudos
Message 3 of 12
(3,957 Views)
Matthias,

I agree with you..but sometimes if its not natural then go for the programming.

I m attaching a vi which i feel suits to ur problem.

Regards,
Nirmal
0 Kudos
Message 4 of 12
(3,957 Views)
Hello,

When units are used with numerics in LabVIEW, the physical quantity is always in the base unit type (for length, the base unit is meters). If you ever see a case where .01 mm is displayed as 10 micrometers, this is a flaw in LabVIEW. (I haven't been able to reproduce it). If you can include an example where this happens, that would be great. However, it sounds like what is being wired is .01 meters, which is 10mm.
Also, there is an easy way to get the unit label to update as the value of the numeric changes. Click on the numeric control/indicator and select Properties... Then go to the "Format & Precision" tab and select "SI Notation" as the format. This will cause the unit label to use the SI prefixes when appropriate. Other comments a
ppreciated.
Shawn
0 Kudos
Message 5 of 12
(3,957 Views)
Hi,

I should have mentioned that I use the SI Notation in the indicator. So that is really a feature, not a bug.

But the prefix isn't updated correctly.

Matthias
0 Kudos
Message 6 of 12
(3,957 Views)
Hi Mattias,
It seems wrong that the prefix isn't updated. I'm probably missing something simple, but I haven't been able to reproduce this (the unit label always updates correctly when I try it.) If you can write a VI and describe the steps to reproduce this, I would be interested. Otherwise, I'll just keep my eye open for this. Thanks for posting it.
Shawn
0 Kudos
Message 7 of 12
(3,957 Views)
Hi Matthias,

As per shawn, i m able to update the unit with prefix when you change the number in the control by selecting SI Notation.

Thanx Shawn for updating my knowledge.

Nirmal
0 Kudos
Message 8 of 12
(3,957 Views)
Hi shawn, and all,

sorry for the delay, we had to observe a bank holiday in here in Germany :-).

So, I've extracted the interesting part from my program. Start the attached vi, and watch the increasing numbers in the indicators. The for loop that you see running continously increases the value from 0° to 5° in 500 steps. The indicator is supposed to present the value in mdeg (milli-degrees) up to 1°, and in deg afterwards. The number corresponds to that, the unit string is updated only when you click on the string!

Again, this is in LabView 7 Express.

Regards & one tera-thanks,

Matthias
0 Kudos
Message 9 of 12
(3,957 Views)
<>>

I see that, looks like a bug to me in version 7
0 Kudos
Message 10 of 12
(3,957 Views)