From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run Time not working

Solved!
Go to solution

I created a VI (attached) that is supposed to count seconds, minutes, and hours when I switch a boolean on and then reset when I switch the boolean off. However, my minutes and hours don't reset when I switch the boolen off and I'm not sure how to fix it. I've tried clearing the indicator when the boolean is off, but that doesn't seem to work.

0 Kudos
Message 1 of 7
(3,209 Views)

Are you just trying to create a timer? Why not make the timer longer and output the total number of seconds and calculate how many minutes and hours have elapsed from there?

This gives you exactly what you want in a much easier way:

SecMinHr.png

(The cluster has a fractional second output as well if you want to combine that with the integer to get sub-second accuracy)

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 7
(3,206 Views)

@James.M wrote:

Are you just trying to create a timer? Why not make the timer longer and output the total number of seconds and calculate how many minutes and hours have elapsed from there?

This gives you exactly what you want in a much easier way:

SecMinHr.png

(The cluster has a fractional second output as well if you want to combine that with the integer to get sub-second accuracy)


Why all the Rube-Goldberg dancing through a date-time record with a detour into timestamp?

 

Just wire the Elapsed Time output to Seconds and change the display format to relative timeSmiley Surprised 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 7
(3,060 Views)
Yes, this is the easiest way, I was just showing how to get the exact same numerical values to the indicators originally used by OP.

Every time I try to help someone on here run before they walk I end up having to backtrack, so sometimes the first thing I do is show them how to do it with the outputs they've already set. It was already a big improvement from the feedback nodes I thought.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 4 of 7
(3,047 Views)

@James.M wrote:
Yes, this is the easiest way, I was just showing how to get the exact same numerical values to the indicators originally used by OP.

Every time I try to help someone on here run before they walk I end up having to backtrack, so sometimes the first thing I do is show them how to do it with the outputs they've already set. It was already a big improvement from the feedback nodes I thought.

Smiley Very Happy

I figured as much-- But you know I couldn't let it pass.  That code should fit on a postage stamp!


"Should be" isn't "Is" -Jay
Message 5 of 7
(2,995 Views)
Solution
Accepted by msiwk

@JÞB wrote:
That code should fit on a postage stamp!

Okaaaaaay, here you go  Smiley LOL

ElapsedTime.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 6 of 7
(2,979 Views)

Haha changed the solution because I like the simplier one better Smiley LOL

0 Kudos
Message 7 of 7
(2,969 Views)