LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use sig figs from one indicator to set digits on another

Could somebody tell me if this is possible. I have a VI (LabView 2010) which is counting randomly occurring events (using a PCIe 6321) and displaying an average event rate in a simple numeric indicator. Next door to that I have a numeric indicator displaying the uncertainty in the measured event rate (based on some simple math where the uncertainty is the square root of the number of events). Since the event rate is an average, it never changes per se, what it does is oscillate within some confidence interval, and the oscillations reduce as the experiment is run over a period of time. The uncertainty in this average quantity is an ever diminishing number which characterizes the extent of the oscillation.

 

What I would like to do is to restrict the number of significant figures on both the average event rate and the uncertainty. For the uncertainty that's easy, I'd like it to be 2 sig figs and I can do that by right clicking the indicator and going to 'Display Format'. However, what I thought would be a bit nifty is if the digits of precision of the event rate were dynamically adjusted by the precision of the uncertainty, to reflect that as the experiment wears on we can make increasingly precise claims about the measured event rate.

 

For example, suppose at some early stage I measure an event rate of 10.4365 and an uncertainty of 1.1. I'd like the event rate to display as 10.4. As I run the experiment for longer, the uncertainty might reduce to 0.11, in which case I'd like the event rate to display as 10.44. If even later the uncertainty was 0.011, then the event rate displays as 10.437. And so on. I had thought I might be able to do this with property nodes somehow, but suitable properties don't seem available. Ideas?

0 Kudos
Message 1 of 3
(2,450 Views)

I think the FormatStrings property may do what you want.  "_" specifies significant figures and "." specifies digits of precision.  Read the detailed help files for more information.

 

Lynn

 

sig figs.png

0 Kudos
Message 2 of 3
(2,445 Views)

Dear Lynn,

 

Thank you for your reply. It didn't quite solve the problem I was considering, but it put me on the right track. Essentially, the problem I was having was how get an answer to the question 'How many DP's are necessary to get 2 SF's?'. Trying to probe an indicator whose display format is Sig Figs with a property node only seems to yield the number of SFs, never the number of DPs needed to get there.

 

Anyway, the workaround I came up with was to use the 'Number to Engineering String' VI to take the value going into the indicator and turn it into a string in scientific notation. I then used the 'E' in the Engineering string as a token delimiter to break off the exponent, which I to determine the number of DPs. That coupled with the technique you highlighted to set the DPs on the second indicator gets the behaviour I wanted.

 

Thank you for your assistance

 

Regards

0 Kudos
Message 3 of 3
(2,423 Views)