LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create a label in LV7.0

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 10
(3,372 Views)
Why can't you use an indicator?  You can color the background and frame transparent so it won't look like an indicator but would look like a free label.  I'm not sure which palettes are present in LV7, but the classic palettes in newer LV versions allow you do make the indicator disappear.
Message 2 of 10
(3,355 Views)

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. 

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 3 of 10
(3,349 Views)

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.

 

 

0 Kudos
Message 4 of 10
(3,326 Views)
Solution
Accepted by topic author rickford66

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...

Message Edited by GerdW on 12-09-2009 03:42 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 10
(3,320 Views)
sample.PNG


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 6 of 10
(3,304 Views)
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.
0 Kudos
Message 7 of 10
(3,297 Views)

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????

0 Kudos
Message 8 of 10
(3,289 Views)
You are right that it is the same solution and I wish I could give credit all around.  Unfortunately, the forum does not allow that... only Kudo's.  The picture at the end helped a lot too.  You see, I only do LV programming once in a while, and I am not nearly as good at it as those who do it daily.  I work for a small company and wear a lot of hats.  LV programmer, VB.NET programmer, embedded assembly & C programmer, schematic designer, pcb designer, packaging engineer, production helper/debugger, you get the idea.  The one I tagged as the solution was ultimately the one that spoke in basic enough language for me to catch on.  Once I caught on, I saw that your post was exactly the same solution, only with not as much hand holding.  It was the long explanation, along with the picture, that made the light go on.  Sorry, I wish I could have spread the credit around more.
0 Kudos
Message 9 of 10
(3,281 Views)
Then it was actually Cog Rouge's post that should be the solution since he was the one that gave you a good screenshot of a LV7 screen showing the classic string indicator AND the transparency on the color picker.
0 Kudos
Message 10 of 10
(3,267 Views)