Graphics

 View Only
  • 1.  Timer to seconds

    Posted 03-04-2021 01:34

    I am wondering if there is a way to convert an incoming clock data feed to seconds?

    The incoming clock is in the MM:SS format and I want to just count up just in seconds so instead of 1:30 it would be 90. I have exhausted my understanding of visual logic and scripting, not even sure this is possible. Any help is greatly appreciated.

     

    Thanks



  • 2.  RE: Timer to seconds

    Posted 03-04-2021 14:11

    Try changing to NN:SS and that might help out.


    #XPression


  • 3.  RE: Timer to seconds

    Posted 03-04-2021 16:00

    Hi

    I'm assuming you have a text box that has the incoming clock data assigned to it (widget or datalinq). Put this code in the OnSetText event.

    This will change the incoming text to seconds. So if it comes in as 04:23, it will leave as 263.

    Simon

    dim split() as string
    dim mins as integer
    dim secs as integer
    if text.contains(":") then
    split=text.split(":")
    integer.tryparse(split(0), mins)
    integer.tryparse(split(1), secs)
    secs+= mins * 60
    else
    integer.tryparse(text, secs)
    end if

    text = secs.tostring

    #XPression


  • 4.  RE: Timer to seconds

    Posted 03-05-2021 00:56

    that works perfect, thank you. 


    #XPression