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!

waitquiet problem

Status
Not open for further replies.

EDHills

Programmer
Jan 24, 2007
35
US
Hi, here is my predicament.

I'm running a number of reports and sometimes capture stops transmitting anything in the middle of one job and instead of running reports all night, I come in in the morning and find it stopped on one of the reports. I want to make it so that I can timeout if the report doesn't finish, or if it looks like we're not getting any more line activity.


here's what I'm doing now, which causes it to hang forever if the line activity goes away..

waitfor "REPORT COMPLETE" FOREVER



I'm trying to make it so that if there is no line activity it can abort the current report and then go place another call and process another one.



I am trying a "while 1" loop and only bail out when the "REPORT COMPLETE" has surfaced, or, the capture has gone
idle indicating that no input is coming through over the line so I can start processing the next job. What happens is that the REPORT COMPLETE will occur and be waiting for a carriage return from me and the code path that will execute is the ; CAPTURE IS IDLE

Does anyone have a possible suggestion for me? I'm still digging and reading, but I'm getting frustrated.. thanks



proc WaitForCompleteOrIdle
while 1
; Has the report been generated?
waitfor "REPORT COMPLETE" 1
if SUCCESS
; "REPORT COMPLETE EXIT WHILE" )
exitwhile ; The report has been generated
else
; "REPORT NOT COMPLETE" )
endif

; Has capture not given us anything for 15 secs?
waitquiet 15 30 ; waitquiet reports FAILURE when capture is still active
if SUCCESS
; CAPTURE IS IDLE
disconnect ; hang up..
call retry_line_later ; retry current job later
exitwhile ;

else
; CAPTURE IS NOT IDLE

endif

endwhile
endproc ; WaitForCompleteOrIdle
 
So, I thought I'd post the answer just in case somone else runs into a similiar problem in the future. This is how I solved the problem.


proc WaitForCompleteOrIdle
when quiet 15 call ProcHangUp
bWatchForReportComplete = 1

while bWatchForReportComplete
waitfor "REPORT COMPLETE" 1
if SUCCESS
;;REPORT COMPLETE" )
bWatchForReportComplete = 0
when quiet CLEAR
endif
endwhile
endproc

proc ProcHangUp
call DoSomethingProc
bWatchForReportComplete = 0
disconnect ; hangup
endproc


 
ED, thanks for posting your solution. I was trying to work out a method of using time, but it devolved into a mess trying to get it to work.
 
I figure if I'm going to ask the occasional question I should also be a contributor rather than just a taker ;)

thanks for trying
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top