LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i limit the string length in the string control LV 6i

Hello Everyone,
I have been developing an app (using Labview 6i) which, among other inputs, will require the user to type in the date. Here are the set of problems I am facing

- Currently I have a cluster of String controls acting as fields for MMDDYYYY format. Is there a better way for the user to enter the date and stay with the correct format.   Also, Is there a way to limit the string control for MM and DD field to 2 characters only?

- Any other suggestions for creating a useful date control?

Thanks
Shabu

0 Kudos
Message 1 of 8
(3,210 Views)

h Shabu,

I'm not sure about cluster controls, but for simple strings, U can use the Str Subset function to restrict the chars to 2 for the desired fileds.

Can U post Ur VI to know more of the requirement ?

- Partha ( CLD until Oct 2024 🙂 )
Message 2 of 8
(3,207 Views)
You can use Partha's method with an event structure for immediate UI feedback.

Hope this helps!
0 Kudos
Message 3 of 8
(3,200 Views)

You could just use a timestamp control. By default, this has time and date although it seems you only want the date. This can be achieved by editing the format string. Right click the control and click properties. Go to the Format & Precision tab. At the bottom of this screen click the Advanced Editing Mode radio button.

Change the format string to: %<%x>T

Now only the date will be shown. The control will output a timestamp, so to get a string as I assume you want, you can use Get Date/Time String.

Message Edited by Marc A on 03-15-2007 09:07 AM

0 Kudos
Message 4 of 8
(3,199 Views)
To update to Derek's explanation, a quick example... Smiley Wink
 
Don't forget to Tick the 2 things I've shown in the att pic !
- Partha ( CLD until Oct 2024 🙂 )
Download All
Message 5 of 8
(3,192 Views)

Sorry to add anew... Smiley Wink

Marc's post is perfect !

- Partha ( CLD until Oct 2024 🙂 )
Message 6 of 8
(3,192 Views)
Thanks to all those who responded.

Seems like all of you are blessed with having newer versions of Labview. I, on the other hand, am stuck with Labview 6.0. Is there a timestamp control in LV 6i.   Is there a way to limit the number of characters in a String control in Labview 6i.

Does anyone know if I can use ActiveX to put a calendar control on my front Panel?



Thanks
Shoaib
0 Kudos
Message 7 of 8
(3,178 Views)


shabu wrote:
... Is there a timestamp control in LV 6i. ...
Does anyone know if I can use ActiveX to put a calendar control on my front Panel?
...


Microsoft's ActiveX MonthView control or Date and Time Picker control both work in LV6.0.

LabView's timestamp control with its built in calendar was introduced in LV7.0.

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 8 of 8
(3,143 Views)