LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lapsed time incorrect format on seconds

Solved!
Go to solution

Hi,

 

The attached VI keeps tract of elapsed time and I am having a problem with the format in the seconds section. It gives me 3 digits and does not count the seconds correctly.

 

I would like to have only 2 digits for the seconds and count correctly as 01, 02 .. 09, 10, 11, . . . 59  (seconds section).  

 

Could someone suggest a change to attached VI?

 

Thanks,

 

frn

0 Kudos
Message 1 of 5
(2,540 Views)
Solution
Accepted by topic author frn

The reason you are not seeing the right number is that the value you get out of the last Quotient & Remainder Function is NOT the seconds, but MILIseconds.

Add one more Quotient & Remainder with a 1000 as y. Then take the floor(x/y) as your seconds.

 

Message 2 of 5
(2,536 Views)

If you do not need a string output, consider subtracting timestamps and formatting the numeric display of the difference as Relative Time.

 

Lynn

 

Time display.png

0 Kudos
Message 3 of 5
(2,528 Views)

Thanks dkfire,

 

It works great!

 

frn

0 Kudos
Message 4 of 5
(2,512 Views)

Thanks Lynn for your input, but I need string as an output.  

 

frn

 

0 Kudos
Message 5 of 5
(2,511 Views)