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!

Automated scripts using excel & reflections for CS1000?

Status
Not open for further replies.

chabipi1

Technical User
Jan 19, 2009
3
CA
Hi, I am looking at creating a macro or script make some programming changes on 200+ 6140 WLAN handsets.
I have a spreadsheet containing DN, TN, MAC and Serial #'s

What I'm looking at changing some common settings:
CLS: SWD, AHA, IRA
HUNT: 000
LHK: 1
Key0: separate DID (5digit)
Key1: Phantom with 1998xxx (xxx is last 3 digits of Key0)

Is there a easier way to achieve this with Reflections using Rlogin than doing it manually?
 
With Reflections you record and build 1 phone then stop recording. Then, the only thing you need, on notepad (txt file) is the small number of unique mnemonics - TN, DN, Key 1.

Mato' Was'aka
 
Right now I have edited my script to wait for input of TN and Key 1 digits but it doesn't cycle through properly stopping at CPND. Its a workaround allowing my to enter card/port and the remaining digits after 1998 on key1.
I've put in CR twice to see if it will go past the CPND and no luck.

*********************************************
Here is what I have:
Sub chg6140()
' Generated by the Reflection Macro Recorder on 05-11-2010 14:44:15.75.
' Generated by WRQ Reflection for UNIX and OpenVMS 12.0.5.
'
' CLS: SWD, AHA, IRA, HTA, HUNT: 000, K1:1998xxx
'
On Error GoTo ErrorHandler

Const NEVER_TIME_OUT = 0

Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M

LF = Chr(Reflection2.ControlCodes.rcLF)
CR = Chr(Reflection2.ControlCodes.rcCR)

With Session
.Transmit "chg" & CR

.StatusBar = "Waiting for Prompt: TYPE:"
.WaitForString LF & "TYPE: ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "2210" & CR

.StatusBar = "Waiting for Prompt: TN"
.WaitForString LF & "TN ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "152 0 "
' Press EditPaste (Insert the Clipboard contents at the cursor position).
' Reflection has recorded the record-time contents of the clipboard.
' If you want to use the playback-time contents of the clipboard,
' Uncomment the following line and delete the appropriate record-time data.


.StatusBar = "Waiting for Prompt: ECHG"
.WaitForString LF & "ECHG ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "yes" & CR

.StatusBar = "Waiting for Prompt: ITEM"
.WaitForString LF & "ITEM ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "cls swd aha ira hta" & CR


.StatusBar = "Waiting for Prompt: ITEM"
.WaitForString LF & "ITEM ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "hunt 000" & CR

.StatusBar = "Waiting for Prompt: ITEM"
.WaitForString LF & "ITEM ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "lhk 1" & CR

.StatusBar = "Waiting for Prompt: ITEM"
.WaitForString LF & "ITEM ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "key 1 scr 1998"

.WaitForString LF & "AUD", NEVER_TIME_OUT, rcAllowKeystrokes

' String omitted because it might change:
' .WaitForString "000", NEVER_TIME_OUT, rcAllowKeystrokes

.WaitForString " " & CR & LF, NEVER_TIME_OUT, rcAllowKeystrokes
.Transmit " 1998"

.StatusBar = "Waiting for Prompt: CPND"
.WaitForString LF & " CPND ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "" & CR

.StatusBar = "Waiting for Prompt: NAME"
.WaitForString LF & " NAME ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "" & CR

.StatusBar = "Waiting for Prompt: DISPLAY_FMT"
.WaitForString LF & " DISPLAY_FMT ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: VMB"
.WaitForString LF & " VMB ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: KEY"
.WaitForString LF & " KEY ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: ITEM"
.WaitForString LF & "ITEM ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR
' .WaitForString LF & "REQ: ", NEVER_TIME_OUT, rcAllowKeystrokes
End With
Exit Sub

ErrorHandler:
Session.MsgBox Err.Description, vbExclamation + vbOKOnly

' Recording stopped at 14:50:49.15.
End Sub

******************************************************
The entries in my spreadsheet look like this.
TN Telephone Number Key 1
152 0 1 0 58400 1998400
152 0 1 1 58401 1998401

******************************************************
1.) Would I be better off to scrap trying to pull info off spreadsheet (not sure if I need to setup macros in excel or where to begin) and fine tune the script above to enter TN and Key1 manually?

2.) Do you know of a dummies guide for getting my head around scripting for Reflections for use with CS1000?

 
you need to pull from 3 different txt files that are desending, so you can do while not end of file. Edit this file, or just reference it. Here, at a new site, I added 500 2004P2 IP sets in about 2 hours, just sat and watched it run. The files need Declared (Dim as string) and need to be opened at the begining of the script, script needs to loop until end of txt files. The only thing I did in CLS was to allow recording.

Sub Mntclo_Sets()
' Created by TSB on 02-01-2009 12:56:45.13.
' Generated by Reflection for UNIX and Digital 8.00.076.
'
' Pull from File TN PosID and DN
'
On Error GoTo ErrorHandler

