News:

  • June 11, 2026, 11:10:06 PM

Login with username, password and session length

Author Topic: can a timer only be in seconds?  (Read 9360 times)

maciek

  • Sr. Member
  • ****
  • Posts: 95
can a timer only be in seconds?
« 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
« Last Edit: April 03, 2019, 08:09:20 PM by maciek »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: can a timer only be in seconds?
« Reply #1 on: April 04, 2019, 08:36:48 AM »
C-more should support setting the resolution of the display of a timer.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: can a timer only be in seconds?
« Reply #2 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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

maciek

  • Sr. Member
  • ****
  • Posts: 95
Re: can a timer only be in seconds?
« Reply #3 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

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: can a timer only be in seconds?
« Reply #4 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"