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,295 Views)
Solution
Accepted by 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,286 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,276 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,269 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,248 Views)

@bastlwastl wrote:

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

 

 

 

 


"Simple" and "complicated" depends on who you ask.  😉

 

For someone more used to using an O-scope than fooling around with a computer, having a front panel that reminds them of the instrument they are used to using is a lot simpler than trying to enter numbers into a box.  The more you make it look like the instrument it is emulating, the simpler the learning curve.  Indeed, I've used front panels that were so close to the real instrument that I didn't even have to think twice about what I was doing.  I didn't need anyone to explain to me what each know did.

 

Developers sometimes forget who they are developing for.

 

Besides, you'll have to generate extra code to weed out invalid values - like, say, negative numbers - anyway.

 

[edit] even if it is an engineering tool, give some thought to the front panel.  You never know when it is going to become a full-fledged application. [/edit]

 

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 17
(4,243 Views)

@billko wrote:

"Simple" and "complicated" depends on who you ask.  😉



Definitly 😉

 

Limits are set rather easily on the numeric control itself, but i couldn't handle the orders of magnitude.

 

But it brings me back to the initial problem, that i can't set the increment of a numeric control to "1 order of magnitude", right? For example, if the user must chose between 1, 10 and 100ms for whatever, I must use an enum? Unsatifying, if i wan't to imitate the look of an instrument, which might be a knob. What can i do then?

 

Best,

bastlwastl

0 Kudos
Message 7 of 17
(4,232 Views)

Log Scale on the knob!

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 17
(4,228 Views)

But then e.g. 2ms is possible if I use an increment of 1ms. But i wan't to restrict the values to 1, 10 and 100.  Or is the increment then logaritmic as well?

0 Kudos
Message 9 of 17
(4,223 Views)
The values on a knob can be anything you want with text labels. The actual numeric value would not be displayed at all. The data type of the knob should be an integer.
0 Kudos
Message 10 of 17
(4,218 Views)