From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric control - special data entry

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

 

0 Kudos
Message 1 of 6
(3,185 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,181 Views)

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.


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
Message 3 of 6
(3,134 Views)

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! 

0 Kudos
Message 4 of 6
(3,090 Views)

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

0 Kudos
Message 5 of 6
(3,078 Views)

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).


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
Message 6 of 6
(3,067 Views)