LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Text charcter restriction

Hello
 
I want to restrict the user to enter only 4 character in the String control. if it is possible,  Kindly give the VI or which property have to be used for this issue.
 
Thanks in advance
Karthikraja
0 Kudos
Message 1 of 7
(3,228 Views)

Hi Karthik raja,

The simplest method i could think was this.

Do a check for string length and report if it is greater than 4 chartacters.

look at attached VI

regards

Dev

 

 

Message 2 of 7
(3,222 Views)
Just a quick modification to Devchander vi, with the updateWhileTyping property enabled, and a boolean to select between a lock-to-4 or replace mode.
Chilly Charly    (aka CC)
Message 3 of 7
(3,208 Views)

Hello

I am having around 140 text control. i want to restrict the user to enter only 4 char in each control. Is there any optimum control.herewith i am attaching my VI, i need to get the concatneted string from submode 1, and submode2 ..upto submode 8.

after that i will write into 1 file for each mode as concatnated string. then i will read from file, i will send to Alpha Numeric LCD using DO lines og 6014 . Kindly help to get one optimum solution.

thanks in advance

Karthikraja

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

That is a lot of strings and I wonder if there might be some better ways to do what you are trying to do.  I would look at the very least into sub panels where each tab would just be a different panel.  Then you could place the same VI in each panel, so you only have a small amount of code.

Another idea would be to use text rings.  If you know what all the valid strings are then the easiest thing would be to insert all those strings into a text ring.  You can then replace all your strings with rings and configure them to not allow undefined values, therefore just the 4 character values you have specified will every be entered.

 

Now onto another solution.  I have attached something that is complex but gets the job done.  A big downside is that it takes a little while to initialize.  So run the attached VI and wait until it actually reaches your loop.  From that point on you will have the behavior you want.  I really just put it together for fun, and can explain it if you want.  It utilizes some user events and dynamic events in a VIT...

0 Kudos
Message 5 of 7
(3,155 Views)

Hai all

unfortunately i am having the LabVIEW 7.1, i am unable to open the Code sent by you. Kindly send once again for the LV7.1.                       

I just explain my application for simplyfying the code.

There are 6 main modes, Each main mode has 8 sub mode. (totally 48 modes).There are 54 DIO peripherals such as LED,Switch, ...etc. Around the Display, it was hard cored. So on the LCD screen, its caption will be there. Each mode has unique name for peripheral. I have to collect the name from the user for 48 modes and display it on the LCDscreen.

If any easy and Optimal solution is available, kindly send ASAP.

Thanks and Regards,

Karthikraja

 

 

0 Kudos
Message 6 of 7
(3,135 Views)
You might consider using an activeX version of the textbox such as the MS forms2.0 TextBox which has a max character length property built into it.  This could complicate things if you are doing event driven programming because you would have lots of callback functions but if you goal is a report generator or some sort of form it will not be an issus.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 7
(3,122 Views)