From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-06-2018 04:39 AM
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
Solved! Go to Solution.
01-06-2018 08:05 AM
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"…
01-06-2018 10:12 AM
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
01-06-2018 12:06 PM - edited 01-06-2018 12:09 PM
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.
01-06-2018 12:31 PM - edited 01-06-2018 12:34 PM
01-06-2018 01:04 PM
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.
01-06-2018 01:18 PM
So you probably simply need another shift register to accumulate the total on time. try it!
01-06-2018 04:42 PM
01-08-2018 08:41 AM
Thank for the enlightenment