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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script time out??

Status
Not open for further replies.

mailbox125

Technical User
Apr 1, 2003
44
0
0
US
This script will only run for about 5 min.?? I can't see anything in the script that would be causeing this is this something in Procomm? and if so what??


;DIAL-REPORTS1.WAS v1.0

;*****************************************************************************
;* DIAL-REPORTS1.WAS *
;* Copyright (C) 2003 IVAN SOLKEY *
;* All rights reserved. *
;* *
;* Written by: IVAN SOLKEY *
;* 04/29/03 *
;* *
;* This script file calls multiple Octel 100/200/300 locations. Logs onto *
;* with the maint password sets the capture file to a client folder and runs *
;* a hard coded set of reports. *
;*****************************************************************************


;*****************************************************************************
;* MACRO DEFINITIONS *
;*****************************************************************************

#DEFINE NUMBEROFCALLS 4

;*****************************************************************************
;* GLOBAL VARIABLES *
;*****************************************************************************

string NumberToDial ;holds number to dial
string Passw,Pos,CapLog
integer Row=0,Col=1
Long SystemVar,LinkVar


;*****************************************************************************
;* *
;* MAIN *
;* The Main procedure call to CapLog to move data to report files, *
;* calls GetNumber to get the phone number to dial, calls *
;* PlaceCall to dial the number, calls Setmodem to set modem to 7,e,1, Calls *
;* Getpass to get the password from a Excel DB, calls RunReports to collect *
;* data from each system, *
;* *
;* Calls: CAPLOG, GETNUMBER, PLACECALL, SETMODEM, GETPASS, & RUNREPORTS *
;* Modifies globals: NONE *
;* *
;*****************************************************************************

proc main
Integer CurCall

For CurCall = 1 upto NumberOfCalls ;will loop until NumberOfCalls is reached
Row ++
Waitquiet 1
CapLogFile() ;Moves collected data the reports file
GetNumber() ;gets the current number to dial from Excel
SetModem() ;SETS THE MODEM TO 7,E,1
PlaceCall() ;calls procedure to make calls
GetPass() ;Gets password from Excel DB
RunReports() ;Collects the reports infromation

Endfor
DISCONNECT
endproc

;*****************************************************************************
;* *
;* CapLogFile() *
;* This procedure will make a call to the Excell DB sheet3 to get the name *
;* for the capture file, and write all report information into the clients *
;* own file. *
;* *
;* Calls: Excel Sheet 3 *
;* Called by:MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************

Proc CapLogFile

Set Capture Path "C:\ReportFiles"
Set Capture Overwrite ON ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query

if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet3"

else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On

endif

Endproc

;*****************************************************************************
;* *
;* GETNUMBER(CURCALL) *
;* The procedure GetNumber determines the phone number to call. *
;* *
;* NOTE: This procedure will retrieve the numbers to call from sheet1 of an *
;* Excell DB. This is Excell spreadsheet will need to be updated for *
;* any new system numbers added. *
;* *
;* *
;* Calls: Excel Sheet 1 *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************

proc GetNumber

Clear

if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet1"; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet1"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos NumberToDial ; Extract cell to NumberToDial
strreplace NumberToDial "`r`n" "" ; Remove C/R from NumberToDial
ddeterminate LinkVar
endif
else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
endproc


;*****************************************************************************
;* *
;* PLACECALL() *
;* The procedure PlaceCall dials remote system and loops while dialing. *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************

proc PlaceCall

dialnumber DATA NumberToDial ;dials the number
while $DIALING ;loops while dialing
endwhile
if $CARRIER == 0
Set Capture Path "C:\ReportFialures"
Set Capture Overwrite OFF ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query

if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet3"

strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On
Capture off
endif
endif
endproc

;****************************************************************************
;* *
;* SetModem *
;* The procedure to set the modem to 7,e,1 *
;* Set terminal to VT100 *
;* Calls: None *
;* Called by: MAIN *
;* Modifies: Modem Settings *
;* *
;*****************************************************************************

