01-21-2016 01:42 AM
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
01-21-2016 01:50 AM
@altenbach
No reason at all. I should've thrown a delay in a loop.
01-21-2016 02:51 AM
06-21-2017 05:51 AM
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?
06-22-2017 08:55 AM
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
06-26-2017 06:06 AM
That works, thank you!
Kind Regards,
Michael
05-30-2018 01:21 AM
My Eurotherm 2604 displays actual temperature reading partially but the other loop(for humidity) is okay. What could be the problem?
05-31-2018 08:46 AM
Hi,
To get the best help, I would suggest you start a new post and thread.
Thanks,
Parul M.
Applications Engineer
National Instruments
07-18-2020 01:50 AM
In this example for false case u should not able to enter the character to the string so what logic i need to use here.
Please help in this
07-18-2020 01:58 AM
Hi,
I need to limit the input string length, but without using the Event structure Function.
Please help me out with this solution.