Const NEVER_TIME_OUT = 0

Dim LF As String ' Chr$(rcLF) = Chr$(10) = Control-J
Dim CR As String ' Chr$(rcCR) = Chr$(13) = Control-M
Dim TN As String
Dim POS As String
Dim DN As String
Dim JNK As String
Dim ddd As String
Dim eee As String
Dim infile1 As String
Dim infile2 As String
Dim infile3 As String
infile1 = "C:\TN.txt"
infile2 = "C:\POS.txt"
infile3 = "C:\DN.txt"

LF = Chr$(rcLF)
CR = Chr$(rcCR)

With Session

Open infile1 For Input As #1
Line Input #1, JNK
Open infile2 For Input As #2
Line Input #2, ddd
Open infile3 For Input As #3
Line Input #3, eee
Do While Not EOF(1) And Not EOF(2) And Not EOF(3)
Line Input #1, TN
Line Input #2, POS
Line Input #3, DN
Wait 1





'.StatusBar = "Waiting for Prompt: REQ:"
'.WaitForString LF & "REQ: ", NEVER_TIME_OUT, rcAllowKeystrokes
'.StatusBar = ""
.Transmit "NEW" & CR

.StatusBar = "Waiting for Prompt: TYPE:"
.WaitForString LF & "TYPE: ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "2004P2" & CR

.StatusBar = "Waiting for Prompt: TN"
.WaitForString LF & "TN ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit TN & CR



.StatusBar = "Waiting for Prompt: DES"
.WaitForString LF & "DES ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "London" & CR

.StatusBar = "Waiting for Prompt: CUST"
.WaitForString LF & "CUST ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "0" & CR

.StatusBar = "Waiting for Prompt: NUID"
.WaitForString LF & "NUID ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: NHTN"
.WaitForString LF & "NHTN ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: KEM"
.WaitForString LF & "KEM ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: ZONE"
.WaitForString LF & "ZONE ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "002" & CR

.StatusBar = "Waiting for Prompt: ERL"
.WaitForString LF & "ERL ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: ECL"
.WaitForString LF & "ECL ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: FDN"
.WaitForString LF & "FDN ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: TGAR"
.WaitForString LF & "TGAR ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "1" & CR

.StatusBar = "Waiting for Prompt: LDN"
.WaitForString LF & "LDN ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: NCOS"
.WaitForString LF & "NCOS ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "3" & CR

.StatusBar = "Waiting for Prompt: RNPG"
.WaitForString LF & "RNPG ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: SSU"
.WaitForString LF & "SSU ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: SGRP"
.WaitForString LF & "SGRP ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: CLS"
.WaitForString LF & "CLS ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "ICRA" & CR

.StatusBar = "Waiting for Prompt: HUNT"
.WaitForString LF & "HUNT ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: SCI"
.WaitForString LF & "SCI ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: PLEV"
.WaitForString LF & "PLEV ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: DANI"
.WaitForString LF & "DANI ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: AST"
.WaitForString LF & "AST ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "" & CR

.StatusBar = "Waiting for Prompt: IAPG"
.WaitForString LF & "IAPG ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "01" & CR

' .StatusBar = "Waiting for Prompt: ITNA"
'.WaitForString LF & "ITNA ", NEVER_TIME_OUT, rcAllowKeystrokes
' .StatusBar = ""
'.Transmit CR

.StatusBar = "Waiting for Prompt: MLWU_LANG"
.WaitForString LF & "MLWU_LANG ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: MLNG"
.WaitForString LF & "MLNG ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: DNDR"
.WaitForString LF & "DNDR ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: KEY"
.WaitForString LF & "KEY ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "0 ACD 8808 0 "
.Transmit POS & CR


.StatusBar = "Waiting for Prompt: KEY"
.WaitForString LF & "KEY ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "1 SCR "
.Transmit DN & CR


.StatusBar = "Waiting for Prompt: CPND"
.WaitForString LF & " CPND ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: VMB"
.WaitForString LF & " VMB ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: KEY"
.WaitForString LF & "KEY ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "3 MSB" & CR

.StatusBar = "Waiting for Prompt: KEY"
.WaitForString LF & "KEY ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit "4 NRD" & CR

.StatusBar = "Waiting for Prompt: KEY"
.WaitForString LF & "KEY ", NEVER_TIME_OUT, rcAllowKeystrokes
.StatusBar = ""
.Transmit CR
.Wait 1
.Transmit CR


' .StatusBar = "Waiting for Prompt: REQ:"
'.WaitForString LF & "REQ: ", NEVER_TIME_OUT, rcAllowKeystrokes
'.StatusBar = ""
.CapsLock = False
Loop


Close #1
Close #2
Close #3


Exit Sub

ErrorHandler:
.MsgBox Err.Description, vbExclamation + vbOKOnly

End With
' Recording stopped at 13:00:30.13.
End Sub



Mato' Was'aka
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top