proc SetModem

set quickselect ON ; turn on Quickselect display
set statusline ON ; turn on Stusline display
set terminal type VT100
statmsg "VT100"
pause 1
set terminal type VT100
statmsg "VT100"


set port baudrate 2400 ; 2400
set port databits 7 ; 7
SET port hardflow OFF ;
set port parity EVEN ; e
SET port softflow OFF ;
set port stopbits 1 ; 1
set duplex full
pause 1

endproc

;*****************************************************************************
;* *
;* Getpass() *
;* The procedure Getpass performs a call to an Excel db sheet2 for the *
;* password to loggon to the remote system. *
;* *
;* Calls: Excel Sheet 2 *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************


proc Getpass

Waitfor "@PASSWORD:"

if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet2" ; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet2"
else
Waitquiet 1
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos Passw ; Extract cell to Passw
strreplace Passw "`r`n" "" ; Remove C/R from Passw
Waitquiet 1
Transmit Passw
Transmit "^M"
Ddeterminate LinkVar
endif

else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
Endproc

;*****************************************************************************
;* *
;* RunReports() *
;* This procedure will run all the requested reports like but limited to *
;* List Features, Disk Report, Ports report Ect... *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************


Proc RunReports

Transmit "l h^M"
Waitfor "@"
Transmit "l r 5^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..." Forever
Transmit "^M"
Waitfor "@"
Transmit "V^M"
Waitfor ">"
Transmit "L DMAP^M"
Waitfor ">"
Transmit "E^M"
Waitfor "@"
Transmit "U^M"
Waitfor "."
Waitquiet 1
Transmit "L all^M"
Waitfor "." Forever
Transmit "l app^M^M"
Waitfor "." Forever
Transmit "E^M^M"
Waitfor "@"
Transmit "PAT STA^M"
Waitquiet 1
Waitfor "@"
Transmit "^M^M^M"
Capture off

Endproc
 
I didn't see anything obviously wrong with the script. I would add some usermsg or statmsg commands at the beginning of each procedure so that you can follow along with the script and see if it is executing the steps you think it should be.


aspect@aspectscripting.com
 
Ok I added usermsg at the start of each module and the script apears to be working correctly through each one, however during the last secsion run reports it seems to time out after about 5min. something drops the line....

any sugestion? is this a Procomm issue? I can't find anything in Procomm about timers or disconnect.. Any ideas would be a great help. Thanks.
 
This is the line it stops at everytime.

Transmit "L all^M"
Waitfor "." Forever

These are in the middle of the run reports module.


it's almostlike Procomm has a timer on and time is up for this entry. I've looked all through Procomm for timers and can't find any.

Help.... and thanks for your time.
 
The waitfor "." forever command tells Procomm to wait until a period is received before processing onwards with the script. If the remote side does not send a period at any time after this command is executed, then your script will sit there indefinitely.


aspect@aspectscripting.com
 
Ok I have found something interesting, although I have the command waitfor "." forever I can see the statmsg and after about 5 min. the script will start over, start going through all the modules again and there has been no "." issued by the system I'm connected to.

any idea's??
 
There is some suspicious stuff going on in the PlaceCall procedure. You are checking to see if $CARRIER is equal to zero after the dial attempt completese, but the way the script is structured that code will only execute if the connection was not made, so your script is not retrieving any information from the spreadsheet if you do connect. I also think there should be an else statement after the errormsg command in that procedure based on the way you have the other procedures structured.


aspect@aspectscripting.com
 
Ok I have taken the loop off the $dialing and added an else. I was trying to get the system to report the systems it was not able to connect to... this script is still running over itself. I tried adding a waitfor "." forever at the end of the main with no sucsess. ?????????? I'm stumpt.... any idea's would be helpfull Thanks.

proc PlaceCall
Statmsg "PLACE THE CALL"
dialnumber DATA NumberToDial ;dials the number
$DIALING ;loops while dialing

