LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limiting Input String Length

I'm reviving the thread because I find it adequate to the problem i had - how to limit character length in string control and because the suggested solutions to the problem were using event structure which I was trying to avoid. The code was tested on LV2012. Run the vi input the desired maximum string length in to the MaxLength control delete the current STRING string from TextBox control then type some text in TextBox control. Observe that the TextBox control does not accept more than MaxLength characters.

 

Best regards

 

0 Kudos
Message 21 of 28
(588 Views)

@altenbach

No reason at all. I should've thrown a delay in a loop.

0 Kudos
Message 22 of 28
(571 Views)
Why do you think the property node should be in a loop at all? Typically they don't change once set.

LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 23 of 28
(556 Views)

Reviving the old thread AGAIN as this seems the most pertinent place to post this addition

 

If wanting to limit input string length on one input it is possible there are a number of other string inputs on the same screen. Setting intelligent tabbing order between the controls makes the operation a little more slick. I found that if the input is full (to the prescribed string limit) then tab does not execute. The image attached shows one way of getting around this. Setting a key focus for the Tab key character code overrides the discard switch that appears to be getting 'stuck'.

 

There is a further improvement required that hopefully someone can contribute to, the key focus property only works if the next control is enabled. My question is;

 

Is there a method to select the next enabled control in the tabbing order rather than selecting or choosing a specific key focus?

 

 

 

0 Kudos
Message 24 of 28
(357 Views)

Hi,

I think that my solution below should solve the problem with the tab key. It just adds a check to see if the tab key is pressed and then does not discard it so that it acts as it normally should.

I hope this helps.

-Michael

string limit tab fix v2.PNG

Message 25 of 28
(336 Views)

That works, thank you!

 

Kind Regards,

 

Michael

 

 

0 Kudos
Message 26 of 28
(318 Views)

My Eurotherm 2604 displays actual temperature reading partially but the other loop(for humidity) is okay. What could be the problem?

0 Kudos
Message 27 of 28
(225 Views)

Hi,

To get the best help, I would suggest you start a new post and thread.

Thanks,

Parul M.

Applications Engineer

National Instruments

0 Kudos
Message 28 of 28
(214 Views)