LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric control over many orders of magnitude

Solved!
Go to solution

Hi to all,

I'm trying to get a numeric control with a suitable addition for the order of magnitude.

For example, I have a frontpanel for an osziloscope, sometimes I sample over a few ns, sometimes some seconds, sometimes a few milivolts, sometimes several volts, who knows, right 😉
I was playing around with the units of numeric controls, but this doesn't quite fit my needs. I can change the prefix of a unit on runtime, e.g. from microseconds to seconds, but then I have to change the number as well, because on changing the prefix, the previous number is only muliplied by the according factor, e.g. by 1000, so 5 us become 5e-6 s. So changing the record length from the default value of 500ms to 100ns would require two klicks and typing, and instead I can just type '100e-9' which is good as well.

However, I would like to have an numeric control from 0 to 1000 combined with e.g. a dial knob for the prefix i.e. nano, micro, mili etc. and combine this values internaly, i.e. mulitplying accordingly. But I couldn't set the increment to "3 orders of magnitude" even with the log scale option.

I'm aware, I could use an enum with the according names and values, but thats not very satisfying.

 

So maybe the question would be: Is it possible to combine two numeric control, one or the value and one for the prefix, in a suitable and easy way? Or how do you handle numerical values over several orders of magnitude in a case like mine?

Thanks for your answers in advance,

Best,

bastlwastl

0 Kudos
Message 1 of 17
(4,293 Views)
Solution
Accepted by topic author bastlwastl

Display format == SI units

Capture.PNG

It helps in these situationsSmiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 17
(4,284 Views)
Why would an enum or a dial with text values not be satisfying? That is how an actual scope sets the vertical or horizontal ranges. You don't have an infinite number of settings that a numeric control would imply.
0 Kudos
Message 3 of 17
(4,274 Views)

I usually just use the SI notation in the display of my numerics.  Then you can see the prefix as part of the control.  You can actually type "1M" into any numeric control and the value will be 1,000,000.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 17
(4,267 Views)

Hi,

the display format in SI-units is nice, i didn't knew this. Thanks.

 

The "enum-solution" would require some kind of wrapping or extra code to get the correct value, and it will always be 2 objects. The "Display-format-solution" will give me the right value directly and it's only a single object, in case I want to change something programaticaly, like setting a readout value. Then code will get mesy when I have to distiguish between "single-object"-objects and "combined-object" where I have to respect to enum value etc.

Why complicated when it could be easy?

 

Thanks for your answers,

Best

bastlwastl

 

 

 

 

0 Kudos
Message 5 of 17
(4,246 Views)

@bastlwastl wrote:

Hi,</