if $CARRIER == 0
Set Capture Path "C:\ReportFialures"
Set Capture Overwrite OFF ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
else
if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet1"

else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On
Capture off
endif
endif
endproc
 
Try this, I added back in the loop while dialing (otherwise the script will get ahead of the connection) and changed the if $CARRIER check to check for 1 (so the code is only run if connected).

proc PlaceCall
Statmsg "PLACE THE CALL"
dialnumber DATA NumberToDial ;dials the number
while $DIALING ;loops while dialing
yield
endwhile

if $CARRIER == 1
Set Capture Path "C:\ReportFialures"
Set Capture Overwrite OFF ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
else
if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet1"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On
Capture off
endif
endif
endproc

aspect@aspectscripting.com
 
Ok Knob... I did try this script you suggested but it still just runs over itself... I tried a waitfor "." forever at the end of the main but that didn't work.. Help this does everything I need it to do but it won't wait before dialing the next number.... what else can I try????
 
I really want to thank you for looking at this I've tried everything I can think of but this just won't wait for the reports to finnish before going to the next record. In the dial number module the checking for connect was there to give me a list of the systems the script was unable to connect with, but if that's what you think is the cause of this script not waiting, it can just be removed. Thanks again for you time.



;DIAL-REPORTS1.WAS v1.0

;*****************************************************************************
;* DIAL-REPORTS1.WAS *
;* Copyright (C) 2003 IVAN SOLKEY *
;* All rights reserved. *
;* *
;* Written by: IVAN SOLKEY *
;* 04/29/03 *
;* *
;* This script file calls multiple Octel 100/200/300 locations. Logs onto *
;* with the maint password sets the capture file to a client folder and runs *
;* a hard coded set of reports. *
;*****************************************************************************


;*****************************************************************************
;* MACRO DEFINITIONS *
;*****************************************************************************

#DEFINE NUMBEROFCALLS 4

;*****************************************************************************
;* GLOBAL VARIABLES *
;*****************************************************************************

string NumberToDial ;holds number to dial
string Passw,Pos,CapLog
integer Row=0,Col=1
Long SystemVar,LinkVar


;*****************************************************************************
;* *
;* MAIN *
;* The Main procedure call to CapLog to move data to report files, *
;* calls GetNumber to get the phone number to dial, calls *
;* PlaceCall to dial the number, calls Setmodem to set modem to 7,e,1, Calls *
;* Getpass to get the password from a Excel DB, calls RunReports to collect *
;* data from each system, *
;* *
;* Calls: CAPLOG, GETNUMBER, PLACECALL, SETMODEM, GETPASS, & RUNREPORTS *
;* Modifies globals: NONE *
;* *
;*****************************************************************************

proc main
Integer CurCall

For CurCall = 1 upto NumberOfCalls ;will loop until NumberOfCalls is reached
Row ++
Waitquiet 1
CapLogFile() ;Moves collected data the reports file
GetNumber() ;gets the current number to dial from Excel
SetModem() ;SETS THE MODEM TO 7,E,1
PlaceCall() ;calls procedure to make calls
GetPass() ;Gets password from Excel DB
RunReports() ;Collects the reports infromation

Endfor
DISCONNECT
endproc

;*****************************************************************************
;* *
;* CapLogFile() *
;* This procedure will make a call to the Excell DB sheet3 to get the name *
;* for the capture file, and write all report information into the clients *
;* own file. *
;* *
;* Calls: Excel Sheet 3 *
;* Called by:MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************

Proc CapLogFile
Statmsg "SET CAP LOG"
Set Capture Path "C:\ReportFiles"
Set Capture Overwrite ON ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query

if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet3"

else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On

endif

Endproc

;*****************************************************************************
;* *
;* GETNUMBER(CURCALL) *
;* The procedure GetNumber determines the phone number to call. *
;* *
;* NOTE: This procedure will retrieve the numbers to call from sheet1 of an *
;* Excell DB. This is Excell spreadsheet will need to be updated for *
;* any new system numbers added. *
;* *
;* *
;* Calls: Excel Sheet 1 *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************

