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!

User input 1

Status
Not open for further replies.

rickglid

Technical User
Apr 30, 2003
4
AU
Hi all,
I am using procomm to log onto SDH transmission equipment in order to commission the system. These consist of various configurations of cct packs that use virtual connections to set up a path. I use the capture facility of procomm as I enter these connections, & then edit out the replies from the equipment, so the script will send the appropriate commands. As there are quite a few different types of cct. packs & therefore different commands to set up connections, I have quite a few scripts. For example, one configuration may have 8 cct packs that can have a total of 256 E1 connections (TI for you guys in the States). The command to set up one connection is : c S1-1 S6-1-j1-k111
the second would be c S1-2 S6-1-j1-k112 etc.
This was originally done for every Network element we commission. I have used the scripts & cut down the commissioning time by 4 hours. What I would like to do is to have a user input window displayed in a script asking what type of cct. pack eg 2Mb in Slot 1, STM-4 in Slot 2 or whatever; as we use SDH transmission STM-1, STM-4, DS3 & STM-16 type cct packs. Each one of these has a different number of ports & connection commands. Also Performance monitoring has to be turned on for each of these ports.

Is this possible? And if so, can I get a few hints as to go about starting. I thought maybe the scripts I have used could be used in a seperate txt file & called by Aspect depending upon the configuration & user input.
I have tried a small user input file to change the Area address on this equipment, but the compiler fails to compile. If this worked, it would save a heap of time. I have included a small file of this so someone may be able to find out why it doesn't compile. As it is at the moment, everytime I run it, I have to manually edit the the area address, as each network element is different. Sorry about the long e-mail, but I need to explain whats going on.
Regards,
Rickglid
;To Set 41/4200 Area Address
;Change the Address as per the EO
;
proc main
transmit "c^M"
waitfor " >> "
transmit "o^M"
waitfor " >> "
transmit "a^M"
waitfor " >> "
transmit "v^M"
waitfor " >> "
;GUMBUS
transmit "s2 1234567890^M"
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "y^M"
waitfor ">>"
transmit "v^M"
waitfor " >> "
pause 10
transmit "c1^M"
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "st^M"
waitfor " >> "
pause 10
transmit "v^M"
waitfor " >> "
;The Next Line has to be edited as per the EO
;file has to be saved & compiled before running
transmit "s1 39036F100AAF2121F0^M"
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "Y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "v^M"
waitfor " >> "
pause 10
transmit "C2^M"
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "Y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "V^M"
waitfor " >> "
transmit "/^M"
endproc

THIS ONE IS THE USER INPUT WINDOW
;dialog Box

proc main
string szText ;local variable for string
;user enters in input box.
;it's value will then be
;passed to the SendData

;routine

;The following line creates the box for user input.The first string
;appears in the title bar of the box; the second is the prompt
;string that appears right before the text entry field itself.

sdlginput "Area Address" "Enter your text:" szText
waitfor "Password:"
SendData(szText)
endproc


proc SendData
param string szText

strcat szText "^M"

transmit szText

endproc

;dialogbox 0 146 67 162 29 3 "Area Address"
;text 1 14 6 146 21 "Please Enter Area Address" center
;enddialog

THIS IS AN EXAMPLE OF SETTING UP CONNECTIONS AS MENTIONED ABOVE
;Stability Test connections S1 to S4 to S6 and S11-S14 to S8. *
; *
;Written by Richard Gliddon. *
; Copyright Digiband Pty Ltd 2003 *
;***************************************************************
proc main
transmit "/^M"
transmit "s^M"
waitfor " >> "
transmit "u^M"
waitfor " >> "
transmit "o^M"
transmit "/^M"
transmit "c^M"
waitfor " >> "
transmit "n^M"
waitfor " >> "
transmit "c s1-1 s6-1-j1-k111^M"
pause 2
transmit "^M"
waitfor " >> "
transmit "c s1-9 s6-1-j1-k133^M"
pause 2
transmit "^M"
waitfor " >> "
; gumbus
transmit "c s1-17 s6-1-j1-k162^M"
pause 2
transmit "^M"
waitfor " >> "
; gumbus
transmit "c s1-25 s6-1-j1-k221^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s1-32 s6-1-j1-k242^M"
pause 2
transmit "^M"
waitfor " >> "
; gumbus
transmit "c s2-2 s6-1-j1-k251^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s2-10 s6-1-j1-k273^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s2-18 s6-1-j1-k332^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s2-26 s6-1-j1-k361^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s3-3 s6-1-j2-k113^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s3-11 s6-1-j2-k142^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s3-19 s6-1-j2-k171^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s3-27 s6-1-j2-k223^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s4-4 s6-1-j2-k253^M"
pause 2
waitfor " >> "

