LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does my push button not return to original state before exiting a sub-vi?

I have an old application created in LabView 4 and ran on a P1 with Win 95. I used a "push button" to end while loops in sub-vis. Since then I upgrated to LabView 7 running on a PIII with XP. Now the push button does not return to its original state before the loop/vi exits, so that next time the sub-vi is called the push button is now in the opposite state meaning the loop exits immediately. The mechanical action is correct. It happens on all while loops with a push button, but not every time.
0 Kudos
Message 1 of 6
(4,346 Views)
If your VI start with wrong state of button you have probably wrong default
value of control.

Regards
Grzegorz
SPRINTER


Uzytkownik "jcvt" napisal w wiadomosci
news:50650000000800000063AC0000-1066448259000@exchange.ni.com...
> I have an old application created in LabView 4 and ran on a P1 with
> Win 95. I used a "push button" to end while loops in sub-vis. Since
> then I upgrated to LabView 7 running on a PIII with XP. Now the push
> button does not return to its original state before the loop/vi exits,
> so that next time the sub-vi is called the push button is now in the
> opposite state meaning the loop exits immediately. The mechanical
> action is correct. It happens on all while loops with a push button,
> but not every time.
0 Kudos
Message 2 of 6
(4,346 Views)
The mechanical action of latching is that the Control will return to its default value. If you want it to return to "Up" after it is read, then place the control in the "up" position and then right click on it and select Data Operations>>Make Current Value Default.

If that does not work you can always use local variables to set the boolean back to the value you want.
Message 3 of 6
(4,346 Views)
I agree with Evan.

First thing to eliminate is the PC problem. Upgrading a PC & OS should not contribute to the change in behaviour. Check the mechanical action of your control.

Right-click on your button and select Mechanical Action. Choose the one suited for you. It may be: Switch when released or Latch when released (or whichever way you want it to behave).

Once you are happy with the setting, do as Evan explained above.. Right click it again, select Dta Operations and choose Make Current Value Default.

In any case, your new PC should not have any bad effect on LabView ;o)
Message 4 of 6
(4,346 Views)
From jcvt:

The mechanical action is non-latching with the "up" position as default. The while loop and therefore the sub-vi finishes before the button returns to default (not all the time). If you reset it to default it changes to the correct state.
0 Kudos
Message 5 of 6
(4,346 Views)
Maybe on the new machine your execution order is slightly different, resulting in the VI being stopped (Do you have a "Stop" function stopping the VI?) so that the boolean is not being read. The latch function only activates when the value of the button is read in the code.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 6 of 6
(4,346 Views)