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!

Changing port parity in Pw 4.8

Status
Not open for further replies.

frda

Technical User
Feb 14, 2002
25
BE
Hello,

I have written a script that automaticaly adapts the parity, databits and stopbits and it works fine but when I execute this script from another script, it fails.

Any suggestions?
 
Are you saying if you launch your script from another script using the execute command that the script (which worked fine in a standalone mode) does not work correctly now? I haven't had a chance to play around with this problem yet (no modem on my work machine), but have you tried using execute "script_name" SHARED instead to see if that works correctly?
 
It seems that procomm does accept the change eg when working on 8-N-1 and it detects 7-M-1, in the quick select line it stays on 8-N-1 but when you click on it, it shows 7-M-1.

I tried the SHARED thing, but it didn't solve the problem.

Kind regards
 
Can you post the contents of the script you are executing? I played around with this a little tonight and didn't see the problem, but I may be doing something differently. Are you using a modem or direct connection? Are you enabling modem command mode at some point (either manually or via your script)?
 
Here ya go,

The first script is writtten to dial all the entries in a given dialing directory, automatically log into the system (2nd script) and finaly execute a 3rd (free to select) script once the connection is established and logged into the system. I also built in a sort of schedule capability into the first one!

First script:

#define empty(a) if nullstr a
#define errmsg1 usermsg "Please fill out all fields!"
#define rust mspause 50

integer BOX0 ;Dialog box
integer NB_DIR ;Number of directories
integer NB_CUST = 0 ;Number of customers in dialdir
integer i, k = 1 ;Tellers
integer ERRCODE = 0
integer ID, RETVAL

long TIJD, TIMEVAL1, TIMEVAL2

string exeDATE, exeTIME
string CHOICE = "Execute Now,Scheduled"
string EXEC ;Choice : Shedule script YES/NO
string IPC_ID ;IPC user ID to use
string IPC_PASS ;IPC Password to use
string NB_DIRS
string DIR_NAME [5] ;Dialing directory names
string CUST_NAME = ""
string CUST_PHONE = ""
string SCRIPT ;Scriptname to launge
string SUMMARY = "c:\copy\temp\Modemlog.txt"
string _MODEM = "c:\program files\symantec\procomm plus\aspect\Login.wax"
string DIR_PATH
string ZONE, TEL
string REPERTOIRE = "Failed.dir"

proc main

set txpace 150

call INPUT

S0 = IPC_ID
S1 = IPC_PASS
i = 1

if not isfile REPERTOIRE
dialcreate REPERTOIRE
endif

if strcmp "Scheduled" EXEC
waituntil exeTIME exeDATE
endif

for i upto NB_DIR

dialload DIR_NAME
dialcount DATA NB_CUST
for k = 0 upto NB_CUST-1
termreset
s2 = ""
s3 = ""
s4 = ""
s5 = ""
s6 = ""
s7 = ""
s8 = ""
s9 = ""
ERRCODE = 0
i0 = 0
pause 1
dialname DATA k CUST_NAME
set dialentry access DATA CUST_NAME
fetch dialentry areacode ZONE
fetch dialentry phonenumber TEL
dial DATA CUST_NAME
TIJD = $LTIME+105
strupr S0
strupr S1
if nullstr $USERID
pause 3
dialcancel current
ERRCODE = 5
goto PROCEED
endif
if nullstr $PASSWORD
pause 3
dialcancel current
ERRCODE = 5
goto PROCEED
endif
while 1
switch $carrier
case 0
if $LTIME >= TIJD
ERRCODE = 1
dialcancel current
goto PROCEED
endif
endcase
case 1
exitwhile
endcase
endswitch
endwhile
while 1
switch ERRCODE
case 0
exitwhile
endcase
case 5
hangup
goto proceed
endcase
endswitch
endwhile
pause 1
execute _MODEM
ERRCODE = i0
if ERRCODE != 0
goto proceed
endif
mspause 250
execute SCRIPT
ERRCODE = i0
if ERRCODE != 0
goto proceed
endif
pause 1
transmit "****^M"
rust
transmit "LOGO^M"
pause 2
set txpace 0
termreset
hangup
proceed:
pause 1
call _SUM
pause 1
endfor
endfor

set txpace 0
endproc

proc input

