LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

determine STRING CONTROL

Hi all:

 

How can I determine or to limit  STRING CONTROL to 20 characters only , not allowing more than that

 

thanks  

0 Kudos
Message 1 of 4
(2,496 Views)
There is no default method to do this. The only thing you can do is to limit the control to one line; that means that pressing enter after entering some symbols will leave the control and pass the symbols as new string to the VI.
So you have to solve this within your application. But i want to suggest something else:
It is most often the best to let the user choose between settings than to let him enter some setting "freely". This can lead to mistyping => unhappy to use.....

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(2,492 Views)

You have to use the String Subset primitive to achieve what you need. Smiley Happy

In addition, you have to check the options 'Limit to single line' & Update string while typing' from the rt-click short-cut menu of the string control.

See the attached VI.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 3 of 4
(2,485 Views)
Here is one example that shows how to implement this in your code. The Update Value while Typing option of the string control must be set.
0 Kudos
Message 4 of 4
(2,483 Views)