ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

format string control

I want to set my String Control to only input numbers betwwen a certain range, lets say its a ip number then I would like to use 4 string controlls for each of the parts of the ip adress and the user could only put values between 0-255. When a 3 digit number is written is it possible to set the focus to the next part of the ip adress?

 

/Tudor

0 Kudos
Message 1 of 4
(3,200 Views)

Have a look at the attached BI.

 

The numeric controls are U16 set to a range of 0 to 255 except for the first numeric which is from 1 to 255.

 

R

 

EDIT:  I'll work on the key focus portion..  You want to move to the next box as soon as 3 digits are entered... When number less than 3 are entered, will the operator use the Tab key to go to the next field or use the Enter key?  How should that function?

Message Edited by JoeLabView on 09-15-2008 08:34 AM
Message 2 of 4
(3,194 Views)

Tab key for movement to the next field is good

0 Kudos
Message 3 of 4
(3,189 Views)

Try the attached VI.  You can use Tab key or decimal point.

 

Code was written quickly, and didn't have time to clean up.  (busy day)

 

If you enter a number beyond 255 it will coherse it to 255.

 

Hope it works for you. 

 

R

Message 4 of 4
(3,153 Views)