LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intuitive non blocking chronometer with pause

Hi all,

 

I'm preparing for my CLD and I'm learning that I have a lot of trouble around making a nonblocking timer for my applications. Currently, I make my timers like this:

 

TimerWithFN.png

 

Is there a better/more intuitive way to make a timer with reset and pause? I've tried using the elapsed time VI, but I can't ever seem to make it work correctly.

0 Kudos
Message 1 of 6
(3,571 Views)

For starters you have far too many calls to Get Time. Each call will be have a different value which will make tracking your time difficult. You could also use an event loop to do your timing. This timer would run in parallel to your task and would send a message that the time has expired.

 

Here is some code that works.

 

Elapsed Time With Pause.png



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 6
(3,558 Views)

In that case, would this be the minimal viable code for the requirements? I like it, but  I'm a little concerned with being able to accurately recreate it on the exam.

 

timer2.png

 

0 Kudos
Message 3 of 6
(3,534 Views)

It appears to be functional.

 

What I posted early is a variation of the Elapsed Time that ships with LabVIEW. You can drop the express VI and convert it to a subVI. From there you can add the pause.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 6
(3,522 Views)

@Mark_Yedinak wrote:

It appears to be functional.

 

What I posted early is a variation of the Elapsed Time that ships with LabVIEW. You can drop the express VI and convert it to a subVI. From there you can add the pause.


How do I convert it into a sub vi I can edit? I drop the express vi -> open front panel -> convert to sub vi. but then it opens up with a clone of subElapsedTime.vi which I can't edit

0 Kudos
Message 5 of 6
(3,486 Views)

@ATE-EGNE wrote:

@Mark_Yedinak wrote:

It appears to be functional.

 

What I posted early is a variation of the Elapsed Time that ships with LabVIEW. You can drop the express VI and convert it to a subVI. From there you can add the pause.


How do I convert it into a sub vi I can edit? I drop the express vi -> open front panel -> convert to sub vi. but then it opens up with a clone of subElapsedTime.vi which I can't edit


Just double click on what looks like the property node. It opens the subVI. From there you can save it and edit it.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 6
(3,478 Views)