07-27-2022 06:44 AM
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.
07-27-2022 07:12 AM
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?
07-27-2022 08:31 AM - edited 07-27-2022 08:32 AM
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.
07-27-2022 09:16 AM - edited 07-27-2022 09:17 AM
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.
07-27-2022 09:48 AM
@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.
07-27-2022 09:51 AM
@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.
07-27-2022 10:06 AM
@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.
07-27-2022 10:22 AM
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!
07-27-2022 10:41 AM - edited 07-27-2022 10:44 AM
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 😄 )
07-28-2022 04:12 AM
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:
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.