SICS-710: Make the watlow_rm driveable block until a drive has finished.
Also clear the geterror property to make sure that the driver recovers from Modbus error messages.
This commit is contained in:
@ -179,6 +179,7 @@ debug_log "setValue $dev:16:$cmd $par"
|
||||
if {[string first "ASCERR:" $data] >=0} {
|
||||
sct geterror $data
|
||||
} elseif {$data != [sct oldval]} {
|
||||
hdelprop [sct] geterror
|
||||
sct oldval $data
|
||||
sct update $data
|
||||
sct utime readtime
|
||||
@ -221,6 +222,13 @@ debug_log "setValue $dev:16:$cmd $par"
|
||||
|
||||
proc setSP {tc_root nextState cmd} {
|
||||
debug_log "setSP $tc_root $nextState $cmd [sct]=[sct target] [hget [sct]]"
|
||||
debug_log "setSP sct = [sct], sct writestatus = [sct writestatus]"
|
||||
if {[sct writestatus] == "start"} {
|
||||
# Called by drive adapter
|
||||
hset $tc_root/status "busy"
|
||||
debug_log "setSP hsetprop $tc_root/setpoint driving 1"
|
||||
hsetprop $tc_root/setpoint driving 1
|
||||
}
|
||||
hset $tc_root/Loop1/setpoint [sct target]
|
||||
return idle
|
||||
}
|
||||
@ -502,7 +510,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
|
||||
}
|
||||
|
||||
::scobj::hinitprops $tempobj
|
||||
hsetprop $scobj_hpath klass NXenvironment
|
||||
hsetprop $scobj_hpath klass environment
|
||||
::scobj::set_required_props $scobj_hpath
|
||||
foreach {rootpath hpath klass priv} "
|
||||
$scobj_hpath sensor NXsensor spy
|
||||
@ -523,6 +531,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
|
||||
hsetprop $scobj_hpath privilege spy
|
||||
::scobj::hinitprops $tempobj setpoint
|
||||
hsetprop $scobj_hpath/setpoint data true
|
||||
hsetprop $scobj_hpath/setpoint type drivable
|
||||
if {[SplitReply [environment_simulation]]=="false"} {
|
||||
ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/setpoint $scobj_hpath/sensor/value $sct_controller
|
||||
}
|
||||
|
Reference in New Issue
Block a user