Added histmem and runscan command hmm_configuration_common_1.tcl Set histmem_cmd status feedback to IDLE on COUNTEND event nxscripts_common_1.tcl When saving a set of files the time-stamp is offset from the time the first file is created. scan_common_1.tcl The hmscan hook functions now set feedback on the runscan_cmd sct_positmotor_common.tcl Added mk_sct_positmotor command to create a script context controller which runs a motor to an indexed position. Added positmotor_configuration.tcl to echidna, wombat, kowari, quokka, platypus. sans/config/motors/positmotor_configuration.tcl Has an example of a positmotor configuration for the sample changer sanx/quokka_configuration.tcl Setup feedback nodes for AttRotDeg and RotApDeg. motor_utility.tcl Added reldrive and relrun commands along with getmotpar convenience command. r2725 | ffr | 2008-10-27 15:55:48 +1100 (Mon, 27 Oct 2008) | 26 lines
51 lines
1.4 KiB
Tcl
51 lines
1.4 KiB
Tcl
proc TrimReply { str } {
|
|
set reply [string trim $str " :"]
|
|
return $reply
|
|
}
|
|
|
|
proc pop { which } {
|
|
set down { -1 1 -1 1 1 }
|
|
set speed 50000
|
|
set motions { 0 0 0 0 0 }
|
|
set indices { 0 1 2 3 4 }
|
|
set motors { BS1 BS2 BS3 BS4 BS5 }
|
|
if {($which < 1)||($which > [llength $indices])} {
|
|
clientput "Pop must be between 1 and [llength $indices]"
|
|
return
|
|
}
|
|
incr which -1
|
|
foreach i $indices {
|
|
lset motions $i [expr $speed * [lindex $down $i]]
|
|
}
|
|
lset motions $which [expr -1 * [lindex $motions $which]]
|
|
|
|
foreach i $indices { [lindex $motors $i] send SH` }
|
|
foreach i $indices { [lindex $motors $i] send JG`=[lindex $motions $i] }
|
|
foreach i $indices { [lindex $motors $i] send BG` }
|
|
set x 0
|
|
set started [clock seconds]
|
|
while { $x == 0 } {
|
|
set x 1
|
|
set current [clock seconds]
|
|
foreach i $indices {
|
|
if { [TrimReply [[lindex $motors $i] send MG _BG`]] > 0 } {
|
|
set x 0
|
|
if { ([expr $current - 60] > $started) } {
|
|
clientput [lindex $motors $i] send ST`
|
|
[lindex $motors $i] send ST`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
foreach i $indices {
|
|
set forward [TrimReply [[lindex $motors $i] send MG _LF`]]
|
|
set reverse [TrimReply [[lindex $motors $i] send MG _LR`]]
|
|
if { [expr $forward * $reverse] > 0 } {
|
|
clientput "[lindex $motors $i] is between limits"
|
|
}
|
|
}
|
|
clientput "POP [expr $which + 1] took [expr $current -$started] seconds"
|
|
}
|
|
publish pop user
|
|
|