proc GetNumber

Clear
Statmsg "GET PHONE NUMBER"
if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet1"; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet1"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos NumberToDial ; Extract cell to NumberToDial
strreplace NumberToDial "`r`n" "" ; Remove C/R from NumberToDial
ddeterminate LinkVar
endif
else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
endproc


;*****************************************************************************
;* *
;* PLACECALL() *
;* The procedure PlaceCall dials remote system and loops while dialing. *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************

proc PlaceCall
Statmsg "PLACE THE CALL"
dialnumber DATA NumberToDial ;dials the number
while $DIALING ;loops while dialing
yield
endwhile

if $CARRIER == 1
Set Capture Path "C:\ReportFialures"
Set Capture Overwrite OFF ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
else
if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet1"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On
Capture off
endif
endif
Endproc

;****************************************************************************
;* *
;* SetModem *
;* The procedure to set the modem to 7,e,1 *
;* Set terminal to VT100 *
;* Calls: None *
;* Called by: MAIN *
;* Modifies: Modem Settings *
;* *
;*****************************************************************************

proc SetModem
Statmsg "SET THE MODEM"
set quickselect ON ; turn on Quickselect display
set statusline ON ; turn on Stusline display
set terminal type VT100
statmsg "VT100"
pause 1
set terminal type VT100
statmsg "VT100"


set port baudrate 2400 ; 2400
set port databits 7 ; 7
SET port hardflow OFF ;
set port parity EVEN ; e
SET port softflow OFF ;
set port stopbits 1 ; 1
set duplex full
pause 1

endproc

;*****************************************************************************
;* *
;* Getpass() *
;* The procedure Getpass performs a call to an Excel db sheet2 for the *
;* password to loggon to the remote system. *
;* *
;* Calls: Excel Sheet 2 *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************


proc Getpass
Statmsg "GET PASSWORD FROM EXCELL"
Waitfor "@PASSWORD:"

if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet2" ; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet2"
else
Waitquiet 1
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos Passw ; Extract cell to Passw
strreplace Passw "`r`n" "" ; Remove C/R from Passw
Waitquiet 1
Transmit Passw
Transmit "^M"
Ddeterminate LinkVar
endif

else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
Endproc

;*****************************************************************************
;* *
;* RunReports() *
;* This procedure will run all the requested reports like but limited to *
;* List Features, Disk Report, Ports report Ect... *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************


Proc RunReports
Statmsg "RUN THE REPORTS"

Transmit "l h^M"
Waitfor "@"
Transmit "l r 5^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..." Forever
Transmit "^M"
Waitfor "@"
Transmit "V^M"
Waitfor ">"
Transmit "L DMAP^M"
Waitfor ">"
Transmit "E^M"
Waitfor "@"
Transmit "U^M"
Waitfor "."
Waitquiet 1
Transmit "L all^M"
Waitfor "." Forever
Transmit "l app^M^M"
Waitfor "." Forever
Transmit "E^M^M"
Waitfor "@"
Transmit "PAT STA^M"
Waitquiet 1
Waitfor "@"
Transmit "^M^M^M"
Capture off

Endproc
 
OK, I misunderstood what was going on with the if $CARRIER==0 statement. I changed the script so that the three set capture statements are run if the connection was not made, otherwise the script gets the value of the capture file from the spreadsheet.

When you say the script starts over, is this based on observing the script or the capture files? I noticed that you are turning on and turning off the capture files in two different places. I commented out one of the capture on and one of the capture off commands so the capture file is opened only in the PlaceCall procedure after a connection has been established, and the only capture off command is at the end of the RunReports procedure.

I also moved the disconnect command in the main procedure from outside the for loop to just at the end of the contents inside the for loop so that the modem will disconnect when the RunReports procedure is complete.

Here is the updated script to test, let me know how it works for you:

;DIAL-REPORTS1.WAS v1.0

