annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

How limit input string control?

I am trying to set string length limit that user can input to 205 and want the string control not to display any character after the 205th character. I do not want to use the Event structure and I am use the Labview 7.1
Any suggestion?
0 Kudos
Messaggio 1 di 18
11.023Visualizzazioni

And you don't want to use the event structure because?...

 

Alternative: Use a loop. Poll the string length in the loop. If >205, chop off the extra characters and write back to the string control. Make sure the string's "Update value while typing" is set. Sloppy, but it works. Without an event structure. 

0 Kudos
Messaggio 2 di 18
11.016Visualizzazioni

WSalas wrote:
I do not want to use the Event structure

Why not? This sounds like the perfect application for an event structure.


Message Edited by Cory K on 01-10-2009 10:57 AM
Cory K
0 Kudos
Messaggio 3 di 18
10.982Visualizzazioni

Hi Cory,

 

instead of Text.Text property you can use the "Value" property too - one menu less and IMHO more intuitive Smiley Strizza l'occhio

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Messaggio 4 di 18
10.965Visualizzazioni

GerdW wrote:

Hi Cory,

 

instead of Text.Text property you can use the "Value" property too - one menu less and IMHO more intuitive Smiley Strizza l'occhio


 

Hehe, yeh. Whatever saves a click or two :smileyvery-happy:.
Cory K
0 Kudos
Messaggio 5 di 18
10.961Visualizzazioni

Cory and GerdW,

 

if you need to save clicks, use a local variable and forget about the case structure. 😄 😄

Message Edité par chilly charly le 01-11-2009 04:05 AM
Chilly Charly    (aka CC)
Messaggio 6 di 18
10.946Visualizzazioni

chilly charly wrote:

use a local variable



People on the forums tend to get mad when local variables are used.
So for the sake of not getting yelled at, we'll stick with the case structure :smileyvery-happy:

 

Cory K
0 Kudos
Messaggio 7 di 18
10.930Visualizzazioni

Cory K wrote:

chilly charly wrote:

use a local variable



People on the forums tend to get mad when local variables are used.

No, people on the forums tend to get mad when local variables are abused. Big difference. Smiley Strizza l'occhio

Messaggio 8 di 18
10.910Visualizzazioni

Cory K wrote:

chilly charly wrote:

use a local variable



People on the forums tend to get mad when local variables are used.
So for the sake of not getting yelled at, we'll stick with the case structure :smileyvery-happy:

 


But in your code, you are essentially using a local variable.  Actually, it's a bit worse, it's a property node and a little bit more obscure one that.

 

If you are trying to change a value that is part of a control (an object that is a source of data in a block diagram) you have to use either a local variable or a property node to be able to update/correct it.

 

The use of the case structure has nothing to do with the use of the property node or local variable.

Message Edited by Ravens Fan on 01-11-2009 11:24 AM
Messaggio 9 di 18
10.906Visualizzazioni

Instead of trimming the oversized string after the fact, simply use a filtering event and discard key entries if the size is already met. Make sure to still allow editing keys to function.

 

This problem has been discussed last summer, so modify my example  from back then. All you need to do is change one diagram constant. 😉


Messaggio 10 di 18
10.885Visualizzazioni