Host Engineering Forum

General Category => General Discussion => Topic started by: maciek on April 03, 2019, 07:49:27 PM

Title: can a timer only be in seconds?
Post by: maciek on April 03, 2019, 07:49:27 PM
i am trying to display remaining time on the c more hmi but i only care for seconds and minutes, milliseconds kind of make it confusing. Any ideas? all for brx
click has an easy option
Title: Re: can a timer only be in seconds?
Post by: franji1 on April 04, 2019, 08:36:48 AM
C-more should support setting the resolution of the display of a timer.
Title: Re: can a timer only be in seconds?
Post by: BobO on April 04, 2019, 09:13:37 AM
As an alternative, use STRPRINT to put the timer into a string in the format you want.
Title: Re: can a timer only be in seconds?
Post by: maciek on September 08, 2019, 07:42:29 PM
a little late but can you show me how to use strprint and change ms timer to seconds
Title: Re: can a timer only be in seconds?
Post by: franji1 on September 09, 2019, 09:16:36 AM
for all the details, see Help topic DMD0168, String Scripting Language Reference

FmtTMR - Timer Accumulator Formatting Function

FmtTMR(<tmrelement> | <numericelement> [, smart | full], [sec | tenths | hundredths | thousandths])

smart vs. full -
smart - only displays significant hour and minute time values
full - always displays hour and minute values

so
STRPRINT SS0 "FmtTmr(T0, full, sec)"
will display T0 accumulator full hours/minutes/seconds to a resolution of seconds.
So a .Acc value of 0 will be "0:00:00"
.Acc value of 3,600,000 will be "1:00:00"

STRPRINT SS0 "FmtTmr(T0, smart, sec)"
will be
"0:00"
and
"1:00:00"