LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
ChristopheC

A data entry parameter to specify if an integer can only be odd or even.

Status: Declined
This feature already exists in LabVIEW

It is not uncommon to have to restrict numeric entries to accept only either odd or even values. It would be nice to be able to specify that behavior, for example in the Data Entry tab of the Properties dialog, so we don't have to write some code to enforce that restriction, with the Response to value outside limits to either round up or down. This would apply to integers only.

 

8 Comments
JackDunaway
Trusted Enthusiast

Try this: adjust the Data Entry for your controls to have an increment of 2, and adjust the Maximum and Minimum values to be both odd or both even:

 

OddOrEvenInput.png

jcarmody
Trusted Enthusiast

 


@ChristopheC wrote:

It is not uncommon to have to restrict numeric entries to accept only either odd or even values. [...]

 


Really?  I'm curious about where this would be used.

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Broken_Arrow
Active Participant

jcarmody said:

Really?  I'm curious about where this would be used.

----------------------------------------------------------------------------------------------

 

It happens. What if you had several UUT's on test and the wiring harnesses were arranged so that the top shelf were wired to even inputs on a DAQ and the next shelf were odd. If you had a control to access one UUT on the second shelf, that control would be set to only accept odd numbers. Sorry for the verbose example, but that happened to me. However, I'm not sure it would be worth the extra noise on an already noisy Data Entry dialog box since the programmatic version is easy enough.

 

Richard






ChristopheC
Active Participant

Using the increment, as Jack suggested is just fine. You just have to set the correct default value, and not leave it to 0.

This one can be rejected.

 

Thanks.

Laura F.
Active Participant
Status changed to: Completed
 
G-Money
NI Employee (retired)
Status changed to: Completed
This feature already exists in LabVIEW
G-Money
NI Employee (retired)

I am changing the status from Completed to Declined because Completed should only be ideas that R&D see on Idea Exchange, actively developed on it based on the idea here, and it was added to the product.

G-Money
NI Employee (retired)
Status changed to: Declined
This feature already exists in LabVIEW