12-05-2018 05:11 AM
Hello. I am using Labview 2014. I have a Numeric Control that user can write 1 or any positive number multiple of 8. Maximum 1024 is allowed. Therefore, available numbers could be 1, 8, 16, 24, .. , 1024. If the user enters any number not obeying this rule, the number should be automatically rounded to nearest of these allowed entries. I know that Numeric Control has increment and decrement option in proporties, which can also round to closest possible entry with a given constant step, however this doesnt match with my need since the user is allowed to write 1 too (it is not only multiples of 8). Could you please inform me about how can I make this kind of advanced data entry control and auto correction ? It would be nice if you can share an example VI which can perform this control.
12-05-2018 06:13 AM
Hi,
my first idea is something like this:
Regards
Kay
12-05-2018 06:15 AM
Sorry, the image is quite small. Please find the original one attached...
12-05-2018 06:18 AM
Use an enumerated type def. The list is discreet an known at Development time
12-05-2018 08:17 AM - edited 12-05-2018 08:36 AM
An enum will limit the operator to a discrete list of values to select from, but be aware that the value of an enum on the block diagram using the terminal will return the index of the selected value on the front panel.
The member items of an enum are entered as a list of strings for presentation on the front panel.
For example, an enum control selecting a value of '8' on the front panel would result in an output a value of '1' (one) from the block diagram terminal.
12-05-2018 08:33 AM
There are many ways to solve this -- it sort of depends on how much "fun with numbers" you want to have. Because I like numbers (I'm a card-carrying member of the MAA), I'd do the following:
Bob Schor
12-05-2018 08:43 AM
Of course, you can always type def this ring