Raritan DOMINION SX - Specifications Page 169

  • Download
  • Add to my manuals
  • Print
  • Page
    / 178
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 168
APPENDIX H: TCL PROGRAMMING GUIDE 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.
Page view 168
1 2 ... 164 165 166 167 168 169 170 171 172 173 174 ... 177 178

Comments to this Manuals

No comments