dialogbox 0 165 62 210 151 11 "Script launger"
text 2 19 51 26 11 "IPC_ID:" left
text 3 19 63 44 11 "IPC_PASS:" left
editbox 4 53 48 50 11 IPC_ID
editbox 5 67 62 36 11 IPC_PASS MASKED
text 6 18 78 34 11 "SCRIPT:" left
editbox 7 54 77 48 11 SCRIPT
combobox 8 121 48 58 42 DROPDOWNLIST CHOICE EXEC SORT
text 9 119 75 45 11 "NB_DIRS:" left
editbox 10 168 75 20 11 NB_DIRS
pushbutton 12 45 119 40 13 "&Ok" OK DEFAULT
pushbutton 13 135 119 40 13 "&Cancel" CANCEL
ftext 14 9 2 192 32 "C:\Program Files\symantec\Procomm Plus\Aspect\SL_init.txt"
enddialog


dlgupdate 0 1
while 1
dlgevent 0 BOX0
switch BOX0
case 12
exitwhile
endcase
case 13
exit
endcase
endswitch
endwhile
empty(IPC_ID)
errmsg1
call INPUT
endif
empty(IPC_PASS)
errmsg1
call INPUT
endif
empty(EXEC)
errmsg1
call INPUT
endif
empty(NB_DIRS)
errmsg1
call INPUT
endif
empty(SCRIPT)
errmsg1
call INPUT
endif

strtonum NB_DIRS NB_DIR
DIR_NAME = " "
for i = 1 upto NB_DIR
DIR_PATH = "c:\program files\symantec\procomm plus\"
sdlginput "Directory name" "Enter Directory name:" DIR_NAME
strcat DIR_PATH DIR_NAME
DIR_NAME = DIR_PATH
usermsg DIR_NAME
endfor
if strcmp "Scheduled" EXEC
TIMEVAL1 = TIMEVAL2 = 0
if dllload "ASPTIME.DLL" ID
dllcall id "ASPLTIME" $pwmainwin 2 RETVAL TIMEVAL1 "Select TIME and DATE" " Please select execution DATE: " " Please select execution TIME: "
ltimestrs TIMEVAL1 exeDATE exeTIME
endif
if retval == 1
usermsg "The date and time selected are:`n%s %s" exeDATE exeTIME
endif
endif
endproc

proc _SUM
if ERRCODE != 0
dialload REPERTOIRE
dialadd DATA CUST_NAME
set dialentry access DATA CUST_NAME
set dialentry areacode ZONE
set dialentry phonenumber TEL
set dialentry longdistance ON
set password $PASSWORD
set userid $USERID
dialsave
dialload DIR_NAME
endif
if fopen 1 SUMMARY READWRITE
fseek 1 0 2
fputs 1 CUST_NAME
switch ERRCODE
case 1
fputs 1 ";Modem BUSY/NO ANSWER!"
endcase
case 2
fputs 1 ";No PABX responce!"
endcase
case 3
fputs 1 ";PABX wrong password!"
endcase
case 4
fputs 1 ";IPC wrong userid!"
endcase
case 5
fputs 1 ";No LOGIN/PASSWORD!"
endcase
case 6
fputs 1 ";IPC authentication problem!"
endcase
case 7
fputs 1 ";PABX on 7 M 1!"
endcase
endswitch
endif

if not nullstr s2
fputs 1 s2
endif
if not nullstr s3
fputs 1 s3
endif
if not nullstr s4
fputs 1 s4
endif
if not nullstr s5
fputs 1 s5
endif
if not nullstr s6
fputs 1 s6
endif
if not nullstr s7
fputs 1 s7
endif
if not nullstr s8
fputs 1 s8
endif
if not nullstr s9
fputs 1 s9
endif
fclose 1
if fopen 1 SUMMARY READWRITE TEXT
fseek 1 0 2
fputs 1 ""
fclose 1
endif
mspause 500
ERRCODE = 0
i0 = 0
hangup
pause 1
endproc

Second script:

proc main

set txpace 150

when target 4 "€" call _7M1
when target 5 "±" call _7M1
when target 6 "Ý" call _7M1


pause 1
transmit "****^M"
mspause 100
transmit "LOGO^M"
mspause 100
transmit $USERID
mspause 100
transmit $PASSWORD
mspause 100

endproc

proc _7M1

when target 4 clear
when target 5 clear
when target 6 clear
set port parity MARK
set port databits 7
set port stopbits 1

endproc
 
Just so I understand your problem, it appears that the switch to 7M1 is successful, but the Quick Select Line at the bottom still reads 8N1 until you click on the cell? I tried this on my setup a bit today and I always saw the switch to 7M1 when one of the string in my when target commands was received by Procomm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top