- Fixed various Tcl drivers at startup

- Added a sinqhttp driver for the second generation HM object
This commit is contained in:
koennecke
2009-05-15 13:26:35 +00:00
parent a6123932a6
commit c096594d43
5 changed files with 182 additions and 22 deletions

View File

@@ -66,6 +66,10 @@ proc translateAxisError {key} {
}
#---------------------------------------------------------------------
proc evaluateAxisStatus {key} {
#----- Tcl does not like negative numbers as keys.
if {$key < 0} {
set key [expr 50 + abs($key)]
}
switch $key {
0 -
14 {return idle}
@@ -80,12 +84,12 @@ proc evaluateAxisStatus {key} {
9 -
10 -
11 {return run}
-6 {error "Controller aborted"}
-5 {error "Axis is deactivated"}
-4 {error "emergency stop activated, please release"}
-3 {error "Axis inhibited"}
- 1
-2 {error "Incoming command is blocked"}
56 {error "Controller aborted"}
55 {error "Axis is deactivated"}
54 {error "emergency stop activated, please release"}
53 {error "Axis inhibited"}
51 -
52 {error "Incoming command is blocked"}
}
}
#-----------------------------------------------------------------------
@@ -173,7 +177,7 @@ proc pmacsendaxerr {num} {
proc pmacrcvaxerr {motname num} {
set status [catch {checkpmacresult} data]
if {$status != 0} {
sct print "ERROR: $data"
clientput "ERROR: $data"
sct update error
sct geterror $data
return idle
@@ -182,10 +186,10 @@ proc pmacrcvaxerr {motname num} {
if {$data != 0 } {
set err [translateAxisError $data]
if {[string first following $err] >= 0} {
sct print "WARNING: $err"
clientput "WARNING: $err"
sct update poserror
} else {
sct print "ERROR: $err"
clientput "ERROR: $err"
sct update error
}
return idle
@@ -198,7 +202,7 @@ proc pmacrcvaxerr {motname num} {
proc pmacrcvpos {motname num} {
set status [catch {checkpmacresult} data]
if {$status != 0} {
sct print "ERROR: $data"
clientput "ERROR: $data"
sct geterror $data
sct update error
return idle
@@ -211,7 +215,7 @@ proc pmacrcvpos {motname num} {
proc pmacrcvstat {motname num sct} {
set status [catch {checkpmacresult} data]
if {$status != 0} {
sct print "ERROR: $data"
clientput "ERROR: $data"
sct update error
return idle
}
@@ -253,7 +257,7 @@ proc pmacsendhardpos {motname num} {
proc pmacrcvhardpos {num} {
set status [catch {checkpmacresult} data]
if {$status != 0} {
sct print "ERROR: $data"
clientput "ERROR: $data"
sct seterror $data
return idle
}
@@ -264,13 +268,13 @@ proc pmacrcvhardpos {num} {
proc pmacrcvhardax {motname num sct} {
set status [catch {checkpmacresult} data]
if {$status != 0} {
sct print "ERROR: $data"
clientput "ERROR: $data"
sct seterror $data
return idle
}
set status [catch {evaluateAxisStatus $data} msg]
if {$status != 0} {
sct print "ERROR: $msg"
clientput "ERROR: $msg"
sct seterror $msg
return idle
}
@@ -303,6 +307,7 @@ proc pmacrefrun {motorname sct num} {
$sct send "M${num}=9"
hupdate /sics/${motorname}/status run
set motstat run
wait 3
while {[string compare $motstat run] == 0} {
$sct queue $path progress read
wait 1
@@ -344,6 +349,7 @@ proc MakeDeltaTau {name sct num} {
set parlist [list scale_factor hardposition maxspeed \
commandspeed maxaccel offset axisstatus axiserror status poshwlimitactive \
neghwlimitactive liftaircushion hardlowerlim hardupperlim]
$sct send [format "M%2.2d14=0" $num]
foreach par $parlist {
$sct queue /sics/$name/$par progress read
}