I would like some feed back on my first attempt to make a script. Please send any comments good or bad. Also if you see anything that would improve or speed up the script let me know. Thanks
;***************************************************************************************************************************
;Automated script for loading the TruePosition LMU's
;Version 2.0 By Scott Gayer 10-31-06
;***************************************************************************************************************************
;Global Variables
string sLat, sLong, sCLength, sAMSL, sDelay
float fCLength, fdelay, Famount
proc main
usermsg "Remove all RF cables!" ;Warning message to user
usermsg "Remove T-1 Cable!!" ;Warning message to user
call setupT1 ;Sets up the T-1
call SoftwareLoad ;Loads Software to the LMU
Call SettingGPS ;Sets up and enables the GPS
call SignalTests ;Checks out the LMU and cables
call Memorytests ;Checks out the LMU
endproc
proc LMUPrompt ;puts LMU into normal state
pwtitlebar "Getting the LMU Prompt"
transmit "^M" ;wake up unit
pause 1
transmit "reboot^M" ;reboot command if in T-Shell
pause 1
transmit "reset^M" ;resets unit when in Dshell
waitquiet 5 ;Gives LMU terminal display time to stabilize following a reset condition.
transmit "proc^M" ;tells LMU to Proceed
waitfor "Enter GPS message processing loop^M^J" ;waits for LMU to boot up
pause 5 ;pauses script for 5 seconds
transmit "^M" ;wakes up unit again
pause 1
transmit "^M"
waitfor "->" ;Waits for Target Shell
transmit "dshell^M" ;puts LMU into Dshell
waitfor "LMU>" ;waits for the LMU prompt
pause 1
endproc
proc setupT1 ;Sets up the T-1 for the LMU
call LMUPrompt ;Calls LMU Prompt
pwtitlebar "Setting up the T-1"
transmit "CLRDS0BIT^M" ;disables all DS0's
pause 1
transmit "SETNETWORKTYPE 0^M" ;enables T-1 Mode
pause 1
transmit "SET56KMODE 0^M" ;sets speed to 64kbps
pause 1
transmit "SETLINEMODE 0^M" ;sets line to B8ZS
pause 1
transmit "SETFRAMING 0^M" ;sets the frame to ESF
pause 1
transmit "ENABLEDS0BIT 23^M" ;enables timeslot 23
pause 1
transmit "SHOWCOMCFGS^M" ;shows current T-1 strapping
usermsg "Strapping is Done!"
endproc
proc SoftwareLoad ;loads version 9.1 software to the LMU
pwtitlebar "Sending LMUBOOT-R9.1BL007"
sendfile ASCII "LMUBOOT-R9.1BL007.hex" ;takes about 4 minutes
pause 250
call LMUPrompt
pwtitlebar "Sending LMUFLASH-R9.1BL133"
sendfile ASCII "LMUFLASH-R9.1BL133.hex" ;takes about 4 minutes
pause 250
call LMUPrompt
pwtitlebar "Sending LMUFPGA-R7.0BL14"
sendfile ASCII "LMUFPGA-R7.0BL14.hex" ;takes about 8 minutes
pause 500
call LMUPrompt
pwtitlebar "Sending TPGPSFLASH-R9.1BL010" ;takes about 4 minutes
transmit "dwnldtype GPS^M"
sendfile ASCII "TPGPSFLASH-R9.1BL010.srec"
pause 250
call LMUPrompt
pwtitlebar "Sending TPGPSFPGA-R7.0BL011" ;takes about 8 minutes
transmit "dwnldtype GPS^M"
sendfile ASCII "TPGPSFPGA-R7.0BL011.hex"
pause 500
call LMUPrompt
usermsg "Software Loading is Done!"
endproc
proc SignalTests ;checks out the receivers and cables
pwtitlebar "Checking the Noise Floor"
transmit "searchbcn none^M" ;Stops the beacon search
usermsg "Verify that all RF cables are disconnected!"
transmit "gain 1 43^M"
pause 1
transmit "bit 6 255 3 512 10 0^M"
usermsg "Record the readings as Port 1 No Cables"
pause 5
transmit "gain 2 43^M"
pause 1
transmit "bit 6 255 3 512 10 1^M"
usermsg "Record the readings as Port 2 No Cables"
pause 5
transmit "gain 3 43^M"
pause 1
transmit "bit 6 255 3 512 10 2^M"
usermsg "Record the readings as Port 3 No Cables"
pause 5
transmit "gain 4 43^M"
pause 1
transmit "bit 6 255 3 512 10 3^M"
usermsg "Record the readings as Port 4 No Cables"
pause 5
transmit "gain 5 43^M"
pause 1
transmit "bit 6 255 3 512 10 4^M"
usermsg "Record the readings as Port 5 No Cables"
pause 5
transmit "gain 6 43^M"
pause 1
transmit "bit 6 255 3 512 10 5^M"
usermsg "Record the readings as Port 6 No Cables"
pause 5
pwtitlebar "Testing RF Levels on the port cables"
Usermsg "Please connect all used port cables"
transmit "bit 6 255 3 512 10 0^M"
usermsg "Record the readings as Port 1 with Cables"
pause 5
transmit "bit 6 255 3 512 10 1^M"
usermsg "Record the readings as Port 2 with Cables"
pause 5
transmit "bit 6 255 3 512 10 2^M"
usermsg "Record the readings as Port 3 with Cables"
pause 5
transmit "bit 6 255 3 512 10 3^M"
usermsg "Record the readings as Port 4 with Cables"
pause 5
transmit "bit 6 255 3 512 10 4^M"
usermsg "Record the readings as Port 5 with Cables"
pause 5
transmit "bit 6 255 3 512 10 5^M"
usermsg "Record the readings as Port 6 with Cables"
pause 5
usermsg "Verify the differences in reading are as expected"
call LMUPrompt
endproc
proc SettingGPS ;initilizes and turns up the GPS
integer idelay
string GPSCommand
pwtitlebar "Setting up the GPS"
usermsg "Please connect the GPS Cable"
pause 1
dialogbox 0 8 20 368 169 67 "Setting GPS"
editbox 1 122 24 74 19 sLat 10
editbox 2 122 45 74 19 sLong 11
editbox 3 122 67 74 19 sCLength 6
editbox 4 122 88 74 19 sAMSL 4
pushbutton 5 70 121 184 32 "Continue" OK Default
text 6 40 24 74 19 "Latatude" right
text 7 40 88 74 19 "Antenna AMSL" right
text 8 40 67 74 19 "Antenna Cable Length" right
text 9 40 45 74 19 "Longitude" right
text 10 205 85 94 18 "Altitude from Handheld GPS in Meters" left
text 11 205 64 94 18 "Total GPS Cable length in Meters" left
text 12 205 44 94 18 "Longitude from Handheld GPS in -DDD.dddddd Format" left
text 13 205 24 94 18 "Latatude from Handheld GPS in DD.dddddd Format" left
text 14 14 2 344 14 "Initial GPS Settings from Handheld Unit." center
enddialog
GPSCommand = "GPS "
atof sCLength fCLength ;turns string into float
call cabledelay ;multiplies cable length by 4 to get cable delay
ftoa fDelay sDelay ;turns float back into a string
atoi sDelay iDelay ;turns string into an integer for rounding reasons
itoa idelay sDelay ;turns integer back into a string to be used later
strcat sLat " " ;adds a space to the end of the string
strcat sLong " " ;adds a space to the end of the string
strcat sDelay " " ;adds a space to the end of the string
strcat sAMSL "^M" ;adds a return to the end of the string
strcat GPSCommand sLat ;adds the latitude to the end of the GPS command string
strcat GPSCommand sLong ;adds the longitude to the end of the the above string
strcat GPSCommand sDelay ;adds the delay to the end of the above string
strcat GPSCommand sAMSL ;adds the AMSL to the end of the above string
transmit GPScommand ;sends the resulting completed string as the Set GPS location command
pause 5
transmit "gstat^M" ;checks the number of satellites
pause 3
transmit "bit 9^M" ;places LMU into self survey mode to dial in the location
pause 60
waitfor "LMU>" ;waits for the LMU prompt
pause 1
transmit "?gps^M" ;checks the resulting location
pause 5
usermsg "Record this location"
transmit "gstat^M" ;checks satellite status again
pause 1
usermsg "Record the number of satellites"
call LMUPrompt
endproc
proc cabledelay ;figures delay from 4(cable length)
famount = 4
fDelay=Famount*FCLength
endproc
proc MemoryTests ;tests all of the DSP's and checks the memory
pwtitlebar "Testing the DSP Memory"
transmit "bit 4 1^M"
waitfor "LMU>DSP 0 has come back online."
transmit "bit 4 2^M"
waitfor "LMU>DSP 1 has come back online."
transmit "bit 4 3^M"
waitfor "LMU>DSP 2 has come back online."
transmit "bit 4 4^M"
waitfor "LMU>DSP 3 has come back online."
usermsg "If you received a BIT 4 Failure Replace the LMU"
pwtitlebar "Testing the CP Memory"
transmit "bit 5^M"
waitfor "LMUBOOT>T1 line disconnected^M^J"
transmit "^M"
waitfor "LMUBOOT>"
transmit "proc^M"
waitfor "CP RAM Memory Test Passed"
pause 10
usermsg "If CP RAM Memory Test Failed replace LMU"
pwtitlebar "GSM Downlink Power Test"
transmit "^M"
pause 1
usermsg "Please connect the Beacon Antenna"
transmit "bit 8 5^M" ;tests the GSM beacon antenna for signal
waitfor "BIT 8 PASSED"
pwtitlebar "GSM Beacon Search"
transmit "searchbcn PCS^M" ;starts searching the PCS band for usable beacons
pause 180
waitfor "search of Beacon Ranges has completed"
usermsg "Please record the number of beacons found"
usermsg "Please reconnect the T-1"
transmit "reset^M"
usermsg "Please verify the LMU is up"
usermsg "Thank You, Please Hang up now"
endproc
;***************************************************************************************************************************
;Automated script for loading the TruePosition LMU's
;Version 2.0 By Scott Gayer 10-31-06
;***************************************************************************************************************************
;Global Variables
string sLat, sLong, sCLength, sAMSL, sDelay
float fCLength, fdelay, Famount
proc main
usermsg "Remove all RF cables!" ;Warning message to user
usermsg "Remove T-1 Cable!!" ;Warning message to user
call setupT1 ;Sets up the T-1
call SoftwareLoad ;Loads Software to the LMU
Call SettingGPS ;Sets up and enables the GPS
call SignalTests ;Checks out the LMU and cables
call Memorytests ;Checks out the LMU
endproc
proc LMUPrompt ;puts LMU into normal state
pwtitlebar "Getting the LMU Prompt"
transmit "^M" ;wake up unit
pause 1
transmit "reboot^M" ;reboot command if in T-Shell
pause 1
transmit "reset^M" ;resets unit when in Dshell
waitquiet 5 ;Gives LMU terminal display time to stabilize following a reset condition.
transmit "proc^M" ;tells LMU to Proceed
waitfor "Enter GPS message processing loop^M^J" ;waits for LMU to boot up
pause 5 ;pauses script for 5 seconds
transmit "^M" ;wakes up unit again
pause 1
transmit "^M"
waitfor "->" ;Waits for Target Shell
transmit "dshell^M" ;puts LMU into Dshell
waitfor "LMU>" ;waits for the LMU prompt
pause 1
endproc
proc setupT1 ;Sets up the T-1 for the LMU
call LMUPrompt ;Calls LMU Prompt
pwtitlebar "Setting up the T-1"
transmit "CLRDS0BIT^M" ;disables all DS0's
pause 1
transmit "SETNETWORKTYPE 0^M" ;enables T-1 Mode
pause 1
transmit "SET56KMODE 0^M" ;sets speed to 64kbps
pause 1
transmit "SETLINEMODE 0^M" ;sets line to B8ZS
pause 1
transmit "SETFRAMING 0^M" ;sets the frame to ESF
pause 1
transmit "ENABLEDS0BIT 23^M" ;enables timeslot 23
pause 1
transmit "SHOWCOMCFGS^M" ;shows current T-1 strapping
usermsg "Strapping is Done!"
endproc
proc SoftwareLoad ;loads version 9.1 software to the LMU
pwtitlebar "Sending LMUBOOT-R9.1BL007"
sendfile ASCII "LMUBOOT-R9.1BL007.hex" ;takes about 4 minutes
pause 250
call LMUPrompt
pwtitlebar "Sending LMUFLASH-R9.1BL133"
sendfile ASCII "LMUFLASH-R9.1BL133.hex" ;takes about 4 minutes
pause 250
call LMUPrompt
pwtitlebar "Sending LMUFPGA-R7.0BL14"
sendfile ASCII "LMUFPGA-R7.0BL14.hex" ;takes about 8 minutes
pause 500
call LMUPrompt
pwtitlebar "Sending TPGPSFLASH-R9.1BL010" ;takes about 4 minutes
transmit "dwnldtype GPS^M"
sendfile ASCII "TPGPSFLASH-R9.1BL010.srec"
pause 250
call LMUPrompt
pwtitlebar "Sending TPGPSFPGA-R7.0BL011" ;takes about 8 minutes
transmit "dwnldtype GPS^M"
sendfile ASCII "TPGPSFPGA-R7.0BL011.hex"
pause 500
call LMUPrompt
usermsg "Software Loading is Done!"
endproc
proc SignalTests ;checks out the receivers and cables
pwtitlebar "Checking the Noise Floor"
transmit "searchbcn none^M" ;Stops the beacon search
usermsg "Verify that all RF cables are disconnected!"
transmit "gain 1 43^M"
pause 1
transmit "bit 6 255 3 512 10 0^M"
usermsg "Record the readings as Port 1 No Cables"
pause 5
transmit "gain 2 43^M"
pause 1
transmit "bit 6 255 3 512 10 1^M"
usermsg "Record the readings as Port 2 No Cables"
pause 5
transmit "gain 3 43^M"
pause 1
transmit "bit 6 255 3 512 10 2^M"
usermsg "Record the readings as Port 3 No Cables"
pause 5
transmit "gain 4 43^M"
pause 1
transmit "bit 6 255 3 512 10 3^M"
usermsg "Record the readings as Port 4 No Cables"
pause 5
transmit "gain 5 43^M"
pause 1
transmit "bit 6 255 3 512 10 4^M"
usermsg "Record the readings as Port 5 No Cables"
pause 5
transmit "gain 6 43^M"
pause 1
transmit "bit 6 255 3 512 10 5^M"
usermsg "Record the readings as Port 6 No Cables"
pause 5
pwtitlebar "Testing RF Levels on the port cables"
Usermsg "Please connect all used port cables"
transmit "bit 6 255 3 512 10 0^M"
usermsg "Record the readings as Port 1 with Cables"
pause 5
transmit "bit 6 255 3 512 10 1^M"
usermsg "Record the readings as Port 2 with Cables"
pause 5
transmit "bit 6 255 3 512 10 2^M"
usermsg "Record the readings as Port 3 with Cables"
pause 5
transmit "bit 6 255 3 512 10 3^M"
usermsg "Record the readings as Port 4 with Cables"
pause 5
transmit "bit 6 255 3 512 10 4^M"
usermsg "Record the readings as Port 5 with Cables"
pause 5
transmit "bit 6 255 3 512 10 5^M"
usermsg "Record the readings as Port 6 with Cables"
pause 5
usermsg "Verify the differences in reading are as expected"
call LMUPrompt
endproc
proc SettingGPS ;initilizes and turns up the GPS
integer idelay
string GPSCommand
pwtitlebar "Setting up the GPS"
usermsg "Please connect the GPS Cable"
pause 1
dialogbox 0 8 20 368 169 67 "Setting GPS"
editbox 1 122 24 74 19 sLat 10
editbox 2 122 45 74 19 sLong 11
editbox 3 122 67 74 19 sCLength 6
editbox 4 122 88 74 19 sAMSL 4
pushbutton 5 70 121 184 32 "Continue" OK Default
text 6 40 24 74 19 "Latatude" right
text 7 40 88 74 19 "Antenna AMSL" right
text 8 40 67 74 19 "Antenna Cable Length" right
text 9 40 45 74 19 "Longitude" right
text 10 205 85 94 18 "Altitude from Handheld GPS in Meters" left
text 11 205 64 94 18 "Total GPS Cable length in Meters" left
text 12 205 44 94 18 "Longitude from Handheld GPS in -DDD.dddddd Format" left
text 13 205 24 94 18 "Latatude from Handheld GPS in DD.dddddd Format" left
text 14 14 2 344 14 "Initial GPS Settings from Handheld Unit." center
enddialog
GPSCommand = "GPS "
atof sCLength fCLength ;turns string into float
call cabledelay ;multiplies cable length by 4 to get cable delay
ftoa fDelay sDelay ;turns float back into a string
atoi sDelay iDelay ;turns string into an integer for rounding reasons
itoa idelay sDelay ;turns integer back into a string to be used later
strcat sLat " " ;adds a space to the end of the string
strcat sLong " " ;adds a space to the end of the string
strcat sDelay " " ;adds a space to the end of the string
strcat sAMSL "^M" ;adds a return to the end of the string
strcat GPSCommand sLat ;adds the latitude to the end of the GPS command string
strcat GPSCommand sLong ;adds the longitude to the end of the the above string
strcat GPSCommand sDelay ;adds the delay to the end of the above string
strcat GPSCommand sAMSL ;adds the AMSL to the end of the above string
transmit GPScommand ;sends the resulting completed string as the Set GPS location command
pause 5
transmit "gstat^M" ;checks the number of satellites
pause 3
transmit "bit 9^M" ;places LMU into self survey mode to dial in the location
pause 60
waitfor "LMU>" ;waits for the LMU prompt
pause 1
transmit "?gps^M" ;checks the resulting location
pause 5
usermsg "Record this location"
transmit "gstat^M" ;checks satellite status again
pause 1
usermsg "Record the number of satellites"
call LMUPrompt
endproc
proc cabledelay ;figures delay from 4(cable length)
famount = 4
fDelay=Famount*FCLength
endproc
proc MemoryTests ;tests all of the DSP's and checks the memory
pwtitlebar "Testing the DSP Memory"
transmit "bit 4 1^M"
waitfor "LMU>DSP 0 has come back online."
transmit "bit 4 2^M"
waitfor "LMU>DSP 1 has come back online."
transmit "bit 4 3^M"
waitfor "LMU>DSP 2 has come back online."
transmit "bit 4 4^M"
waitfor "LMU>DSP 3 has come back online."
usermsg "If you received a BIT 4 Failure Replace the LMU"
pwtitlebar "Testing the CP Memory"
transmit "bit 5^M"
waitfor "LMUBOOT>T1 line disconnected^M^J"
transmit "^M"
waitfor "LMUBOOT>"
transmit "proc^M"
waitfor "CP RAM Memory Test Passed"
pause 10
usermsg "If CP RAM Memory Test Failed replace LMU"
pwtitlebar "GSM Downlink Power Test"
transmit "^M"
pause 1
usermsg "Please connect the Beacon Antenna"
transmit "bit 8 5^M" ;tests the GSM beacon antenna for signal
waitfor "BIT 8 PASSED"
pwtitlebar "GSM Beacon Search"
transmit "searchbcn PCS^M" ;starts searching the PCS band for usable beacons
pause 180
waitfor "search of Beacon Ranges has completed"
usermsg "Please record the number of beacons found"
usermsg "Please reconnect the T-1"
transmit "reset^M"
usermsg "Please verify the LMU is up"
usermsg "Thank You, Please Hang up now"
endproc