;*****************************************************************************
;* DIAL-REPORTS1.WAS *
;* Copyright (C) 2003 IVAN SOLKEY *
;* All rights reserved. *
;* *
;* Written by: IVAN SOLKEY *
;* 04/29/03 *
;* *
;* This script file calls multiple Octel 100/200/300 locations. Logs onto *
;* with the maint password sets the capture file to a client folder and runs *
;* a hard coded set of reports. *
;*****************************************************************************


;*****************************************************************************
;* MACRO DEFINITIONS *
;*****************************************************************************

#DEFINE NUMBEROFCALLS 4

;*****************************************************************************
;* GLOBAL VARIABLES *
;*****************************************************************************

string NumberToDial ;holds number to dial
string Passw,Pos,CapLog
integer Row=0,Col=1
Long SystemVar,LinkVar


;*****************************************************************************
;* *
;* MAIN *
;* The Main procedure call to CapLog to move data to report files, *
;* calls GetNumber to get the phone number to dial, calls *
;* PlaceCall to dial the number, calls Setmodem to set modem to 7,e,1, Calls *
;* Getpass to get the password from a Excel DB, calls RunReports to collect *
;* data from each system, *
;* *
;* Calls: CAPLOG, GETNUMBER, PLACECALL, SETMODEM, GETPASS, & RUNREPORTS *
;* Modifies globals: NONE *
;* *
;*****************************************************************************

proc main
Integer CurCall

For CurCall = 1 upto NumberOfCalls ;will loop until NumberOfCalls is reached
Row ++
Waitquiet 1
CapLogFile() ;Moves collected data the reports file
GetNumber() ;gets the current number to dial from Excel
SetModem() ;SETS THE MODEM TO 7,E,1
PlaceCall() ;calls procedure to make calls
GetPass() ;Gets password from Excel DB
RunReports() ;Collects the reports infromation
DISCONNECT
Endfor

endproc

;*****************************************************************************
;* *
;* CapLogFile() *
;* This procedure will make a call to the Excell DB sheet3 to get the name *
;* for the capture file, and write all report information into the clients *
;* own file. *
;* *
;* Calls: Excel Sheet 3 *
;* Called by:MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************

Proc CapLogFile
Statmsg "SET CAP LOG"
Set Capture Path "C:\ReportFiles"
Set Capture Overwrite ON ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query

if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet3"

else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
; Capture On

endif

Endproc

;*****************************************************************************
;* *
;* GETNUMBER(CURCALL) *
;* The procedure GetNumber determines the phone number to call. *
;* *
;* NOTE: This procedure will retrieve the numbers to call from sheet1 of an *
;* Excell DB. This is Excell spreadsheet will need to be updated for *
;* any new system numbers added. *
;* *
;* *
;* Calls: Excel Sheet 1 *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************

proc GetNumber

Clear
Statmsg "GET PHONE NUMBER"
if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet1"; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet1"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos NumberToDial ; Extract cell to NumberToDial
strreplace NumberToDial "`r`n" "" ; Remove C/R from NumberToDial
ddeterminate LinkVar
endif
else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
endproc


;*****************************************************************************
;* *
;* PLACECALL() *
;* The procedure PlaceCall dials remote system and loops while dialing. *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************

proc PlaceCall
Statmsg "PLACE THE CALL"
dialnumber DATA NumberToDial ;dials the number
while $DIALING ;loops while dialing
yield
endwhile

if $CARRIER == 0
Set Capture Path "C:\ReportFialures"
Set Capture Overwrite OFF ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
else
if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet1"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
Capture On
; Capture off
endif
endif
Endproc

;****************************************************************************
;* *
;* SetModem *
;* The procedure to set the modem to 7,e,1 *
;* Set terminal to VT100 *
;* Calls: None *
;* Called by: MAIN *
;* Modifies: Modem Settings *
;* *
;*****************************************************************************

proc SetModem
Statmsg "SET THE MODEM"
set quickselect ON ; turn on Quickselect display
set statusline ON ; turn on Stusline display
set terminal type VT100
statmsg "VT100"
pause 1
set terminal type VT100
statmsg "VT100"


