Remove files accidentally added in rev 3071

D    site_ansto/hardsup/oldsct_modbusprot.c
D    site_ansto/hardsup/libhlib.a
D    site_ansto/instrument/deploySICS.sh.new
D    site_ansto/instrument/reflectometer/config/beamline/old_polanal.tcl
D    site_ansto/instrument/reflectometer/config/beamline/old_sct_RFGen.tcl
D    .cproject
D    cscope.out
D    tags
D    psi/hardsup/libhlib.a
D    psi/tecs/libtecsl.a

r3234 | ffr | 2011-07-24 13:13:46 +1000 (Sun, 24 Jul 2011) | 13 lines
This commit is contained in:
Ferdi Franceschini
2011-07-24 13:13:46 +10:00
committed by Douglas Clowes
parent 3c82aacfa1
commit 0b90dfc0dc
6 changed files with 0 additions and 7611 deletions

View File

@@ -1,222 +0,0 @@
#!/bin/sh
# $Revision: 1.28.10.1 $
# $Date: 2010-01-27 03:15:13 $
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Last revision by $Author: jgn $
# Deploys SICServer and configuration files to
# an instrument control computer.
# It requires a MANIFEST.TXT file for each instrument
# INSTCFCOMMON.TXT file contains paths to the common configuration files
# used by the instrument specific configurations, it should be placed in
# the 'config' directory for each instrument. The paths are relative
# to the instrument source directory. This file is optional.
usage()
{
cat <<EOF
deploySICS.sh copies SICS and the files listed
in the MANIFEST.TXT files to the IC host.
Usage:
./deploySICS.sh [-n] INSTRUMENT [TARGET_HOST [TARGET_DIR]]
where
-n if present inhibits the actual deployment (for testing the script)
INSTRUMENT can be hrpd, echidna, hipd, wombat, lyrebird ... (not "./xxx")
or test/INSTRUMENT or INSTRUMENT/test for test deployment
TARGET_HOST can be a remote host or 'localhost'
defaults to ics1-<instrument>.nbi... or ics1-test.nbi... for test
TARGET_DIR is the top part of the directory tree
defaults to /usr/local or /usr/local/TEST_SICS/<instrument> for test
tail directories in TARGET_DIR will be created on TARGET_HOST if necessary.
Examples:
./deploySICS.sh -n echidna
prepares deployment of echidna (./hrpd)
to directory /usr/local/sics on isc1-echidna.nbi.ansto.gov.au
./deploySICS.sh -n reflectometer/test
prepares deployment of platypus (./reflectometer)
to directory usr/local/TEST_SICS/platypus on isc1-test.nbi.ansto.gov.au
./deploySICS.sh -n test/echidna localhost $HOME
prepares deployment of echidna (./hrpd)
to directory $HOME/TEST_SICS/echidna on localhost
EOF
}
# Copy sics server configuration files to a given destination
# Usage: copy_server_config SERVER_DIRECTORY
copy_server_config() {
sicserver_path=$1
cp -a --preserve=timestamps $COMMON $INSTSPEC $TEMPDIR/$DESTDIR/$sicserver_path
if [ -e $INSTCFDIR/INSTCFCOMMON.TXT ]; then
for f in $(cat $INSTCFDIR/INSTCFCOMMON.TXT); do
cp --parents --preserve=timestamps $f $TEMPDIR/$DESTDIR/$sicserver_path
done
fi
}
shopt -s nocasematch
if [[ "$1" = "-n" ]]
then
DEPLOY="NO"
shift
else
DEPLOY="YES"
fi
if [ $# -eq 0 -o $# -gt 3 ]
then
usage
exit 1
fi
TESTING=$(dirname "$1")
INSTRUMENT=$(basename "$1")
if [[ "$INSTRUMENT" = "test" ]]
then
TESTING=$(basename "$1")
INSTRUMENT=$(dirname "$1")
fi
SRCDIR="."
TEMPDIR=$HOME/tmp
# Set the destination host
# instrument name and the
# instrument src directory
SICSDIR=sics
case $INSTRUMENT in
echidna|hrpd)
INSTRUMENT=echidna
DESTHOST=${2:-ics1-echidna.nbi.ansto.gov.au}
INSTSRC=$SRCDIR/hrpd;;
wombat|hipd)
INSTRUMENT=wombat
DESTHOST=${2:-ics1-wombat.nbi.ansto.gov.au}
INSTSRC=$SRCDIR/hipd;;
koala|qld)
INSTRUMENT=koala
DESTHOST=${2:-ics1-koala.nbi.ansto.gov.au}
INSTSRC=$SRCDIR/qld;;
platypus|reflectometer)
INSTRUMENT=platypus
DESTHOST=${2:-ics1-platypus.nbi.ansto.gov.au}
INSTSRC=$SRCDIR/reflectometer;;
kowari|rsd)
INSTRUMENT=kowari
DESTHOST=${2:-ics1-kowari.nbi.ansto.gov.au}
INSTSRC=$SRCDIR/rsd;;
quokka|sans)
INSTRUMENT=quokka
DESTHOST=${2:-ics1-quokka.nbi.ansto.gov.au}
INSTSRC=$SRCDIR/sans;;
pelican|pas)
INSTRUMENT=pelican
DESTHOST=${2:-ics1-pelican.nbi.ansto.gov.au}
INSTSRC=$SRCDIR/pas;;
lyrebird|lyrebird)
INSTRUMENT=lyrebird
DESTHOST=${2:-ics1-lyrebird.nbi.ansto.gov.au}
SICSDIR=nbi/lyrebird
INSTSRC=$SRCDIR/lyrebird;;
taipan|tas)
INSTRUMENT=taipan
DESTHOST=${2:-ics1-taipan.nbi.ansto.gov.au}
SICSDIR=nbi/taipan
INSTSRC=$SRCDIR/tas;;
esac
INSTCFDIR=$INSTSRC/config
make -C ../ $INSTRUMENT || exit $?
if [[ "$TESTING" = "test" ]]
then
DESTHOST=${2:-ics1-test.nbi.ansto.gov.au}
DESTDIR=${3:-/usr/local}/TEST_SICS/$INSTRUMENT
TARDIR=${DESTDIR:1}
# remove and recreate the temporary directory
rm -fr $TEMPDIR/$DESTDIR
mkdir -p $TEMPDIR/$DESTDIR
#copy TEST_SICS/fakeDMC and remove .svn any directories
cp -a $SRCDIR/TEST_SICS/* $TEMPDIR/$DESTDIR
rm -fr $(find $TEMPDIR/$DESTDIR -name .svn)
# step down to the sics directory
DESTDIR=$DESTDIR/$SICSDIR
mkdir -p $TEMPDIR/$DESTDIR
else
DESTDIR=${3:-/usr/local}/$SICSDIR
TARDIR=${DESTDIR:1}
# remove and recreate the temporary directory
rm -fr $TEMPDIR/$DESTDIR
mkdir -p $TEMPDIR/$DESTDIR
fi
echo "Deploying $INSTRUMENT to $DESTHOST:$DESTDIR"
EXTRACT_CMDS="tar vxzp -C /; touch /$DESTDIR/newserver/{DataNumber,extraconfig.tcl,config/nexus/nexus.dic} "
if [[ "$DESTHOST" = "localhost" ]]
then
EXTRACT=$EXTRACT_CMDS
EXTRACT_NODEPLOY=$EXTRACT_CMDS
elif [[ "$TESTING" != "test" ]]
then
EXTRACT="ssh $DESTHOST $EXTRACT_CMDS; chown -R root:root /$DESTDIR; chown ${INSTRUMENT}_sics. /$DESTDIR/newserver/{DataNumber,config/nexus/nexus.dic}; chown ${INSTRUMENT}. /$DESTDIR/newserver/extraconfig.tcl"
EXTRACT_NODEPLOY="ssh $DESTHOST "$EXTRACT_CMDS; chown -R root:root /$DESTDIR; chown ${INSTRUMENT}_sics. /$DESTDIR/newserver/{DataNumber,config/nexus/nexus.dic}; chown ${INSTRUMENT}. /$DESTDIR/newserver/extraconfig.tcl""
else
EXTRACT="ssh $DESTHOST $EXTRACT_CMDS"
EXTRACT_NODEPLOY="ssh $DESTHOST "$EXTRACT_CMDS""
fi
if [ ! -e $SRCDIR/MANIFEST.TXT ]
then
echo "$SRCDIR/MANIFEST.TXT not found"
exit 1
fi
if [ ! -e $SRCDIR/$INSTSRC/MANIFEST.TXT ]
then
echo "$SRCDIR/$INSTSRC/MANIFEST.TXT not found"
echo "You must list the files required for $INSTRUMENT in the manifest"
exit 1
fi
# Get list of files to copy and prepend directory name
COMMON=$(for f in $(cat $SRCDIR/MANIFEST.TXT); do echo -n "$SRCDIR/$f "; done)
INSTSPEC=$(for f in $(cat $INSTSRC/MANIFEST.TXT); do echo -n "$INSTSRC/$f "; done)
# Create Instrument Control Server directories and copy SICS configs to the 'server' directory
mkdir -p $TEMPDIR/$DESTDIR/{batch,newserver,log,tmp}
copy_server_config newserver
cp -a --preserve=timestamps ../SICServer $TEMPDIR/$DESTDIR/newserver
# Create Script Validator directories
mkdir -p $TEMPDIR/$DESTDIR/script_validator/{data,log,tmp}
# Create a manifest of the files installed on the IC host
echo "Date: $(date -Iminutes)" > $TEMPDIR/$DESTDIR/newserver/MANIFEST.TXT
echo -e "The following files were installed by $USER\n" >> $TEMPDIR/$DESTDIR/newserver/MANIFEST.TXT
cat $SRCDIR/MANIFEST.TXT $SRCDIR/$INSTSRC/MANIFEST.TXT >> $TEMPDIR/$DESTDIR/newserver/MANIFEST.TXT
cd $TEMPDIR
# remove any .svn directories
rm -rf $(find $TARDIR -type d -name .svn)
# remove any temporary editor files
find $TARDIR -type f -name .\*.sw\? -exec rm {} \;
# remove any editor backup files directories
find $TARDIR -type f -name \*~ -exec rm {} \;
# set modes for files
find $TARDIR -type f -exec chmod u-s,g-x+wr,o-wx+r {} \;
find $TARDIR -type f -perm -100 -exec chmod go+x {} \;
# set modes for directories
find $TARDIR -type d -exec chmod u+rwx,g+rwxs,o-w+rx {} \;
# Strip leading / from DESTDIR and extract to destination
if [[ "$DEPLOY" = "YES" ]]
then
tar -cz ${TARDIR} | $EXTRACT
else
echo "tar -cz -C $TEMPDIR $TARDIR | $EXTRACT_NODEPLOY"
fi

View File

@@ -1,32 +0,0 @@
fileeval $cfPath(beamline)/sct_RFGen.tcl
# NOTE: opCurr is 10 * your operating current, ie if the current is 7.1 then opCurr = 71
::scobj::rfgen::mkRFGen {
name "polarizer_flipper"
address 1
opCurr 71
opFreq 407
IP 137.157.202.149
PORT 4001
tuning 1
interval 2
currtol 1
compCurr 1
guideCurr 1
thickness 1
}
::scobj::rfgen::mkRFGen {
name "analyzer_flipper"
address 9
opCurr 71
opFreq 407
IP 137.157.202.149
PORT 4002
tuning 1
interval 2
currtol 1
compCurr 1
guideCurr 1
thickness 1
}

View File

@@ -1,419 +0,0 @@
##
# @file Mirrotron RF Generator control
#
# Author: Ferdi Franceschini (ffr@ansto.gov.au) May 2010
#
# The controller can be installed with the following command,
# ::scobj::rfgen::mkRFGen {
# name "anal"
# address 1
# opCurr 68
# opFreq 241
# IP localhost
# PORT 65123
# tuning 1
# currtol 1
# interval 2
# }
#
# NOTE:
# If tuning=1 this will generate xxx/set_current and xxx/set_frequency
# nodes for the instrument scientists.
# The tuning parameter should be set to 0 for the users.
#
# The operation_manual_Platypus_polarization_system.doc:Sec 3.1 states the following
# Attention
# a) Do not switch on the RF output with non-zero current setting (the current
# control becomes unstable)! If unsure, rotate the current setting
# potentiometer 10 turns counter-clockwise.
# b) In case of RF vacuum discharge (harmful for the system)
# " the main symptom is that the RF power source turns into CV mode, the
# voltage increases to 34 Vem and the current decreases;
# " switch off the RF output;
# " decrease current setting by rotating the potentiometer 10 turns counter-clockwise;
# " verify the vacuum level in the tank and restart the flipper operation only if it is below 0.01 mbar.
namespace eval ::scobj::rfgen {
# Control states
variable RAMPIDLE 0
variable RAMPSTOP 1
variable RAMPSTART 2
variable RAMPBUSY 3
variable RAMPTOZERO 4
variable FLIPOFF 5
variable MAXVOLTAGE 34
}
##
# @brief Utility for trimming zero padding from current and frequency readings.
# We do this to avoid misinterpreting numbers as octal
proc ::scobj::rfgen::mkStatArr {stateArrName stateReport} {
upvar $stateArrName stateArr
array set stateArr $stateReport
if {$stateArr(curr) != 0} {
set val [string trimleft $stateArr(curr) 0]
if {[string is integer $val]} {
set stateArr(curr) $val
} else {
set stateArr(curr) -1
}
}
if {$stateArr(freq) != 0} {
set val [string trimleft $stateArr(freq) 0]
if {[string is integer $val]} {
set stateArr(freq) $val
} else {
set stateArr(freq) -1
}
}
if {$stateArr(voltage) != 0} {
set val [string trimleft $stateArr(voltage) 0]
if {[string is integer $val]} {
set stateArr(voltage) $val
} else {
set stateArr(voltage) -1
}
}
}
##
# @brief Switch the generator on or off
proc ::scobj::rfgen::switch_on {basePath} {
variable RAMPSTART
variable RAMPTOZERO
set genState [sct target]
switch $genState {
"0" {
hsetprop $basePath targetCurr 0
hsetprop $basePath OutputState 0
hsetprop $basePath ramping $RAMPSTART
sct update 0
sct utime updatetime
}
"1" {
hsetprop $basePath targetCurr [hgetpropval $basePath opCurr]
hsetprop $basePath targetFreq [hgetpropval $basePath opFreq]
hsetprop $basePath OutputState 1
hsetprop $basePath ramping $RAMPSTART
sct update 1
sct utime updatetime
}
default {
set ErrMsg "[sct] invalid input $genState, Valid states for [sct] are 1 or 0"
sct seterror "ERROR: $ErrMsg"
return -code error $ErrMsg
}
}
return idle
}
##
# @brief Get the target current and scale it for the RF generator.
# Also updates the operating current for this session.
#
# @param basePath, The object base-path, this is where we keep our state variables.
proc ::scobj::rfgen::set_current {basePath} {
variable RAMPSTART
set newCurr [sct target]
set current [expr {round(10.0 * $newCurr)}]
hsetprop $basePath targetCurr $current
hsetprop $basePath opCurr $current
hsetprop $basePath ramping $RAMPSTART
hsetprop $basePath OutputState 1
return idle
}
##
# @brief Get the target frequency. Also updates the operating frequency for this session.
#
# @param basePath, The object base-path, this is where we keep our state variables.
proc ::scobj::rfgen::set_frequency {basePath} {
variable RAMPSTART
set newFreq [sct target]
hsetprop $basePath targetFreq $newFreq
hsetprop $basePath opFreq $newFreq
hsetprop $basePath ramping $RAMPSTART
hsetprop $basePath OutputState 1
return idle
}
##
# @brief Request a state report from the RF generator
proc ::scobj::rfgen::rqStatFunc {} {
sct send "L:[sct address]"
return rdState
}
##
# @brief Read and record the state report from the RF generator
proc ::scobj::rfgen::rdStatFunc {} {
variable RAMPBUSY
variable RAMPSTART
variable RAMPTOZERO
variable RAMPIDLE
variable FLIPOFF
variable MAXVOLTAGE
set basePath [sct]
set currSuperState [sct ramping]
set updateFlipper 0
set statStr [sct result]
if {[string match "ASCERR:*" $statStr]} {
sct geterror $statStr
sct ramping $RAMPIDLE
return stateChange
}
set statList [split $statStr "|="]
foreach {k v} $statList {
if {$k == "type"} {
lappend temp "$k $v"
continue
}
if {[string is integer $v]} {
lappend temp "$k $v"
} else {
lappend temp "$k -1"
}
}
set statList [join $temp]
mkStatArr stateArr $statList
if {$statList != [sct oldStateRep]} {
hset $basePath/flip_current [expr {$stateArr(curr) / 10.0}]
hset $basePath/flip_frequency $stateArr(freq)
hset $basePath/flip_voltage $stateArr(voltage)
hset $basePath/flip_on $stateArr(O)
hset $basePath/state_report $statList
sct update $statList
sct utime updatetime
sct oldStateRep $statList
}
if {$currSuperState != $FLIPOFF && $stateArr(curr) > [sct currTol] && $stateArr(O) && $stateArr(CV)} {
broadcast "WARNING: RF generator has switched to voltage control, voltage = $stateArr(voltage)"
if {$stateArr(voltage) >= $MAXVOLTAGE} {
sct ramping $FLIPOFF
}
}
return stateChange
}
##
# @brief State transition function
proc ::scobj::rfgen::stateFunc {} {
variable RAMPIDLE
variable RAMPSTOP
variable RAMPSTART
variable RAMPBUSY
variable RAMPTOZERO
variable FLIPOFF
variable MAXVOLTAGE
set basePath [sct]
set currSuperState [sct ramping]
mkStatArr stateArr [hval $basePath/state_report]
set currControlStatus [sct status]
switch $currSuperState [ subst -nocommands {
$RAMPSTART {
# broadcast RAMPSTART
if [string match $currControlStatus "IDLE"] {
statemon start flipper
sct status "BUSY"
sct ramping $RAMPBUSY
return ramp
} else {
# Flipper is off, set current to zero before switching on
sct origTargetCurr [sct targetCurr]
sct targetCurr 0
sct OutputState 0
sct ramping $RAMPTOZERO
return ramp
}
}
$RAMPTOZERO {
# broadcast RAMPTOZERO
if {$stateArr(curr) <= [sct currTol]} {
# We've reached a safe state so switch on and ramp to target current
sct targetCurr [sct origTargetCurr]
sct OutputState 1
sct ramping $RAMPBUSY
} else {
sct targetCurr 0
sct OutputState 0
}
return ramp
}
$RAMPBUSY {
# broadcast RAMPBUSY
if { [expr {abs($stateArr(curr) - [sct targetCurr])}] <= [sct currTol] } {
sct ramping $RAMPSTOP
return idle
}
return ramp
}
$FLIPOFF {
sct targetCurr 0
sct OutputState 0
if { $stateArr(curr) <= [sct currTol] } {
sct ramping $RAMPSTOP
broadcast "ERROR: Spin flipper switched off voltage exceeds $MAXVOLTAGE in voltage control state, check vacuum"
return idle
} else {
return ramp
}
}
$RAMPSTOP {
# broadcast RAMPSTOP
if [string match $currControlStatus "BUSY"] {
statemon stop flipper
sct status "IDLE"
}
sct ramping $RAMPIDLE
return idle
}
$RAMPIDLE {
# broadcast RAMPIDLE
return idle
}
}]
}
##
# @brief Ramps the current up or down in steps of 0.5A and/or sets the frequency
proc ::scobj::rfgen::rampFunc {} {
set basePath [sct]
set currSuperState [sct ramping]
mkStatArr stateArr [hval $basePath/state_report]
set targetCurr [sct targetCurr]
set targetFreq [sct targetFreq]
set output [sct OutputState]
if { [expr {abs($stateArr(curr) - [sct targetCurr])}] <= [sct currTol] } {
set curr $stateArr(curr)
} elseif {$targetCurr < $stateArr(curr)} {
set curr [expr $stateArr(curr)-5]
if {$curr < $targetCurr} {
set curr $targetCurr
}
} elseif {$targetCurr > $stateArr(curr)} {
set curr [expr $stateArr(curr)+5]
if {$curr > $targetCurr} {
set curr $targetCurr
}
}
set reply [$SCT_RFGEN send "S:[sct address]:I=$curr:F=$targetFreq:K3=$stateArr(K3):K2=$stateArr(K2):K1=$stateArr(K1):O=$output"]
return idle
}
##
# @brief Make an RF generator control object
#
# @param argList, {name "analyser" address "1" opCurr 68 opFreq 241 IP localhost PORT 65123 tuning 0 interval 1}
#
# name: name of RF generator object
# address: address assigned to RF generator 1-9
# opCurr: the operating current, when you switch it on it will ramp to this current
# opFreq: the operating frequency, when you switch it on it will set this frequency
# IP: IP address of RF generator moxa box
# PORT: Port number assigned to the generator on the moxa-box
# tuning: boolean, set tuning=1 to allow instrument scientists to set the current and frequency
# interval: polling and ramping interval in seconds. One sets the ramp rate to 0.5A/s
proc ::scobj::rfgen::mkRFGen {argList} {
variable RAMPIDLE
# Generate parameter array from the argument list
foreach {k v} $argList {
set KEY [string toupper $k]
set pa($KEY) $v
}
MakeSICSObj $pa(NAME) SCT_OBJECT
sicslist setatt $pa(NAME) klass instrument
sicslist setatt $pa(NAME) long_name $pa(NAME)
# hfactory /sics/$pa(NAME)/status plain spy text
hsetprop /sics/$pa(NAME) status "IDLE"
hfactory /sics/$pa(NAME)/state_report plain internal text
hfactory /sics/$pa(NAME)/flip_current plain internal float
hfactory /sics/$pa(NAME)/flip_frequency plain internal int
hfactory /sics/$pa(NAME)/flip_voltage plain internal int
hfactory /sics/$pa(NAME)/flip_on plain internal int
hsetprop /sics/$pa(NAME) read ::scobj::rfgen::rqStatFunc
hsetprop /sics/$pa(NAME) rdState ::scobj::rfgen::rdStatFunc
hsetprop /sics/$pa(NAME) stateChange ::scobj::rfgen::stateFunc
hsetprop /sics/$pa(NAME) ramp ::scobj::rfgen::rampFunc
hsetprop /sics/$pa(NAME) address $pa(ADDRESS)
hsetprop /sics/$pa(NAME) tuning $pa(TUNING)
hsetprop /sics/$pa(NAME) ramping $RAMPIDLE
hsetprop /sics/$pa(NAME) opCurr $pa(OPCURR)
hsetprop /sics/$pa(NAME) opFreq $pa(OPFREQ)
hsetprop /sics/$pa(NAME) targetCurr 0
hsetprop /sics/$pa(NAME) origTargetCurr 0
hsetprop /sics/$pa(NAME) oldStateRep ""
hsetprop /sics/$pa(NAME) currTol $pa(CURRTOL)
hfactory /sics/$pa(NAME)/comp_current plain internal float
hsetprop /sics/$pa(NAME)/comp_current units "A"
hset /sics/$pa(NAME)/comp_current $pa(COMPCURR)
hfactory /sics/$pa(NAME)/guide_current plain internal float
hsetprop /sics/$pa(NAME)/guide_current units "A"
hset /sics/$pa(NAME)/guide_current $pa(GUIDECURR)
hfactory /sics/$pa(NAME)/thickness plain internal float
hsetprop /sics/$pa(NAME)/thickness units "mm"
hset /sics/$pa(NAME)/thickness $pa(THICKNESS)
hfactory /sics/$pa(NAME)/switch_on plain user int
hsetprop /sics/$pa(NAME)/switch_on write ::scobj::rfgen::switch_on /sics/$pa(NAME)
# Only create the set current and frequency nodes when commissioning
# Initialise properties required for generating the API for GumTree and to save data
::scobj::hinitprops $pa(NAME) flip_current flip_frequency flip_voltage flip_on comp_current guide_current thickness
hsetprop /sics/$pa(NAME)/comp_current mutable false
hsetprop /sics/$pa(NAME)/guide_current mutable false
hsetprop /sics/$pa(NAME)/thickness mutable false
if {[SplitReply [rfgen_simulation]] == "false"} {
set SCT_RFGEN sct_rfgen_$pa(NAME)
makesctcontroller $SCT_RFGEN rfamp $pa(IP):$pa(PORT)
mkStatArr stateArr [split [$SCT_RFGEN transact "L:$pa(ADDRESS)"] "|="]
hset /sics/$pa(NAME)/flip_current [expr {$stateArr(curr) / 10.0}]
hset /sics/$pa(NAME)/flip_frequency $stateArr(freq)
hset /sics/$pa(NAME)/flip_voltage $stateArr(voltage)
hset /sics/$pa(NAME)/flip_on $stateArr(O)
hsetprop /sics/$pa(NAME) targetFreq $stateArr(freq)
hsetprop /sics/$pa(NAME) targetCurr [expr {$stateArr(curr) / 10.0}]
$SCT_RFGEN poll /sics/$pa(NAME) $pa(INTERVAL)
$SCT_RFGEN write /sics/$pa(NAME)/switch_on
}
if {$pa(TUNING)} {
hfactory /sics/$pa(NAME)/set_current plain user float
hfactory /sics/$pa(NAME)/set_frequency plain user int
hsetprop /sics/$pa(NAME)/set_current write ::scobj::rfgen::set_current /sics/$pa(NAME)
hsetprop /sics/$pa(NAME)/set_frequency write ::scobj::rfgen::set_frequency /sics/$pa(NAME)
if {[SplitReply [rfgen_simulation]] == "false"} {
$SCT_RFGEN write /sics/$pa(NAME)/set_current
$SCT_RFGEN write /sics/$pa(NAME)/set_frequency
}
}
}