Added ::plc::inst_ready command which is used to check if the instrument is ready before starting a scan.
Also add plc simulation mode r2202 | ffr | 2007-10-31 15:54:49 +1100 (Wed, 31 Oct 2007) | 3 lines
This commit is contained in:
committed by
Douglas Clowes
parent
33e93c6d3d
commit
f54146b58e
@@ -1,10 +1,38 @@
|
||||
set sim_mode [SplitReply [plc_simulation]]
|
||||
|
||||
namespace eval plc {
|
||||
proc set_sobj_attributes {} {
|
||||
set objlist [sicslist match plc_*];
|
||||
foreach v $objlist {
|
||||
if { [SplitReply [sicslist $v type]]== "SicsVariable"} {
|
||||
::utility::mkData $v [string replace $v 0 3] plc privilege user control true data false
|
||||
}
|
||||
}
|
||||
|
||||
proc ::plc::set_sobj_attributes {} {
|
||||
set objlist [sicslist match plc_*];
|
||||
foreach v $objlist {
|
||||
if { [SplitReply [sicslist $v type]]== "SicsVariable"} {
|
||||
::utility::mkData $v [string replace $v 0 3] plc privilege user control true data false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if {$sim_mode == "true"} {
|
||||
proc ::plc::inst_ready {} {
|
||||
variable readyflag
|
||||
return $readyflag
|
||||
}
|
||||
proc ::plc::set_readyflag {flag} {
|
||||
variable readyflag
|
||||
set readyflag $flag
|
||||
}
|
||||
::plc::set_readyflag 1
|
||||
publish ::plc::set_readyflag user
|
||||
} else {
|
||||
##
|
||||
# @brief Check if instrument is ready
|
||||
#
|
||||
# @return 1: if ready, 0: if not ready
|
||||
proc ::plc::inst_ready {} {
|
||||
if {[SplitReply [plc plc_ready]] == "True"} {
|
||||
return 1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user