transmit "c s4-12 s6-1-j2-k312^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s4-20 s6-1-j2-k341^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s4-28 s6-1-j2-k363^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s11-5 s8-1-j3-k122^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s11-13 s8-1-j3-k151^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s11-21 s8-1-j3-k173^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s11-29 s8-1-j3-k232^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s12-6 s8-1-j3-k262^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s12-14 s8-1-j3-k321^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s12-22 s8-1-j3-k343^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s12-30 s8-1-j3-k372^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s13-7 s8-1-j4-k131^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s13-15 s8-1-j4-k153^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s13-23 s8-1-j4-k212^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s13-31 s8-1-j4-k241^M"
pause 2
transmit "^M"
waitfor " >> "
; gumbus
transmit "c s14-8 s8-1-j4-k271^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s14-16 s8-1-j4-k323^M"
pause 2
transmit "^M"
waitfor " >> "

transmit "c s14-24 s8-1-j4-k352^M"
pause 2
transmit "^M"
waitfor " >> "

pause 2
transmit "^M"
waitfor " >> "
pause 2
transmit "v^M"
waitfor " >> "
transmit "c^M"
transmit "/^M"
endproc
 
I didn't have any compile problems with the scripts you posted, but I'm not quite certain which string would be passed in via the szText argument, so I may be missing something.

