10-19-2015 07:50 AM
Hello!
I want into a numeric control to set up a special data entry value! For example: i have two numeric control colled (Min and Max); and i want to use a specific limit: the maximum value of "min" control to be less then "max" control value!
More accurate : the value range of "min/max" control :(0.1-16). min can have value between 0,1 and 16 but not more than max. mathematical : min=max-0.1.
Thanks for your time!
Marius
10-19-2015 07:54 AM
Hi Marius,
there are several functions available to solve your problem:
- In range and coerce
- MinMax
- comparision functions
And you can set the accepted input range for a numerical control via it's properties, manually and programmatically!
What exactly is your problem?
What have you tried so far?
10-19-2015 07:59 PM
Assuming we are talking about the GUI, I just use a property node to set the upper or lower limit of what can be entered. The properties you are looking for are Data Entry Limits->Minimum and Data Entry Limits->Maximum.
If we are talking about a subVI, I use the Max & Min function to sort the two values.
10-20-2015 04:05 PM - edited 10-20-2015 04:11 PM
Hello Gerd and Crossrulz!
Thank you for your advises. I don't have enough experience with the Labview; I tried, unfortunately, just limits from properties of numeric control(min and max + coercion).
Now, i know there are many possibilities.I used property node now, But can you tell me which of the following are optimized?
function :"min & max","in range coercion","comparison" or property node with "data entry limit"? Thank you very much!
Marius!
10-20-2015 04:28 PM
You asked about optimizing a method for setting up two Front Panel controls. Usually, when someone says "optimize", I assume they are asking "Which is fastest" or "Which uses less memory". In the current case, these are very silly questions to ask, as you are only going to update the Controls once (or, maybe twice), and if it takes 2 milliseconds instead of 2 microseconds, it won't matter to the execution of your program.
On the other hand, another meaning of "optimize" can be "Which method is easiest to understand, easiest to grasp, easiest to prove that it does what is intended"? I might argue that, for your example, this definition might be the most appropriate. I would urge you to choose a method that, when you glance at the Block Diagram, makes it obvious what is being done (without needing a Text Box to tell you).
Bob Schor
10-20-2015 06:20 PM
marius.lucian wrote: Now, i know there are many possibilities.I used property node now, But can you tell me which of the following are optimized?
Again, it depends on what you are trying to accomplish. Each of the functions you listed have different uses.
Since it sounds like you are just trying to limit what the user can put into a control, you want to use the Maximum and Minimum property nodes.
If you want to sort the two numbers, use Max & Min. If you want to make sure a value is between two numbers, use In Range & Coerce. Using a compison doesn't make any sense for comparing 3 numbers (usually don't with the In Range & Coerce).