LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Significant digits not obeyed when value set through property nodes

Hi, I have a front panel with a large number of indicators on it. As updating each one is a very straight forward task, I am using the This.Panel.Controls array to step through and update each indicator appropriatly. The problem is, that because I have so many indicators, and the actual numbers aren't that important (they are also being logged elsewhere) I only wish to have 4 significant digits displayed so that the value fits into the size of the indicator. I set each indicator to have a display format of %_4f, but when I run it this is not obeyed and 7+ digits are displayed. I'm guessing this has something to do with updating the controls via the property node, but I'm not sure why that should cause an issue. Any ideas?

0 Kudos
Message 1 of 8
(3,360 Views)

Can you show us some code that demonstrates the problem?

 

What is the range of your numbers? If they are over 9999, there will be trailing zeroes of course.

 

Are you confusing "significant digits" with "digits of precision"?

 

Try using a g or e format, maybe?

Message Edited by altenbach on 12-16-2009 12:59 PM
0 Kudos
Message 2 of 8
(3,354 Views)
Any chance you typed %4_f for the format?
0 Kudos
Message 3 of 8
(3,343 Views)

Nope, I double checked the format string. I do mean significant digits by the way. My imput values are expected to be in the range 0-100 but I've sized my indicators to fit only 4 digits, which will give me at worst a 0.1% error over the full range, which is good enough. Right now the channels from which I am grabbing data are all disconnected, so I am just getting noise. I've attached images of both the format string I'm using, the relavent part of my code where I update values, and an example of the output I get. Thanks,

 

Jon

Download All
0 Kudos
Message 4 of 8
(3,334 Views)

Well, now I've tried creating an example to reproduce this porblem using a single indicator, but I'm not getting it there with the exact smae setup. Now I really have no clue what's going on.

 

Jon

0 Kudos
Message 5 of 8
(3,325 Views)

Those leading zeros are not significant, it appears from your screenshot that you are indeed getting 4 significant digits.  If you expect values from 0-100 I suggest you double check your scaling.

 

If you want 0.001 for example, you need four digits of precision.

0 Kudos
Message 6 of 8
(3,321 Views)

Ah yup that makes sense now. Anywyas, like I said, everything is offline, so 0 is okay for now since it's just noise on our lines. Thanks for the help though, I feel quite dumb right now but at least things aren't broken.

 

Jon

0 Kudos
Message 7 of 8
(3,312 Views)
Just remember, only a mediocre man is always at his best.  Smiley Wink
0 Kudos
Message 8 of 8
(3,303 Views)