LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean

Hi,
 
We have a boolean varaible, A,  in a principal VI . When this boolean variable is equal to 1, an under-VI opens. In this under-VI, there is an other boolean variable, B, which is entitled "return to the principal VI".
We want to force the boolean variable, A, to 0 when we click on "return to the principal VI". How do it?
 
Thanks
Linda
0 Kudos
Message 1 of 6
(2,580 Views)
Hi Linda,

you could use a local variable of the boolean A. When the sub-vi returns (or in parallel) you write a FALSE to the local of A (booleans are using TRUE and FALSE instead of 0/1).
You can also set the switch to any of the 'Latching' mechanical behaviours, but be aware of problems when trying to use locals together with latching 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,574 Views)

Thank you for your answer.

How do we do to put the local variable A to false?

Linda

0 Kudos
Message 3 of 6
(2,566 Views)
Hi Linda,

usual way in LabView: wire a FALSE constant!

Have a nice weekend while reading the manual 🙂

Message Edited by GerdW on 02-02-2007 05:00 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,551 Views)

A local variable won't work IF you want to reset a control in the main VI from within a subVI, and it seems that's what you are trying to do.

There are several possibilities, for example:

  1. Use a latch action for A, with the disadvantage that A resets once it is read by the code instead of staying on as long as the subVI executes. That might be OK, depending on your application.
  2. You could feed a reference to A as one of the input parameters to the subVI, the write to a value reference inside the subVI whenever needed.
  3. If you use an event structure, place a two-frame flat sequence in the event for "A:value changed" and place the subVI in the first fram and the terminal for A in the second frame. Make the mechanical action of A "latch when pressed". Now the subVI executes first but the A terminal will only get read (and thus reset to false) immediately afer the subVI finishes.
  4. ...

If you would tell us a bit more why you think you need this, we might come up with some more alternative solutions. 🙂

0 Kudos
Message 5 of 6
(2,548 Views)

Hi Lindaa,

You can see the response with an example on this Post :

http://forums.ni.com/ni/board/message?board.id=170&message.id=227588&jump=true

 

regards,

Christophe S.
Account Manager East of France І Certified LabVIEW Associate Developer І National Instruments France

0 Kudos
Message 6 of 6
(2,509 Views)