LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reset control button after timer expires

Solved!
Go to solution

Hi folks-

I'm a Labview newbie and I'm having trouble find the best solution to this problem: I have an Elapsed Time Express VI which I'm controling with a button (T means start, F means stop).  The user can stop the timer at any time by setting the control button to F.  I would like the button to automatically show F again if the timer expires before the user manually stops the timer.  What LV coding mechanisms should I use to accomplish this behavior?

 

I've tried using the button value property node driven by my timer-running boolean but it sets the button to one state or the other all the time.  It's state driven.  I need a command driven design, specifically, send a command to the button to reset when the timer expires.  I'm such a newbie that I don't even know what terms to look up.  Please help.

 

Thanks - John Speth

0 Kudos
Message 1 of 7
(3,782 Views)

(I'm the OP.)  I stumbled upon a solution but I'd sure like someobdy to explain why it works.  My solution is this:

1. Create a local variable that points to the button I want to reset

2. Wire the local variable to the timer-running boolean

 

Testing shows it works but I dunno why.  Can someone please enlighten me?

0 Kudos
Message 2 of 7
(3,766 Views)
show your block diagram to be make it clear what you want to say
0 Kudos
Message 3 of 7
(3,763 Views)

Think this is what you were requesting.

Matt Fitzsimons
NI Alliance Member
LabVIEW Champion
NI Certified LabVIEW Architect
LabVIEW, LV-RT, Vision, DAQ, Motion, and FPGA
0 Kudos
Message 4 of 7
(3,758 Views)

Thanks, Hatef.  I should have done that.

 

Here's a screen shot of my timer VI.  It is the code in the SysRsrcTimer VI shown after this image.

SysRsTmr.PNG

Here's a screen shot of my code that uses the local variable.  It's only a small part of the app but it covers the discussion topic.

ClientSide.PNG

0 Kudos
Message 5 of 7
(3,750 Views)

Thanks for the VI Matt.  I can see that it's an elegant solution.  One question: Is the shift register bounding the works an essential part of your solution?  I'm not that familiar with shift registers.

0 Kudos
Message 6 of 7
(3,746 Views)
Solution
Accepted by topic author johnspeth

A shift register is a feedback node that holds the previous state.  This is slightly different version but may be easier to understand.

 

 

Matt Fitzsimons
NI Alliance Member
LabVIEW Champion
NI Certified LabVIEW Architect
LabVIEW, LV-RT, Vision, DAQ, Motion, and FPGA
0 Kudos
Message 7 of 7
(3,697 Views)