LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modificar programáticamente el caption de los elementos de un array de controles boolean con los elementos de un array de strings

Solved!
Go to solution

It is possible to programmatically modify the label of boolean controls through a for loop at runtime?

 

If it is possible, please explain how, it is of vital importance for my project.

 

Unfortunately, for reasons of confidentiality, I cannot attach any VI. However, I brefly explain what I need:

 

Currently, the output of my project is an array of strings and I need each string to be bound to the label of a boolean control programmaticaly. The problem, as expected, is that I can't modify Property Nodes during execution.

0 Kudos
Message 11 of 21
(1,030 Views)

What you mean for "label"? If you mean the "name" of a control, this property is read-only when the vi is running. However, you can modify the control's Caption. Or you mean the text on the button?

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 12 of 21
(1,018 Views)

I would help significantly if you would tell us what kind of boolean control you have and what "label" you mean.

 

There are three main text elements on a boolean control:

 

The label: you cannot change that at runtime.

The caption: you can change that at any time via a property node (providing that it actually exists. Make sure to set it once via "visible items...caption".)

The boolean text: You can change it easily via property node. For a "button", this is the text on the button. It can differ between true and false state.

0 Kudos
Message 13 of 21
(1,002 Views)

One annoying thing I find with captions - but doesn't deter me from using them - is that, once the property is set, your control has a caption forever.  Even if you set it to nothing, you'll still have [] around your label in the context help.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 14 of 21
(983 Views)

@billko wrote:

One annoying thing I find with captions - but doesn't deter me from using them - is that, once the property is set, your control has a caption forever.  Even if you set it to nothing, you'll still have [] around your label in the context help.


You can always replace the button if [] bothers you so much. 

George Zou
0 Kudos
Message 15 of 21
(961 Views)

@billko  ha scritto:

One annoying thing I find with captions - but doesn't deter me from using them - is that, once the property is set, your control has a caption forever.  Even if you set it to nothing, you'll still have [] around your label in the context help.


I never noticed it before. Most of my controls have a Caption, for translation purposes.

Definitely, it does not annoy me.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 16 of 21
(960 Views)

@zou wrote:

@billko wrote:

One annoying thing I find with captions - but doesn't deter me from using them - is that, once the property is set, your control has a caption forever.  Even if you set it to nothing, you'll still have [] around your label in the context help.


You can always replace the button if [] bothers you so much. 


I said that I found it annoying, but not big enough of a deal to deter me from using captions.  Although, occasionally, I actually have replaced them for that reason.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 17 of 21
(948 Views)

Hi aladegar,

 


@aladegar wrote:

Currently, the output of my project is an array of strings and I need each string to be bound to the label of a boolean control programmaticaly. The problem, as expected, is that I can't modify Property Nodes during execution.


So you needed to start a new thread on the very same topic even though you already marked a solution to your problem in the original thread?

What did ychange now and why is the solution not a solution anymore?

 

Labels are set at edit time.

You don't modify "property nodes", but the value of properties at runtime!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 21
(937 Views)

So somebody merged your threads 😄

 

Array elements share all properties, including label, caption, boolean text. You cannot have an array where e.g. the label differs between elements!

 

I would create an array of clusters, where each cluster contains a boolean and a string. Disable the string so it cannot be changed by the user. (apparently this has already been suggested. This thread is a mess to read 😄 )

0 Kudos
Message 19 of 21
(933 Views)

Hello everyone,

 

First of all, I know that I have opened another thread to try to resolve a question that I assumed was already resolved. however, it seems that I have not explained myself well in the previous threads.

 

When I talk aout the label property I mean this:

 

aladegar_0-1658999476007.png

aladegar_1-1658999491636.png

 

I know perfectly well that you cannot modify the LABEL property of any element at runtime, if you want to modify this property you must do it during the editing of the program.

 

The question that I have and that I cannot resolve is that I do not know if it is possible to assign a string to the Label property of an element programmatically by some means that does not involve the execution of the main VI. After everything I've researched I think it can't be done programmatically. That is why I go to the forum to ask people who master LabVIEW.

 

The threads that I have finished marking an answer as a solution is because the solution provided helped me to represent what I wanted, but it does not allow me to solve the variable assignment problem that I have. Anyway, thanks for your time.

0 Kudos
Message 20 of 21
(912 Views)