LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt over writing control

Hello, I have the code attached. And I want it to work as follows, without placing another event.

1 - When pressing button "A", write 1 in the indicators. (Done)

2 - Press "B" to make the "Alt1 button" and "Alt2 button" buttons visible. (Done)

3 - Clicking "Alt1 button" type the Knob control in Alt 1. And when you click "Alt2 button" type the Knob control in Alt 2. (Can not)

How can I do this?

Thank you.

0 Kudos
Message 1 of 8
(2,934 Views)

@Pão wrote:

2 - Press "B" to make the "Alt1 button" and "Alt2 button" buttons visible. (Done)


Really not done. Buttons hide immediately after make visible
you can use local variable or shift registers

And you need make action for alt 2  similar with alt 1

 

event.png

0 Kudos
Message 2 of 8
(2,929 Views)

First, create en event for your Stop button. You have issues with needing to press either Button A or Button B to get your program to stop. Use an event to see when the Stop button has been pressed and pass a true out from the event structure to terminate the while loop.

 

Now, the other problem that you have is that the main body of your loop is making your alternate buttons invisible again. I don't think you want to do this. Button B sets them to be visible but you immediately make them invisible again.

 

Beyond that, I have no idea what you actually want to accomplish with the Alternate buttons so I can't really give you any advice on what to do.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 8
(2,925 Views)

But, if I do this, "alt1 button" like an event. I will not be able to start button B first.

Basically, this is a small example code that I did because I have a large interface, and I want to press the B button to activate two other buttons in a menu that will decide what value the "knob" will control. That is, it would be two events (the "alt 1 ..." menu appears and when I click send information), which I can not do.

0 Kudos
Message 4 of 8
(2,896 Views)

You can certainly design your UI such that those buttons are not visible at the start and some other event is required for them to become active. However, the current example is always disabling them. As an experiment, move the property nodes which make the button invisible outside of your loop and then try running your code. You will see that they are not available until after you have pressed button B. Then if necessary you can have some other event disable them again. However, you cannot disable them every iteration of the loop because that means they will never become active. At least not long enough for the user to interact with them.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 8
(2,891 Views)

Your tip worked to make the buttons active.

Now my question is how to do when clicking the button that has active, and direct the data from the "Knob" to the display Alt1 or Alt2.

0 Kudos
Message 6 of 8
(2,884 Views)

You can use a local variable in the other event cases to read the current value of the control. Generally you should avoid using local variables and use wires to pass your data around. However, UI programming is a valid time to use them when you need to get the most current value in multiple event cases within an event structure.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 8
(2,882 Views)
There are answers for all your questions
0 Kudos
Message 8 of 8
(2,858 Views)