Showing results for 
Search instead for 
Did you mean: 

Please help: How to continue reading off the time after the pause program

Go to solution

Hi guys


I have a project that reads everything in real time.

However, I have a problem: Continue reading off the time I have release the pause button


I understand that to record the time, its takes current time minus away the time when I start my program. When I press my button to pause the time, it manage to pause but when I switch off the pause button, it is unable to continue the time from where i pause. Can anyone enlighten me how to program this? 


Thank you

0 Kudos
Message 1 of 9

Hi tmd,


what's the point of putting a huge image of a block diagram in the block diagram - instead of real code???


General comments on this image:

- way too large

- way too many local variables

- you need to clean up your block diagram


General comment on your problem:

You need to count the time, when your program is in the "pause" state. This time interval needs to be accounted for when you calculate your "running time"…

Best regards,
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 2 of 9

Hi GerdW,


I have cleaned up the block diagram. However, I am still stuck at this: After I switch off my led light, I want my time to continue from where I have pause. Is it possible to program into this way? I am sorry if it is a easy question as I am still learning how to program using labVIEW


Thank you

0 Kudos
Message 3 of 9

You have a race condition because you cannot guarantee that the current time terminal is written before the local variable of it is read.

I don't see an pause state. Please tell us how to run and operate your VI, what you expect to see, and what you see instead.

Do you really need to spin the loop 1000/second?

If you want the clock to continue, don't put the timing code inside a case structure that bypasses the code. Use shift registers to hold the capture time to reset the capture time every time the boolean goes on-off, for example. no local variables needed at all.

LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 4 of 9

try something as follows:




LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 5 of 9

This is how I wish my VI to operate:

1) When I press the button, timing will start to record.

2) When I press the same button second time, the time recorded will pause at whatever minute or seconds it is recording.

3) When I press the same button again, the timing will record again from where it have paused.


However, my program only work from option 1 to option 2 couldn't go to 3.

This is what happen currently when I tired to go to option 3: When I press the button, my VI will restart back from 0 and count from 0

Spinning 1000/second in the loop is not required but from seconds onward are all important variables to me.

0 Kudos
Message 6 of 9

So you probably simply need another shift register to accumulate the total on time. try it!

LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 7 of 9
Accepted by topic author tmd123
01-08-2018 06:41 AM

Here's what I would do...



LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 8 of 9

Thank for the enlightenment

0 Kudos
Message 9 of 9