One thing you can look into is having a dialog that requests the various pieces of information, then uses nested switch/case commands to determine which of your already-written scripts should be used. This will work if you only have script written to cover all possible combinations. Once your script has determined which scenario (i.e. the various options for the hardware you're connecting to), it can then launch the corresponding script via the chain or execute command.


aspect@aspectscripting.com
 
Thanks Knob,
I was not clear enough I think. The compile problem is when I try to place the second script called "THIS ONE IS THE USER INPUT WINDOW", into the first script where I have a comment about editing the area address & then recompiling, that it doesn't work. The error states that there is an 'enproc' command missing, but there's not. See the script is supposed to go to where it will wait for a new area address to be entered, the user inputs & hits enter, & the script continues. What this script does is;
1. enters a dummy address in S2
2. deletes the one in S1
3. enters the valid area address in S1
4. deletes the dummy address in S2
this is the system, as there always has to be an area address in either S1, S2 or S3.

Regards,
Rickglid
 
I'm still not quite following what you did, but maybe I'm putting the scripts together incorrectly. Here is the script that I took by inserting the sdlginput command and associated commands into the first script in your message, as well as adding the SendDate procedure:

;To Set 41/4200 Area Address
;Change the Address as per the EO
;
proc main
string szText ;local variable for string
;user enters in input box.
;it's value will then be
;passed to the SendData

;routine

transmit "c^M"
waitfor " >> "
transmit "o^M"
waitfor " >> "
transmit "a^M"
waitfor " >> "
transmit "v^M"
waitfor " >> "
;GUMBUS
transmit "s2 1234567890^M"
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "y^M"
waitfor ">>"
transmit "v^M"
waitfor " >> "
pause 10
transmit "c1^M"
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "st^M"
waitfor " >> "
pause 10
transmit "v^M"
waitfor " >> "
;The following line creates the box for user input.The first string
;appears in the title bar of the box; the second is the prompt
;string that appears right before the text entry field itself.

sdlginput "Area Address" "Enter your text:" szText
waitfor "Password:"
SendData(szText)
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "Y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "v^M"
waitfor " >> "
pause 10
transmit "C2^M"
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "Y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "V^M"
waitfor " >> "
transmit "/^M"
endproc

proc SendData
param string szText

strcat szText "^M"

transmit szText

endproc

This script also compiled for me with no problems, so I must not be following something correctly. If I'm not getting it right, can you post the script that does not compile for you?


aspect@aspectscripting.com
 
Hi Knob,
had a few weeks off. I am enclosing the script that won't compile. It needs to:
1.Set a dummy address in location S2, which can be the same eg 1234567890,
2.Clear the default address in S1
3.Then come up with a user input box to enter the new address in S1
4. Send the new data.
5. Clear the dummy address in S2
Here is the Script;

;To Set 4200 Area Address
;
;
proc main
transmit "c^M"
waitfor " >> "
transmit "o^M"
waitfor " >> "
transmit "a^M"
waitfor " >> "
transmit "v^M"
waitfor " >> "
;GUMBUS
transmit "s2 1234567890^M" ;sets dummy address to address 2
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "y^M"
waitfor ">>"
transmit "v^M"
waitfor " >> "
pause 10
transmit "c1^M" ;clears address 1
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "st^M" ; view status
waitfor " >> "
pause 10
transmit "v^M"
waitfor " >> "
endproc
;dialog Box

my proc
string szText ;local variable for string
;user enters in input box.
;it's value will then be
;passed to the SendData

;routine

;The following line creates the box for user input.The first string
;appears in the title bar of the box; the second is the prompt
;string that appears right before the text entry field itself.

sdlginput "Area Address" "Enter your text:" szText
waitfor "Password:" ; I don't want a password here, just enter the string as below
SendData(szText)




proc SendData
param string szText

strcat szText "^M"

transmit szText
endproc


transmit "s1 39036F100AAF2123F0^M"
waitfor "Are you sure? [Yes,No]:"
pause 20
transmit "Y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "v^M"
waitfor " >> "
pause 10
transmit "C2^M" ; clears the dummy address in location 2
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "Y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "V^M"
waitfor " >> "
transmit "/^M"
endproc
 
I see a couple problems with the script that would cause the compile errors. The first is that you have some text after the endproc for the SendData routine that is not associated with a procedure. Since this data is not within a proc statement, the compiler does not like it. There is also a my proc statement with a couple lines after it just before the SendData procedure. What I think you are wanting to do is have your main procedure execute as it does now, then the code in the my proc statement, then execute the code after the SendData procedure (i.e. all of this code would be in one procedure and SendData would be the only other procedure in the script). If I got that right, then this script may work for you (it compiles at least):

;To Set 4200 Area Address
;
;
proc main
string szText ;local variable for string
;user enters in input box.
;it's value will then be
;passed to the SendData

;routine

transmit "c^M"
waitfor " >> "
transmit "o^M"
waitfor " >> "
transmit "a^M"
waitfor " >> "
transmit "v^M"
waitfor " >> "
;GUMBUS
transmit "s2 1234567890^M" ;sets dummy address to address 2
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "y^M"
waitfor ">>"
transmit "v^M"
waitfor " >> "
pause 10
transmit "c1^M" ;clears address 1
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "st^M" ; view status
waitfor " >> "
pause 10
transmit "v^M"
waitfor " >> "
;The following line creates the box for user input.The first string
;appears in the title bar of the box; the second is the prompt
;string that appears right before the text entry field itself.

sdlginput "Area Address" "Enter your text:" szText
waitfor "Password:" ; I don't want a password here, just enter the string as below
SendData(szText)
transmit "s1 39036F100AAF2123F0^M"
waitfor "Are you sure? [Yes,No]:"
pause 20
transmit "Y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "v^M"
waitfor " >> "
pause 10
transmit "C2^M" ; clears the dummy address in location 2
waitfor "Are you sure? [Yes,No]:"
pause 10
transmit "Y^M"
waitfor ">>"
transmit "^M"
waitfor " >> "
transmit "V^M"
waitfor " >> "
transmit "/^M"
endproc

proc SendData
param string szText

strcat szText "^M"

transmit szText
endproc

Basically all I did was move the declaration of szText to the top of your main procedure, get rid of the endproc associated with main, moved the SendData procedure out of the main procedure, and deleted a few of the empty lines that the editing created.



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

Part and Inventory Search

Sponsor

Back
Top