LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change value of button in cluster

Solved!
Go to solution

Dear all,

I writing a program which has 5 clusters and all the clusters contain a "STOP" button. the program can exit when any of the button is pressed.

when i press the button the value of the button goes to False and remains False. I want it to get back to True. so i tried using the "value property" and putting the value "False".

but it still remains True.

I am using event structure to notice the value change. and have put "Stop value change" of all the buttons in a single event.

 

How can i change the value of the button to False ??

 

Thanks,

Ritesh 

0 Kudos
Message 1 of 17
(4,335 Views)

HI

Can you upload your VI so we can debug this problem

Regards

Santosh

Message Edited by SantoshJaiswal on 03-25-2009 07:09 AM
0 Kudos
Message 2 of 17
(4,329 Views)
The obvious choice is to set the Mechanical Action of the Stop buttons to Latch When Released, but there may be some reason why you're not doing that. Aside from that, you could write to the cluster with a local variable just outside the loop when the program is about to exit.
Richard






0 Kudos
Message 3 of 17
(4,320 Views)

Ritesh

 

Make sure the cluster control(s) are in the event handling the boolean change event.

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 4 of 17
(4,319 Views)
edit: an event struct may inhibit the latch idea. See attached for local variable idea. Would this work?
Richard






0 Kudos
Message 5 of 17
(4,309 Views)

ritesh024 wrote:

Dear all,

I writing a program which has 5 clusters and all the clusters contain a "STOP" button. the program can exit when any of the button is pressed.

when i press the button the value of the button goes to False and remains False. I want it to get back to True. so i tried using the "value property" and putting the value "False".  but it still remains True.

I am using event structure to notice the value change. and have put "Stop value change" of all the buttons in a single event.

 

How can i change the value of the button to False ??



I have somequestions to understand why you want to implement your code in such a way.

 

If I understand correctly, you want the program to stop and completely exit if any of the 5 stop buttons is pushed.  You probably have your reasons for having 5 buttons but if you could explain, it would help to understand the scenario.  Back to stopping and exiting the program.  When you click any of the 5 stop button, does something have to happen (get triggered) before the program exits?  other than the normal course of execution of the program.. When you mention that pressing the button gives you False, then did you reverse the logic of the button?  Because usually, when you press a button, you get TRUE.  Then you mention that you try to use a property node to force the value to False, but it remains True..  I'm confused. It may be the selected mechanical action that you have selected for the buttons.  Can you clearly explain what you are trying to achieve?

 

As for using Local Variables in the posted example, I have no clue as to why that is necessary.  If the program is to exit, then let it do so. Select the appropriate mechanical action for the buttons and handle whatever needs to be handled so that the program exits gracefully.  Try using the mechanical action "Latch When Released" and stay away from Local Variables (that's what wires are for... to wire directly).

 

R

 

0 Kudos
Message 6 of 17
(4,297 Views)

By "Exit", he may mean "Stop " in which case, returning the Stop button(s) to False is a common procedure.

 

Latch When Released may not work correctly, visually, with an event structure. The button may not "bounce back", depending on how your case structure is made and where the controls are.

 

I think writing False to a Stop button whose Action is not latched is a proper and extremely common use of a Local variable. A wire will not work. (Well, if we want to get fancy, we could use references and wires).

Richard






0 Kudos
Message 7 of 17
(4,278 Views)

Hi

 

I am extremely sorry for creating some confusion regarding the True/False state of the button.

the Button turns True when pressed and remains True. i want to set it to False again when it is pressed.

 

i am creating an application which has 5 different Front panels, and i am using Tab control to switch from one FP to another. And on each FP i am giving a Stop button to Close the application.

 

Its not that i am having only Stop button in the cluster. There are other buttons also which do some job. so when those buttons are pressed the behavior remains the same. they don't switch back to False and neither "Value property" node works.

 

 

Ritesh 

0 Kudos
Message 8 of 17
(4,268 Views)

Broken Arrow:

For the latch mechanism to work, the terminal must be read inside the appropiate event.

 

Ritesh: 

But the question is, how are you clustering buttons over several tab-pages? Iguess you got something wired weird. Maybe we could help more with code and/or screenshot.

 

Felix 

0 Kudos
Message 9 of 17
(4,261 Views)

A simpler solution is to have your Tab with the 5 different screens and to the right (or left / top / bottom), you would have all your common controls that you wish to have access when you're in any of the the Tabs.  That way a single stop button is needed.

 

Typically, with a event structure, you have a Queue or Notifier to pass data to another loop that actually does the work.  The event structure loop would be to respond to operator selections.  There are other architectures, but let's keep it simple.  By using a Queueyou can send information as well as run status (run / stop / exit).  And doing so, you would not rely on Local Variables which may introduce a race condition depending on how they are implemented within your program. 

 

R

0 Kudos
Message 10 of 17
(4,255 Views)