LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why does my min:sec timer decrement while not enabled?

My application uses many minute:second timers that must be displayed to the operator as mm:ss.
 
The attached simple vi does what I need except that the count-down-time value stored in the shift register decrements even when the timer is not enabled.  There may be a blindingly ovbious logic error that I can't see, or there may be something subtle in the way LabVIEW operates that is tripping me up.
 
In any case, the shaft register variable (Hi-1) begins decrementing as soon as you run the vi.  It should not.  It should hold the value set by the control called Timer until the Start button is pressed.  It should stop decrementing and revert to the Timer control value when Abort is pressed.
 
Can anybody see my error?
Jeff
Climbing the Labview learning curve!
Sanarus Medical
Pleasanton, CA
Message 1 of 8
(3,643 Views)
Hello Jeff,

it seems strange to me as well. I tried to initialize the shift register but that didn't work. However if a replace the timed loop with a normal while loop and put a wait until next ms (1000) the VI functions as expected. Maybe this is a bug in the timed loop. Even terminating the loop had no succes..
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 8
(3,628 Views)
Very interesting... I vote for mayor bug!
 
Interestingly, it behaves correctly if execution highlighting is on. You can actually place a probe on the shift register wire and the value jumps depending on the execution highlighting setting while the VI is kept running.
 
(Still, it seems like overkill to use time loops just to run a timer. Why don't you use the system timer instead? :))
0 Kudos
Message 3 of 8
(3,617 Views)
OK, I know diddlely about timed structures (never used one in my life), so someone else can explain the WHY, but it works if you configure the input node to Use Built-In Timing but RESET at structure start.


2006 Ultimate LabVIEW G-eek.

Message 4 of 8
(3,610 Views)
Hi Folks,
     Would some kind soul please post this in 7.1 (or post a pic)?  I wanna see tooo! Smiley Happy
 
Thanks!
 
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 5 of 8
(3,590 Views)
tbd, here you go:


BUT when i rebuilded the vi, i did not see the same issue, but when i recompiled the Vi the issue remained, and when i converted the timed loop into a normal and back the issue was gone as well. So I think there something with this VI, have you done the 8.0.1 update?
Was there anything done special when making this VI?

Ton

Message Edited by TonP on 08-02-2006 01:11 PM

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Download All
0 Kudos
Message 6 of 8
(3,578 Views)

Dave Weisberg found the problem - somewhere along the line I had unchecked "Discard missed periods".  The timed loop is treating periods during which it is not enabled by the Start button as missed.  When you press the Start button, it "catches up".

This still seems like a bug to me.  I assumed that missed periods meant that the code was enabled to execute but there weren't any processor cycles available, so one or more loop periods failed to execute.

Jeff
Climbing the Labview learning curve!
Sanarus Medical
Pleasanton, CA
Message 7 of 8
(3,559 Views)
Thanks, TonP!
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 8 of 8
(3,540 Views)