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.
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.
07-24-2015 12:12 PM
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.
Solved! Go to Solution.
07-24-2015 12:18 PM - edited 07-24-2015 12:26 PM
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:
(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> ---'
07-27-2015 09:11 PM
@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:
(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 time
07-27-2015 09:40 PM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-28-2015 07:36 AM
@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.
I figured as much-- But you know I couldn't let it pass. That code should fit on a postage stamp!
07-28-2015 08:40 AM
@JÞB wrote:
That code should fit on a postage stamp!
Okaaaaaay, here you go
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-28-2015 08:47 AM
Haha changed the solution because I like the simplier one better