Skip to content

Pause and continue the time with Elapsed time.vi in LabVIEW

July 31, 2011

Elapsed Time.vi is a very useful Express vi which returns the elapsed time and can be reseted. Unfortunately there is no pause function in Elapsed Time.vi ( LabVIEW 8.5 to 2009). I had been looking for the examples of pausing and continuing the time in LabVIEW, but there seems not be a simple one.
So I created this myself. It is not efficient in term of excecution time, but it is simple to be made from scratch and memorized.

Basically the shift registers are used to store the previous elapsed time. When it is in the false (run) case, the elapsed time is added to the ‘total elapsed time’. When the vi in the true (pause) case, the total elapsed time is transferred to the start time and the Elapsed Time.vi is reseted (stopped). Hope this will be helpful. :)

 

———————–In response to Mark’s question——————————–

So I added the reset function for this SubVI:

When you reset the clock, you simply ‘reset’ it and send ’0′ to elapsed time. Hope it helps.

About these ads
7 Comments leave one →
  1. Mark Anderson permalink
    August 19, 2011 6:30 pm

    This is great, how would you make it so that it could accept an input that would reset the elapsed time to 0?

    • August 22, 2011 4:18 pm

      Hi Mark,

      Please find this updated blog for the solution. Sorry for the late reply. Hope it solves your problem.

      Regards,
      Bo

  2. July 30, 2012 3:22 pm

    This is a great code bit to use in the CLD exam.

    One comment: With the updated code, the “Time has Elapsed” boolean indicator will show true only if the set time has elapsed since you have unpaused the VI (since the pause also resets the express VI). No big deal, a small bit of comparison code can create that output easily. Just don’t use this indicator as the gate for the next step of your code in your CLD exam as it is coded here, :-D

    • July 30, 2012 4:34 pm

      Thanks for your correction, Matt. It’s been a while since I wrote this blog and it really took some time to recall.

Trackbacks

  1. Preparing for LabVIEW CLD exam (2) « Let's LabVIEW
  2. Preparing for LabVIEW CLD exam (1) « Let's LabVIEW

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 168 other followers

%d bloggers like this: