Restored accidentally removed files.
r1249 | ffr | 2006-11-07 13:28:45 +1100 (Tue, 07 Nov 2006) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
b6f409c1d6
commit
e2ae08008b
36
site_ansto/instrument/getDMCprog.tcl
Executable file
36
site_ansto/instrument/getDMCprog.tcl
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/tclsh
|
||||||
|
# DMC2280 uses cont-Z (hex 1a) as the EOF char
|
||||||
|
# Usage:
|
||||||
|
# ./getDMCprog.tcl -host dmcIP -port dmcPort > dmcprog.txt
|
||||||
|
# To fetch the code from the dmc2280 controller at dmcIP and
|
||||||
|
# write it to dmcprog.txt, dmcPort should be 1034.
|
||||||
|
# Note: Your computer must be on the same NBI vlan as the dmc
|
||||||
|
# controller for this to work. However you can use ssh port
|
||||||
|
# forwarding to work remotely.
|
||||||
|
|
||||||
|
# On your computer run the following ssh command,
|
||||||
|
# ssh -L 1034:dmcIP:1034 sicsHostIP -lroot
|
||||||
|
# Then send the code with
|
||||||
|
# ./getDMCprog.tcl -host localhost -port 1034 > dmcprog.txt
|
||||||
|
|
||||||
|
array set args $argv
|
||||||
|
|
||||||
|
set con4 [socket $args(-host) $args(-port)]
|
||||||
|
fconfigure $con4 -buffering line -translation crlf -eofchar \x1a
|
||||||
|
|
||||||
|
proc Echo {chan } {
|
||||||
|
global forever
|
||||||
|
|
||||||
|
if {[eof $chan]} {
|
||||||
|
# A rude exit works best. Closing the socket and terminating the forever loop is unreliable
|
||||||
|
exit
|
||||||
|
#close $chan
|
||||||
|
#set forever done
|
||||||
|
} else {
|
||||||
|
puts [gets $chan]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fileevent $con4 readable [list Echo $con4]
|
||||||
|
puts $con4 UL
|
||||||
|
vwait forever
|
||||||
0
site_ansto/instrument/putDMCprog.tcl
Executable file
0
site_ansto/instrument/putDMCprog.tcl
Executable file
Reference in New Issue
Block a user