LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit digits on number entry

Solved!
Go to solution

I am in the process of writing a driver for some hardware and I am not sure how to do something.

There is a timing parameter that can a adjust a couple of different things, and the format of the string commnd looks like RDVALXXXXYY.

The string is build with 3 user controls, one is a menu ring that picks the "RDVAL" out of a list, the next one is a number control that has to be 4 digits long (no more, no less) and the last one is another number control that needs to be 2 digits long, no more, no less.

I could just make instructions that describes the fact that the numbers have to be a certain length, but I need a way to require the numerical control to only accept a 4 digit number (and a 2 digit number in the other case).Timing.JPG

0 Kudos
Message 1 of 7
(3,875 Views)
Solution
Accepted by topic author LarsUlrich

Configure your numeric controls as follow:

 

ProjectView001.png ProjectView002.png this max number is FFFF

 

ProjectView003.png

 

Do something similar for the 2 digits input

 

Ben64

 

 

 

 

 

 

 

 

Message 2 of 7
(3,868 Views)

Thanks for the tip, will that prevent it from being more than 4 digits though?  That looks like it only prevents it from being under 4 digits.

0 Kudos
Message 3 of 7
(3,862 Views)

woops my bad, the rest of your post must not have loaded when I posted a reply.

0 Kudos
Message 4 of 7
(3,860 Views)

The max value is wrong in my post, here are the settings you should use.  Ben64

 

ProjectView004.png

Message 5 of 7
(3,851 Views)

Hmmm, the max number has me a little confused.  If I don't want it to be more than 4 digits, shouldn't it be 9999?   Unless I am misunderstanding what the "max value" is...

0 Kudos
Message 6 of 7
(3,828 Views)

Do you want a 4 digit decimal string or a 4 digit hexadecimal string?  All the earlier posts were working in hexadecimal.  The max 4digit value would be FFFF which is 65535.  For a max 4 digit value in decimal, then it would be 9999.

Message 7 of 7
(3,825 Views)