LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clock / Project help

Solved!
Go to solution

Hello everyone,

 

Is there a way to create a LINEAR number that increases as long as the loop is runnning? Simular to "LOOP ITTENERATIONS" in while loop. Im trying to create a simple clock type VI that will use that number.


Im basicly trying to make a CLOCK with simple math functions and a loop, but it keeps failing. The math looks good but the loop simply resets instead of adding an additional number to my X. What am i doing wrong?

 

Ive figured out how to make the output into minutes or seconds, and I think I can get a stucture to work with true or false number being LARGER THAN 60 and then minusing 60 from the X to reset the seconds.

 

Some one please help, ive been at this for like over 5 hours...

Download All
0 Kudos
Message 1 of 6
(3,200 Views)

Have you ever heard of "Clock Arithmetic" (or Clock Mathematics)?  If not, type this phrase into Google and think about what you read.  Then think how to apply this (check out the Numeric functions).

 

Bob Schor

0 Kudos
Message 2 of 6
(3,174 Views)
Solution
Accepted by topic author unknown1

You just need to use Quotient & Remainder to gets your minutes and seconds.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 6
(3,171 Views)

Hi,

 

and I think all you need is this:

check.png

You can set the formatting of numeric indicators to a lot of different formats…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,148 Views)

Thank you, this works good

 

The seconds is the remainder, and I use the quotient for the calculaton of the minutes, and its quotient for hours. Works wonderfuly.

 

My math level is quite low, so i dont understand time calulations beyond the simple math, im not even sure how quotient and remainder works, its magic.

Thanks a bunch

0 Kudos
Message 5 of 6
(3,115 Views)

@unknown1 wrote:

Thank you, this works good

 

The seconds is the remainder, and I use the quotient for the calculaton of the minutes, and its quotient for hours. Works wonderfuly.

 

My math level is quite low, so i dont understand time calulations beyond the simple math, im not even sure how quotient and remainder works, its magic.

Thanks a bunch


Basically it's a divide, where you'll get the integer part (a normal divide rounded down) and the remainder (opt. it can be calculated as the fractional part times the divisor).

E.g. 4%3 = 1.33 rounded down = 1, 3*1 is however 3, so the remainder is 1. Q=1, R=1

It can also be described as "You can remove 3 from 4 1 time(s), and that'll leave you with 1 rest/remainder/unused"

 

11%4 "You can remove 4 from 11 2 time(s), and that'll leave you with 3 rest"

11%4 = 2,75 = Q 2, R (11-2*4 alt. 0,75*4) 3 = Q 2, R 3

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 6
(3,082 Views)