12-08-2009 04:11 PM
Hello,
I need to create a text label in LV 7.0. It must be just text, but not a textbox or indicator. I also need to change it programmatically. I have created text on the screen in the past, and had to link to it by getting a reference number for it, but that was a royal pain. Why you can't right click on it and create a reference for it I don't understand. Does anyone know an easy way to do what I need to do?
Thanks.
Rick
Solved! Go to Solution.
12-08-2009 10:05 PM
12-08-2009 11:15 PM
Hi Rick,
What you can do is... turn the Label off and show Caption instead.
Create a property node of that control/ indicator, select Properties > Caption > Text.
Now you should be able to programmatically changing the Caption Text.
Hope this helps in overcoming your problem 🙂
PS: You must have the control/ indicator's Caption shown for above to work.
12-09-2009 08:07 AM
Hi,
LV7.0 does not have (that I can find) any way to change the color of the text indicator to make it dissappear. I even tried setting the text indicator to invisible and setting the caption to visible. I suspected that wouldn't work, but tried it anyway, just in case.
Almost every label I have ever done has been done using the caption of an indicator. I put the indicator off the screen somewhere, and place the caption in view. Then, manipulate the caption with a property node. The reason I'm having trouble with it this time is that the caption needs to go into a tab control. If the indicator is not part of one of the tabs, the text doesn't show/hide as it should.... or as I want it to.
Before it ever occurred to me to use the caption of an indicator, I used to use plain old text. I could change the text with a property node if I could get a reference to it, but getting a reference to it was very difficult. At least, I never found an easy way to do it. It consisted of getting a list of all the referenced of all the controls in the vi, and, through trial and error, finding which reference went to the text I was using. I thought that was rediculous. Maybe there is an easier way to get a reference to the text, but I didn't know it. That's when I thought of the caption thing.... but now, it appears the caption won't work correctly. I can't belive LV doesn't have a plain old label like VB.NET. Seems like a huge oversight.
I was told in another thread to catch the event of tab toggling, programmatically read the tab, and show the appropriate text. I can see how that could be done, but it sure seems like the long way around what should be a simple solution. Like driving from Mackinac, MI (LP) to the UP by way of Wisconsin when the bridge would be a much better choice.
Thanks.
12-09-2009 08:40 AM - edited 12-09-2009 08:42 AM
Hi Rick,
place a classic simple text indicator on your front panel. Pick the coloring tool and select transparent for both fore- and background. Now left-click the text indicator border to make it transparent. Make the label invisible. Now you have a invisible text indicator to display text on the front panel without any borders around it. You can even disable the indicator so the user can't click it when the program is running...
For your "getting the reference" problem:
You get references of all controls of a front panel. Now you can check their labels (which should be unique due to programming guidelines) to know which control you're accessing...
12-09-2009 09:44 AM
12-09-2009 10:00 AM
12-09-2009 10:08 AM
rickford66 wrote:
Ah, got it!! I was using a text indicator and not a simple text indicator from the classic controls. lol Now, reading the previous post, I have a better understanding of what you were trying to tell me. Thanks so much. Sorry it took me so long to catch on.
I'm glad you gave Gerd credit for the solution. But isn't that exactly what I told you in message 2????
12-09-2009 10:21 AM
12-09-2009 09:40 PM