
A
PPENDIX
H:
TCL
P
ROGRAMMING
G
UIDE
159
TCL Server designed to interact with a TCL user
amppermission off
amplock 1
ampclear 1
set val1 0.0
set val2 0.0
set val3 0.0
while { 1 } {
set s [amplisten]
if {[string length $s] > 0}{
if {$s == “DATA”}{
puts [format “Mach Value = %f; Voltage Value = %f;
Current Value = %f.” $val1 $val2 $val3]
ampresponse
} elseif {$s == “READ1”}{
set readTarget [ampexec “READ MACH” 5 “##$$” 1]
scan readTarget “MACH Val %f” val1
puts
“READ1
COMPLETED”
ampresponse
} elseif {$s == “READ2”}{
set readTarget [ampexec “READ VOLTAGE” 5
“##$$” 1]
scan readTarget “VOLT Val %f” val2
puts
“READ2
COMPLETED”
ampresponse
} elseif {$s == “READ3”}{
set readTarget [ampexec “READ CURRENT” 5
“##$$” 1]
scan
readTarget
“AMP
Val
%f”
val3
puts
“READ3
COMPLETED”
ampresponse
} elseif {$s == “CONSOLE”}{
ampunlock
1
puts “Lock Released. Waiting for DONECONSOLE input”
ampresponse
while { [amplisten] != “DONECONSOLE” }
{ampdelay 10}
amplock 1
puts
“Lock
Acquired”
ampresponse
} elseif {$s == “QUIT”}{
amppermission
on
ampunlock
1
puts
“Exiting
script”
ampresponse
break
}
else
{
Allow observers
and operators to
issue commands to
this TCL Service
Lock the console
for this TCL service
to use.
Clear old data in the TCL internal buffer so that there
is no confusion when data is gathered upon user
request.
Initializing variables
Read in user
command.
If the reader requests
the TCL service to re-
acquire one of the three
values, the TCL service
will issue the command
to the target and read in
the value. It will also
respond back to the
requester with a
message,
“COMPLETE”
If user input is “DATA” , format the data associated
with variables val1, val2, val3 in a string and respond
back the user.
If the user input is
“CONSOLE”
relinquish the write
console access lock
and respond with
content “Console Lock
released and waiting
for input
DONECONSOLE”.
If user input is QUIT lock
up permission on TCL
script, unlock write
access and exit script.
Summary of Contents for SX32
Page 2: ...This page intentionally left blank ...
Page 4: ...This page intentionally left blank ...
Page 78: ...68 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 90: ...80 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 94: ...84 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 102: ...92 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 106: ...96 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 108: ...98 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 122: ...112 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 134: ...124 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 174: ...164 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 177: ...APPENDIX J TECHNICAL FAQS 167 ...
Page 178: ...168 DOMINION SX INSTALLATION AND OPERATIONS MANUAL 255 60 2000 ...