Results 1 to 7 of 7

Thread: Timer Function

  1. #1

    Timer Function

    Hello

    I am trying to run this code:

    ////////////////////////////////////////////////////////////////
    // Event delegate for 'timer' event
    proc page1_Section1_field1_timer()
    // insert your code here
    if ComForm.PortOpen=.T.
    Do Case
    Case m_sent=.T.
    If ComForm.Inbuffercount=15 && Data is wating in the input buffer
    ret=ComForm.Input
    m_sent=.F.
    Endif
    Case m_sent=.F.
    ComForm.Output=Chr(87)+Chr(13)
    m_sent=.T.
    Endcase
    Endif
    endproc

    I can't get the timer to run. Any help would be greatly appreciated.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,368
    Blog Entries
    22
    Timers only fire in runtime mode.

    Switch you app into runtime mode to test them.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Hello
    How do i run an app in Runtime mode ?

  4. #4
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,196
    Name:  test_desitop_2024-05-18_17-45-52.png
Views: 152
Size:  28.7 KB

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,368
    Blog Entries
    22
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  6. #6
    Got it working. is there any way to set the timer below 1 second ?

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,368
    Blog Entries
    22
    I’m afraid not no.

    Polling like this using a timer is going to affect the UI performance.

    The serialport class in the next release has compatibility with many of the MSCOMM properties and methods.

    It fires a readyread event when there is data in the buffer to read.

    You may want to look at that.
    https://www.lianja.com/doc/index.php/Serialport

    You can find details on how to use the framework classes at:
    https://www.lianja.com/doc/index.php...mework_Classes
    Last edited by barrymavin; 2024-05-19 at 10:37.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us