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?
Solved! Go to Solution.
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"…
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
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.
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.