LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Write to Label.Text Property Node

I am unable to WRITE text into a Label.Text Property Node - I have no trouble reading out but for some reason can not write in. Has anyone else encountered this?
0 Kudos
Message 1 of 17
(5,761 Views)
I don't think it is possible to change a label while the vi is running. You should be able to change this property of a control on front panel that is not running though.

Brian
Message 2 of 17
(5,761 Views)
Can you give a suggestion for how to do this. The only way that I can think to change a control w/o the front panel of that VI running, is to pass a refnum to a subvi - but this doesn't work either.
0 Kudos
Message 3 of 17
(5,761 Views)
Its a little involved but it can be done from another vi. You need to open a reference to the vi that has the control you want to change on the front panel, then get the Front Panel property from that, which is another reference. Get the Contols[] property from that reference, this returns an array of references (one for each control on the FP). Use index array to get the control reference you want and use a property node to change its label.text property.

I know that was probably confusing, so I made a quick example to illustrate my point. I will attach it as a comment to my original reply.

Brian Vibert
0 Kudos
Message 4 of 17
(5,761 Views)
Here is the example I mentioned in the other post. Just enter the value you want to change the label to in the Label.Text string control on the LabelChange.vi front panel and run that vi. The label of the string control on vi1.vi should change.

Brian
0 Kudos
Message 5 of 17
(5,761 Views)
Brian, that's a neat way to handle that. I found it very interesting looking at your VIs - though it was Sarah's question, I'm giving your answer **** just for the education. Doug
0 Kudos
Message 6 of 17
(5,761 Views)
Thank you, its nice to hear compliments from fellow enthusiasts. I also give ratings to answers of other people's questions that I find interesting.

Brian
0 Kudos
Message 7 of 17
(5,761 Views)
I just want to add that changing the label of a control is truly editing the
VI. That is why it can't be done while the VI is running (or reserved for
call) and won't work in a Run-Time application. Under certain circumstances,
changing a label may also break the VI or other VIs using it.

The use of the Caption.Text property, instead of the label, is adequate for
most display purposes. It can be changed on its own VI diagram while it is
running. Just show caption and hide label on the front panel to use it.

Jean-Pierre Drolet
Scientech R&D


"Brian Vibert" a écrit dans le message news:
506500000005000000A5350000-993342863000@exchange.ni.com...
> Here is the example I mentioned in the other post. Just enter the
> value you want
to change the label to in the Label.Text string control
> on the LabelChange.vi front panel and run that vi. The label of the
> string control on vi1.vi should change.
>
> Brian


LabVIEW, C'est LabVIEW

0 Kudos
Message 9 of 17
(5,761 Views)
I agree with you, and probably should have mentioned that in my posts. I was so focused on solving the problem that I forgot to mention that I didn't recommend it. Thank you for pointing out my obvious oversight.
0 Kudos
Message 12 of 17
(5,556 Views)
brian -

pretty cool !! but I am trying to get access to a label on a control inside a cluster. When I put a cluster on the front panel & use the remote access technique illustrated in your program, I get a reference number to the cluster but when I try to set properties on the cluster, it does not realize that it too has controls inside it. So I am only able to access the cluster label, not the label of the controls inside the cluster. If get a property node for a cluster directly, IE on the diagram, I get to choose 'controls[]' which is an array of refnum's to the controls inside the cluster. With the remote technique, I can't get to this access level.

any ideas? yes, this is a pretty obscure thing to want to do, and no, I don't want to cha
nge the caption.

let me know and thanks in advance.

- craig
0 Kudos
Message 14 of 17
(5,556 Views)