LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically change the text on a button

Solved!
Go to solution

I have a sub VI that gets called multiple times from the Main VI.  Each time through the Sub-Vi, only 1 new button's value will be changed to true.  I am wanting whatever button gets selected on that run through the Sub VI to be disabled and have the button text populated from a numeric field when the user presses the stop button.  Using property nodes, I can successfully disable one button, but not necessarily the button that was changed to true on that time through the sub-VI.  I also attempted to change the content on the button to that numeric, but got an error that this property was writable only when the VI is in edit mode.

 

So I am looking to:

1) Programatically link a property node to the button that was pressed according to the boolean array.

2) Disable that button and put the value of the numeric on the button for user reference the next time the sub VI is called.

0 Kudos
Message 1 of 8
(5,092 Views)

You can't change labels at run time, but you can change captions and boolean text.

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 8
(5,075 Views)

Ah, Boolean text is what I wanted.  Didn't know the difference between a label, a caption and Boolean text.

 

Can you help me with my first request: 

1) Programatically link a property node to the button that was pressed according to the boolean array.  As of now, whatever button is pressed, the numeric gets assigned to button 1 (because that is the button that I've linked the property node to), rather than reacting to which button was pressed.

Also, at the start of my sample VI, I have a for loop that enables all of the buttons in the cluster if it is the first time the Sub VI is run.  Can you assist me with re-initializing the boolean text back to blank in that same for loop (so that it is performed on all buttons only the first time that the Sub VI is run). 

0 Kudos
Message 3 of 8
(5,071 Views)

Try this

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 8
(5,056 Views)

@ryancam wrote:

Also, at the start of my sample VI, I have a for loop that enables all of the buttons in the cluster if it is the first time the Sub VI is run.  Can you assist me with re-initializing the boolean text back to blank in that same for loop (so that it is performed on all buttons only the first time that the Sub VI is run). 


1. Use the First Call function connected to a Case
2. Set the values in the True case.

3. Profit. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 8
(5,033 Views)

I have version 16 of Labview so I am unable to open your file.  Is there any way that you can save it so that I can open it?

0 Kudos
Message 6 of 8
(5,013 Views)
Solution
Accepted by topic author ryancam

Here it is in LV2016

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 8
(5,006 Views)

That did the trick, I just had to add a property node inside of the for loop of that first case structure to reset the boolean texts back to blank if it was the first run of the VI, but that otherwise did the trick.  Thank you!

0 Kudos
Message 8 of 8
(5,000 Views)