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: 

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,261 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,257 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,249 Views)

Thanks dkfire,

 

It works great!

 

frn

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

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

 

frn

 

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