Stopping Timer Object in vXh

This is a discussion on Stopping Timer Object in vXh within the xharbour forums in Programming Languages category; I am using a 1 second timer object to update some variables on screen every second in vXh. When I try to use the serial functions to answer an inbound modem call on Com 1, the timer aborts my connection each second. If I make the timer longer, I am able to answer the modem call but I lose the data updating to the screen. Is there a way to suspend the timer in code until my modem comm is completed? If so, what is the syntax ?...

Go Back   Application Development Forum > Programming Languages > xharbour

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-09-2008, 03:40 PM
Ed J
Guest
 
Default Stopping Timer Object in vXh

I am using a 1 second timer object to update some variables on screen
every second in vXh. When I try to use the serial functions to answer
an inbound modem call on Com 1, the timer aborts my connection each
second. If I make the timer longer, I am able to answer the modem
call but I lose the data updating to the screen. Is there a way to
suspend the timer in code until my modem comm is completed? If so,
what is the syntax ?
Reply With Quote
  #2  
Old 08-09-2008, 04:39 PM
Ella Stern
Guest
 
Default Re: Stopping Timer Object in vXh

Ed,

Clicking on your timer and take a look on the Object Manager, you can see
that by default the AUTORUN property is turned on. If you don't need your
timer to start together with your .exe, then turn AUTORUN to FALSE.
I think in case of listening a port is better to start the timer by code,
for example in this way:

METHOD Form1_OnLoad( Sender ) CLASS Form1
....
::Timer1:Start()
....
RETURN Self

and in the OnTimeOut method you can manage to restart the timer as many
times you wish - a GLOBAL variable can be used for looping.

METHOD Timer1_OnTimeOut( Sender ) CLASS Form1
if .....
.....
Sender:Start()
else
....
endif
RETURN Self

With ::myTimer:Stop() the timer can be stopped - usually elsewhere in your
code.

Ella

"Ed J" <foodwatch2003@yahoo.com> wrote in message
news:965b8491-9733-4149-91f6-233fd813471b@k13g2000hse.googlegroups.com...
>I am using a 1 second timer object to update some variables on screen
> every second in vXh. When I try to use the serial functions to answer
> an inbound modem call on Com 1, the timer aborts my connection each
> second. If I make the timer longer, I am able to answer the modem
> call but I lose the data updating to the screen. Is there a way to
> suspend the timer in code until my modem comm is completed? If so,
> what is the syntax ?



Reply With Quote
  #3  
Old 08-09-2008, 10:30 PM
Ed J
Guest
 
Default Re: Stopping Timer Object in vXh

On Aug 9, 4:39*pm, "Ella Stern" <ellail...@gmail.com> wrote:
> Ed,
>
> Clicking on your timer and take a look on the Object Manager, you can see
> that by default the AUTORUN property is turned on. If you don't need your
> timer to start together with your .exe, then *turn AUTORUN to FALSE.
> I think in case of listening a port *is better to start the timer by code,
> for example in this way:
>
> METHOD Form1_OnLoad( Sender ) CLASS Form1
> * *....
> * *::Timer1:Start()
> * *....
> RETURN Self
>
> and in the OnTimeOut method you can manage to restart the timer as many
> times you wish - a GLOBAL variable can be used for looping.
>
> METHOD Timer1_OnTimeOut( Sender ) CLASS Form1
> * *if .....
> * * * .....
> * * * Sender:Start()
> * *else
> * * * ....
> * *endif
> RETURN Self
>
> With ::myTimer:Stop() *the timer can be stopped - usually elsewhere in your
> code.
>
> Ella
>
> "Ed J" <foodwatch2...@yahoo.com> wrote in message
>
> news:965b8491-9733-4149-91f6-233fd813471b@k13g2000hse.googlegroups.com...
>
>
>
> >I am using a 1 second timer object to update some variables on screen
> > every second in vXh. *When I try to use the serial functions to answer
> > an inbound modem call on Com 1, the timer aborts my connection each
> > second. *If I make the timer longer, I am able to answer the modem
> > call but I lose the data updating to the screen. *Is there a way to
> > suspend the timer in code until my modem comm is completed? *If so,
> > what is the syntax ?- Hide quoted text -

>
> - Show quoted text -


Thanks for the info Ella. As it turns out I am monitoring the port
for a ring detect, then answering and capturing a predefined packet
length. I found I could change the time on the timer on the fly, so I
simply extend the timer beyond the last possible time data would fill
the buffer, then reset the timer back to 1 second to return to normal
operation. This allows me to always have a timer running to catch any
unexpected events. I will try your suggestion tomorrow. Thanks again.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:00 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.