Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keep Alive Timer 1

Status
Not open for further replies.

KingKea

Programmer
Dec 29, 2004
11
US
I am more familar with the basic macro language of kea! or aspect in procom, but am stuck with using EXTRA! 7.11 on this task, and am having trouble writting a basic keep alive timer.

I just need to send a "R<ENTER>" every 2 minutes if the screen does not refresh.

I tried to record a macro and mess around with the WaitHostQuiet, but cant figure out how to loop it forever.
 
What are you trying to accomplish by keeping your connection alive?
Code:
Declare Sub Wait(Sess As Object)

Sub Main()
   Dim Sys As Object, Sess As Object

   Set Sys = CreateObject("Extra.System")

   If Sys Is Nothing Then
      MsgBox ("Could not create Extra.System...is E!PC installed on this machine?")
      Exit Sub
   End If

   Set Sess = Sys.ActiveSession

   If Sess Is Nothing Then
      MsgBox ("No session available...stopping macro playback.")
      Exit Sub
   End If
   
   Do While (1)
      Sess.Screen.SendKeys ("R<ENTER>")
      Call Wait(Sess)
      Sess.Screen.WaitHostQuiet (3000) '   3000 <- 3 seconds
                                       ' 120000 <- 2 mins
   Loop
   
   Set Sess = Nothing
   Set Sys = Nothing
End Sub

Sub Wait(Sess As Object)
   Do While Sess.Screen.OIA.Xstatus <> 0
      DoEvents
   Loop
End Sub
 
Thanks a bunch, nice to know the right way to do it, previously in KEA!420 I would just loop two different macros against each other, another feature left out of Extra!.
 
Sorry, I didn't see your question in the solution. It's not really a "keep alive" timer, as much as it is a screen refresher. The program that I am accessing doesn't realiably refresh the data on a specific interval, but will refresh if manually keyed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top