set port baudrate 2400 ; 2400
set port databits 7 ; 7
SET port hardflow OFF ;
set port parity EVEN ; e
SET port softflow OFF ;
set port stopbits 1 ; 1
set duplex full
pause 1

endproc

;*****************************************************************************
;* *
;* Getpass() *
;* The procedure Getpass performs a call to an Excel db sheet2 for the *
;* password to loggon to the remote system. *
;* *
;* Calls: Excel Sheet 2 *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************


proc Getpass
Statmsg "GET PASSWORD FROM EXCELL"
Waitfor "@PASSWORD:"

if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet2" ; Set up link to spreadsheet.

errormsg "Couldn't establish DDE link to spreadsheet sheet2"
else
Waitquiet 1
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos Passw ; Extract cell to Passw
strreplace Passw "`r`n" "" ; Remove C/R from Passw
Waitquiet 1
Transmit Passw
Transmit "^M"
Ddeterminate LinkVar
endif

else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
Endproc

;*****************************************************************************
;* *
;* RunReports() *
;* This procedure will run all the requested reports like but limited to *
;* List Features, Disk Report, Ports report Ect... *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************


Proc RunReports
Statmsg "RUN THE REPORTS"

Transmit "l h^M"
Waitfor "@"
Transmit "l r 5^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..." Forever
Transmit "^M"
Waitfor "@"
Transmit "V^M"
Waitfor ">"
Transmit "L DMAP^M"
Waitfor ">"
Transmit "E^M"
Waitfor "@"
Transmit "U^M"
Waitfor "."
Waitquiet 1
Transmit "L all^M"
Waitfor "." Forever
Transmit "l app^M^M"
Waitfor "." Forever
Transmit "E^M^M"
Waitfor "@"
Transmit "PAT STA^M"
Waitquiet 1
Waitfor "@"
Transmit "^M^M^M"
Capture off

Endproc


aspect@aspectscripting.com
 
Hi, well I like the changes you made, however the script is still not waiting for the run reports to complete?? by watching the statmsg at the bottom of Procomm the script will start over... The other thing is now the number being dialed is not displayed when the call is placed.. not a big deal.. I've looked throgh this so many times and can't find anything in the script that would cause this, I've also gone through all the settings in Procomm and I don't see anything in there that would be causeing this. I have several other scripts that run off a csv file that don't time out... could this have something to do with Excel??? Thanks again for your time.
 
Try changing one (or both) of the waitfor "." forever commands so they use a bit longer and unique string, such as a command prompt that may be displayed after a command has finished execution. I'm guessing that a period is coming across, possibly as part of an escape sequence, that is not printed on the screen and the script proceeds on when it shouldn't.


aspect@aspectscripting.com
 
Humm... well I took out the forever command after the waitfor "." and the script stopped in the same place, and unfortunatlly the "." that I'm waitting for is the only thing returned from the remote system at the end of that particular command. Any idea's... I'm going to try putting in a line that will cause the system to return an error msg and maybe I can use the waitfor on the error echo, not very clean I know but if you have any other idea's I'd really love to hear them.... Again thanks for your time and continued sucsess.
 
Did you write the code in the RunReports procedure yourself, or did you use Procomm's script recorder? You might try using the script recorder to see if it comes up with something that works better. Here is some information on it:

If you are trying to create a script that automates communications with a remote system and the text is relatively constant, you can make the task easier by using the Script Recorder to create your script. To enable the Script Recorder, select the Tools | Scripts | Start Recorder menu item. Procomm Plus will now monitor all incoming data and your outgoing responses to that data. Start performing the tasks (keyboard-based only!) that you want Procomm Plus to record. Once done, select the Tools | Scripts | Stop Recorder menu item. You will be prompted to save your recorded script; some editing of the script may be necessary. When you view your script, you will see that it is composed of waitfor/transmit commands. If all looks well, compile your script and see if it executes as expected.

aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top