Merge branch 'RELEASE-3_1' into RELEASE-3_2

Conflicts:
	sics/site_ansto/instrument/config/beamline/sct_he3_polanal.tcl
	sics/site_ansto/instrument/hipd/wombat_configuration.tcl
	sics/site_ansto/instrument/hrpd/echidna_configuration.tcl
	sics/site_ansto/instrument/pelican/pelican_configuration.tcl
This commit is contained in:
Douglas Clowes
2014-09-01 13:23:21 +10:00
69 changed files with 3633 additions and 1057 deletions

View File

@ -18,7 +18,6 @@
#include <ctype.h>
#include <stdarg.h>
#include <sics.h>
#include <rs232controller.h>
#include "network.h"
#include "asyncqueue.h"
#include "nwatch.h"

View File

@ -20,7 +20,7 @@
*/
#define PROTOCOL_NAME "MODBUS_AP"
#define PROTOCOL_INIT MODBUSInitProtocol
#define ADUSIZE 17
#define ADUSIZE 300
/*
* MODBUS DataTypes
@ -63,7 +63,7 @@ struct modbus_private_t {
int aduLen;
int RespLen;
int DatLen;
unsigned char ADU[ADUSIZE]; /* Allows upto 8 bytes if data */
unsigned char ADU[ADUSIZE]; /* Allows up to 255 bytes of data */
pDynString rdBuffer;
};
@ -89,6 +89,10 @@ static ProtoPrivate *makeProtoPrivate()
static ProtoPrivate *Proto_KillPrivate(ProtoPrivate *priv)
{
if (priv) {
if (priv->wrBuffer) {
DeleteDynString(priv->wrBuffer);
priv->wrBuffer = NULL;
}
if (priv->rxBuffer) {
DeleteDynString(priv->rxBuffer);
priv->rxBuffer = NULL;
@ -268,7 +272,7 @@ static int ModbusOutput(pPrivate myPriv, pDynString wrBuffer, pDynString send_bu
int ADUlen, PDUlenPlusUID;
unsigned int i, j;
char *cmdLine;
unsigned char ADU[32], ieee[4];
unsigned char ADU[ADUSIZE], ieee[4];
cmdLine = GetCharArray(wrBuffer);
for (i=0; i < 4; i++)

View File

@ -248,6 +248,7 @@ proc ::scobj::astrium_chopper::mkDriver { sct_controller name device_class simul
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver astrium_chopper
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -624,6 +625,7 @@ proc ::scobj::astrium_chopper::mkDriver { sct_controller name device_class simul
hsetprop ${scobj_hpath}/disk_4 data "true"
hsetprop ${scobj_hpath}/disk_4 klass "@none"
hsetprop ${scobj_hpath}/disk_4 type "part"
hsetprop ${scobj_hpath} driver astrium_chopper
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -203,6 +203,7 @@ proc ::scobj::shutters::mkDriver { sct_controller name device_class simulation_f
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver shutters
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -285,6 +286,7 @@ proc ::scobj::shutters::mkDriver { sct_controller name device_class simulation_f
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} nxsave "true"
hsetprop ${scobj_hpath} type "part"
hsetprop ${scobj_hpath} driver shutters
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -211,6 +211,7 @@ proc ::scobj::tank::mkDriver { sct_controller name device_class simulation_flag
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver tank
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -334,6 +335,7 @@ proc ::scobj::tank::mkDriver { sct_controller name device_class simulation_flag
hsetprop ${scobj_hpath}/switches data "true"
hsetprop ${scobj_hpath}/switches klass "@none"
hsetprop ${scobj_hpath}/switches type "part"
hsetprop ${scobj_hpath} driver tank
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -337,6 +337,7 @@ proc ::scobj::aerolas_doppler::mkDriver { sct_controller name device_class simul
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver aerolas_doppler
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -4303,6 +4304,7 @@ proc ::scobj::aerolas_doppler::mkDriver { sct_controller name device_class simul
hsetprop ${scobj_hpath}/testing/shorts klass "@none"
hsetprop ${scobj_hpath}/testing/shorts type "part"
}
hsetprop ${scobj_hpath} driver aerolas_doppler
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -207,6 +207,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver he3_polanal
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -593,6 +594,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/polariser_start klass "@none"
hsetprop ${scobj_hpath}/polariser_start type "part"
}
hsetprop ${scobj_hpath} driver he3_polanal
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -216,6 +216,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver he3_polanal
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -416,6 +417,7 @@ proc ::scobj::he3_polanal::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/polariser klass "@none"
hsetprop ${scobj_hpath}/polariser type "part"
# End of named group: polariser
hsetprop ${scobj_hpath} driver he3_polanal
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 0

View File

@ -100,6 +100,8 @@ proc ::scobj::agilent_33220A::read_config {} {
}
if { [string equal -nocase [dict get $v "driver"] "agilent_33220A"] } {
::scobj::agilent_33220A::sics_log 9 "No sctcontroller for agilent_33220A"
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
}
}

View File

@ -797,6 +797,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver hiden_xcs
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -1264,6 +1265,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
hsetprop ${scobj_hpath}/humidity nxsave "true"
hsetprop ${scobj_hpath}/humidity type "part"
ansto_makesctdrive ${name}_humidity_setpoint ${scobj_hpath}/humidity/setpoint ${scobj_hpath}/humidity/sensor ${sct_controller}
hsetprop ${scobj_hpath} driver hiden_xcs
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -304,6 +304,7 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver huber_pilot
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -480,6 +481,7 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/Loop1 klass "@none"
hsetprop ${scobj_hpath}/Loop1 type "part"
ansto_makesctdrive ${name}_Loop1_setpoint ${scobj_hpath}/Loop1/setpoint ${scobj_hpath}/Loop1/sensor_int ${sct_controller}
hsetprop ${scobj_hpath} driver huber_pilot
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -250,6 +250,7 @@ proc ::scobj::isotech_ps::mkDriver { sct_controller name device_class simulation
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver isotech_ps
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -331,6 +332,7 @@ proc ::scobj::isotech_ps::mkDriver { sct_controller name device_class simulation
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
hsetprop ${scobj_hpath} driver isotech_ps
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -37,10 +37,12 @@ proc ::scobj::keithley_m2700::mkDriver { sct_controller name device_class simula
MakeSICSObj ${name} SCT_OBJECT user float
sicslist setatt ${name} driver keithley_m2700
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver keithley_m2700
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -0,0 +1,159 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver keysight_N8740A = {
vendor = keysight; device = N8740A;
protocol = std
class = instrument
simulation_group = environment_simulation
group = {
type = int;
var output_enable = {
readable = 2; read_command = 'OUTPUT:STATE?';
writeable = 1; write_command = 'OUTPUT:STATE ';
allowed = '0,1';
}
type = float;
var amps = {
readable = 1; read_command = 'MEASURE:SCALAR:CURRENT:DC?';
units = 'A';
}
var volts = {
readable = 1; read_command = 'MEASURE:SCALAR:VOLTAGE:DC?';
units = 'V';
}
var setpoint = {
readable = 1; fetch_function = read_setpoint; read_command = 'SOURCE:VOLTAGE?';
writeable = 1; write_function = write_setpoint; write_command = 'SOURCE:VOLTAGE ';
driveable = working_setpoint;
tolerance = 1; property settle_time = 5;
lowerlimit = 0; upperlimit = 150;
units = 'V';
}
var ramp_rate = {
type = float;
value = 1.0;
units = 'V/S';
writeable = 1; write_function = write_direct;
lowerlimit = 0; upperlimit = 15;
}
var working_setpoint = {
type = float;
readable = 1; read_command = 'SOURCE:VOLTAGE?';
writeable = 1; write_function = write_direct;
units = 'V';
}
}
group current = {
type = float;
var prot_enable = {
type = int;
readable = 1; read_command = 'SOURCE:CURRENT:PROTECTION:STATE?';
writeable = 1; write_command = 'SOURCE:CURRENT:PROTECTION:STATE ';
allowed = '0,1';
}
var prot_limit = {
readable = 1; read_command = 'SOURCE:CURRENT?';
writeable = 1; write_command = 'SOURCE:CURRENT ';
lowerlimit = 0; upperlimit = 22;
units = 'A';
}
}
group voltage = {
type = float;
var lolimit = {
readable = 1; read_command = 'SOURCE:VOLTAGE:LIMIT:LOW?';
writeable = 1; write_command = 'SOURCE:VOLTAGE:LIMIT:LOW ';
units = 'V';
}
var hilimit = {
readable = 1; read_command = 'SOURCE:VOLTAGE:PROTECTION?';
writeable = 1; write_command = 'SOURCE:VOLTAGE:PROTECTION ';
lowerlimit = 0; upperlimit = 165;
units = 'V';
}
}
group system = {
type = text;
data = false; control = false; mutable = false; nxsave = false;
var ident = {
readable = 15; read_command = '*IDN?';
}
var error = {
readable = 1; read_command = 'SYSTEM:ERROR?';
}
var version = {
readable = 15; read_command = 'SYSTEM:VERSION?';
}
}
code setValue = {
@TCL
set cmd "${cmd_str}${par}@@NOREPLY@@"
@END
}
code write_direct = {
@TCL
set cmd "@@NOSEND@@"
sct result ""
if { [sct target] != [sct oldval] } {
debug_log ${tc_root} 1 "[sct] changed to new:[sct target], from old:[sct oldval]"
sct oldval [sct target]
sct update [sct target]
sct utime readtime
}
@END
}
code write_setpoint = {
@TCL
set cmd "@@NOSEND@@"
sct result ""
sct ramp_start_time [sct utime]
sct ramp_start_value [hval ${tc_root}/working_setpoint]
sct ramp_rate_value [hval ${tc_root}/ramp_rate]
if { [sct target] != [sct oldval] } {
debug_log ${tc_root} 1 "[sct] changed to new:[sct target], from old:[sct oldval]"
sct oldval [sct target]
sct update [sct target]
sct utime readtime
}
@END
}
code read_setpoint = {
@TCL
if { [hpropexists [sct] target] } {
set target [sct target]
if { [hval ${tc_root}/working_setpoint] != ${target} } {
set elapsed_time [expr {[sct utime] - [sct ramp_start_time]}]
debug_log ${tc_root} 1 "read_setpoint elapsed_time = ${elapsed_time}"
if {[hpropexists [sct] ramp_rate_value] && [sct ramp_rate_value] > 0.0} {
set ramped_value [expr {[sct ramp_rate_value] * ${elapsed_time}}]
debug_log ${tc_root} 1 "read_setpoint ramped_value = ${ramped_value}"
if { ${target} > [hval ${tc_root}/working_setpoint] } {
set working_setpoint [expr {[sct ramp_start_value] + ${ramped_value}}]
debug_log ${tc_root} 1 "read_setpoint working_setpoint+ = ${working_setpoint}"
if { ${working_setpoint} > ${target} } {
set working_setpoint ${target}
}
} else {
set working_setpoint [expr {[sct ramp_start_value] - ${ramped_value}}]
debug_log ${tc_root} 1 "read_setpoint working_setpoint- = ${working_setpoint}"
if { ${working_setpoint} < ${target} } {
set working_setpoint ${target}
}
}
} else {
set working_setpoint ${target}
debug_log ${tc_root} 1 "read_setpoint working_setpoint = ${working_setpoint}"
}
if {![hpropexists [sct] ramp_rate_value] || [sct ramp_rate_value] != [hval ${tc_root}/ramp_rate]} {
sct ramp_start_time [sct utime]
sct ramp_start_value [hval ${tc_root}/working_setpoint]
sct ramp_rate_value [hval ${tc_root}/ramp_rate]
}
set cmd "SOURCE:VOLTAGE ${working_setpoint}@@NOREPLY@@"
sct result [hval ${tc_root}/working_setpoint]
}
} else {
# cmd is fine
}
@END
}
}

View File

@ -0,0 +1,843 @@
# Generated driver for keysight_N8740A
# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent
#
namespace eval ::scobj::keysight_N8740A {
set debug_threshold 5
}
proc ::scobj::keysight_N8740A::debug_log {tc_root debug_level debug_string} {
set catch_status [ catch {
set debug_threshold [hgetpropval ${tc_root} debug_threshold]
if {${debug_level} >= ${debug_threshold}} {
set now [clock seconds]
set ts [clock format ${now} -format "%Y%m%d"]
set log_file_name "../log/keysight_N8740A_[basename ${tc_root}]_${ts}.log"
set fd [open "${log_file_name}" "a"]
set ts [clock format ${now} -format "%T"]
puts ${fd} "${ts} ${debug_string}"
close ${fd}
}
} catch_message ]
}
proc ::scobj::keysight_N8740A::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::keysight_N8740A::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::keysight_N8740A::${debug_string}"
}
} catch_message ]
}
# checklimits function for driveable interface
proc ::scobj::keysight_N8740A::checklimits {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "checklimits tc_root=${tc_root} sct=[sct] target=[sct target]"
set setpoint [sct target]
if { [hpropexists [sct] lowerlimit] } {
set lolimit [sct lowerlimit]
} else {
# lowerlimit not set, use target
set lolimit [sct target]
}
if { [hpropexists [sct] upperlimit] } {
set hilimit [sct upperlimit]
} else {
# upperlimit not set, use target
set hilimit [sct target]
}
# checklimits hook code goes here
if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {
sct driving 0
error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"
}
return OK
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# check function for hset change
proc ::scobj::keysight_N8740A::checkrange {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "checkrange tc_root=${tc_root} sct=[sct] target=[sct target]"
set setpoint [sct target]
if { [hpropexists [sct] lowerlimit] } {
set lolimit [sct lowerlimit]
} else {
# lowerlimit not set, use target
set lolimit [sct target]
}
if { [hpropexists [sct] upperlimit] } {
set hilimit [sct upperlimit]
} else {
# upperlimit not set, use target
set hilimit [sct target]
}
# checkrange hook code goes here
if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {
error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"
}
return OK
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# checkstatus function for driveable interface
proc ::scobj::keysight_N8740A::checkstatus {tc_root} {
set catch_status [ catch {
# checkstatus hook code goes here
if {[sct driving]} {
set sp "[sct target]"
if {[hpropexists [sct] simulated] && [sct simulated] == "true"} {
set pv "${sp}"
hupdateif ${tc_root}/[sct driveable] ${sp}
} else {
set pv "[hval ${tc_root}/[sct driveable]]"
}
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
if { [hpropexists [sct] settle_time] } {
if { [hpropexists [sct] settle_time_start] } {
if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} {
sct driving 0
return "idle"
}
return "busy"
} else {
sct utime settle_time_start
return "busy"
}
}
sct driving 0
return "idle"
}
if { [hpropexists [sct] settle_time_start] } {
hdelprop [sct] settle_time_start
}
return "busy"
} else {
return "idle"
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to request the read of a parameter on a device
proc ::scobj::keysight_N8740A::getValue {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "getValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set cmd "${cmd_str}"
# getValue hook code goes here
debug_log ${tc_root} 1 "getValue sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# halt function for driveable interface
proc ::scobj::keysight_N8740A::halt {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "halt tc_root=${tc_root} sct=[sct] driving=[sct driving]"
### TODO hset [sct] [hval [sct]]
# halt hook code goes here
sct driving 0
return "idle"
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to check the write parameter on a device
proc ::scobj::keysight_N8740A::noResponse {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "noResponse tc_root=${tc_root} sct=[sct] resp=[sct result]"
# noResponse hook code goes here
return "idle"
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to parse the read of a parameter on a device
proc ::scobj::keysight_N8740A::rdValue {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "rdValue tc_root=${tc_root} sct=[sct] result=[sct result]"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set data [sct result]
set nextState "idle"
if {[string equal -nocase -length 7 ${data} "ASCERR:"]} {
# the protocol driver has reported an error
sct geterror "${data}"
error "[sct geterror]"
}
# rdValue hook code goes here
if { ${data} != [sct oldval] } {
debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]"
sct oldval ${data}
sct update ${data}
sct utime readtime
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to request the read of a parameter on a device
proc ::scobj::keysight_N8740A::read_setpoint {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "read_setpoint tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set cmd "${cmd_str}"
# read_setpoint hook code starts
if { [hpropexists [sct] target] } {
set target [sct target]
if { [hval ${tc_root}/working_setpoint] != ${target} } {
set elapsed_time [expr {[sct utime] - [sct ramp_start_time]}]
debug_log ${tc_root} 1 "read_setpoint elapsed_time = ${elapsed_time}"
if {[hpropexists [sct] ramp_rate_value] && [sct ramp_rate_value] > 0.0} {
set ramped_value [expr {[sct ramp_rate_value] * ${elapsed_time}}]
debug_log ${tc_root} 1 "read_setpoint ramped_value = ${ramped_value}"
if { ${target} > [hval ${tc_root}/working_setpoint] } {
set working_setpoint [expr {[sct ramp_start_value] + ${ramped_value}}]
debug_log ${tc_root} 1 "read_setpoint working_setpoint+ = ${working_setpoint}"
if { ${working_setpoint} > ${target} } {
set working_setpoint ${target}
}
} else {
set working_setpoint [expr {[sct ramp_start_value] - ${ramped_value}}]
debug_log ${tc_root} 1 "read_setpoint working_setpoint- = ${working_setpoint}"
if { ${working_setpoint} < ${target} } {
set working_setpoint ${target}
}
}
} else {
set working_setpoint ${target}
debug_log ${tc_root} 1 "read_setpoint working_setpoint = ${working_setpoint}"
}
if {![hpropexists [sct] ramp_rate_value] || [sct ramp_rate_value] != [hval ${tc_root}/ramp_rate]} {
sct ramp_start_time [sct utime]
sct ramp_start_value [hval ${tc_root}/working_setpoint]
sct ramp_rate_value [hval ${tc_root}/ramp_rate]
}
set cmd "SOURCE:VOLTAGE ${working_setpoint}@@NOREPLY@@"
sct result [hval ${tc_root}/working_setpoint]
}
} else {
# cmd is fine
}
# read_setpoint hook code ends
if { [hpropexists [sct] geterror] } {
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
error "[sct geterror]"
}
debug_log ${tc_root} 1 "read_setpoint sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to write a parameter value on a device
proc ::scobj::keysight_N8740A::setValue {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "setValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set par [sct target]
set cmd "${cmd_str}${par}"
# setValue hook code starts
set cmd "${cmd_str}${par}@@NOREPLY@@"
# setValue hook code ends
if { [hpropexists [sct] geterror] } {
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
error "[sct geterror]"
}
if { [hpropexists [sct] driving] } {
if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } {
sct driving 1
}
}
debug_log ${tc_root} 1 "setValue sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to write a parameter value on a device
proc ::scobj::keysight_N8740A::write_direct {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "write_direct tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set par [sct target]
set cmd "${cmd_str}${par}"
# write_direct hook code starts
set cmd "@@NOSEND@@"
sct result ""
if { [sct target] != [sct oldval] } {
debug_log ${tc_root} 1 "[sct] changed to new:[sct target], from old:[sct oldval]"
sct oldval [sct target]
sct update [sct target]
sct utime readtime
}
# write_direct hook code ends
if { [hpropexists [sct] geterror] } {
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
error "[sct geterror]"
}
if { [hpropexists [sct] driving] } {
if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } {
sct driving 1
}
}
debug_log ${tc_root} 1 "write_direct sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to write a parameter value on a device
proc ::scobj::keysight_N8740A::write_setpoint {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "write_setpoint tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set par [sct target]
set cmd "${cmd_str}${par}"
# write_setpoint hook code starts
set cmd "@@NOSEND@@"
sct result ""
sct ramp_start_time [sct utime]
sct ramp_start_value [hval ${tc_root}/working_setpoint]
sct ramp_rate_value [hval ${tc_root}/ramp_rate]
if { [sct target] != [sct oldval] } {
debug_log ${tc_root} 1 "[sct] changed to new:[sct target], from old:[sct oldval]"
sct oldval [sct target]
sct update [sct target]
sct utime readtime
}
# write_setpoint hook code ends
if { [hpropexists [sct] geterror] } {
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
error "[sct geterror]"
}
if { [hpropexists [sct] driving] } {
if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } {
sct driving 1
}
}
debug_log ${tc_root} 1 "write_setpoint sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
proc ::scobj::keysight_N8740A::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } {
::scobj::keysight_N8740A::sics_log 9 "::scobj::keysight_N8740A::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
set ns "[namespace current]"
set catch_status [ catch {
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver keysight_N8740A
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/amps plain user float
hsetprop ${scobj_hpath}/amps read ${ns}::getValue ${scobj_hpath} rdValue {MEASURE:SCALAR:CURRENT:DC?}
hsetprop ${scobj_hpath}/amps rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/amps control true
hsetprop ${scobj_hpath}/amps data true
hsetprop ${scobj_hpath}/amps mutable true
hsetprop ${scobj_hpath}/amps nxsave true
hsetprop ${scobj_hpath}/amps units A
hsetprop ${scobj_hpath}/amps oldval 0.0
hsetprop ${scobj_hpath}/amps klass "parameter"
hsetprop ${scobj_hpath}/amps sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/amps type "part"
hsetprop ${scobj_hpath}/amps nxalias "${name}_amps"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/amps 1
hsetprop ${scobj_hpath}/amps simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/amps simulated true
}
hfactory ${scobj_hpath}/output_enable plain user int
hsetprop ${scobj_hpath}/output_enable read ${ns}::getValue ${scobj_hpath} rdValue {OUTPUT:STATE?}
hsetprop ${scobj_hpath}/output_enable rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/output_enable write ${ns}::setValue ${scobj_hpath} noResponse {OUTPUT:STATE }
hsetprop ${scobj_hpath}/output_enable noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/output_enable check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/output_enable control true
hsetprop ${scobj_hpath}/output_enable data true
hsetprop ${scobj_hpath}/output_enable mutable true
hsetprop ${scobj_hpath}/output_enable nxsave true
hsetprop ${scobj_hpath}/output_enable values 0,1
hsetprop ${scobj_hpath}/output_enable oldval 0
hsetprop ${scobj_hpath}/output_enable klass "parameter"
hsetprop ${scobj_hpath}/output_enable sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/output_enable type "part"
hsetprop ${scobj_hpath}/output_enable nxalias "${name}_output_enable"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/output_enable 2
${sct_controller} write ${scobj_hpath}/output_enable
hsetprop ${scobj_hpath}/output_enable simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/output_enable simulated true
}
hfactory ${scobj_hpath}/ramp_rate plain user float
hsetprop ${scobj_hpath}/ramp_rate write ${ns}::write_direct ${scobj_hpath} noResponse {}
hsetprop ${scobj_hpath}/ramp_rate noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/ramp_rate check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ramp_rate control true
hsetprop ${scobj_hpath}/ramp_rate data true
hsetprop ${scobj_hpath}/ramp_rate mutable true
hsetprop ${scobj_hpath}/ramp_rate nxsave true
hsetprop ${scobj_hpath}/ramp_rate lowerlimit 0
hsetprop ${scobj_hpath}/ramp_rate upperlimit 15
hsetprop ${scobj_hpath}/ramp_rate units V/S
hsetprop ${scobj_hpath}/ramp_rate oldval 1.0
hset ${scobj_hpath}/ramp_rate 1.0
hsetprop ${scobj_hpath}/ramp_rate klass "parameter"
hsetprop ${scobj_hpath}/ramp_rate sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ramp_rate type "part"
hsetprop ${scobj_hpath}/ramp_rate nxalias "${name}_ramp_rate"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} write ${scobj_hpath}/ramp_rate
hsetprop ${scobj_hpath}/ramp_rate simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/ramp_rate simulated true
}
hfactory ${scobj_hpath}/setpoint plain user float
hsetprop ${scobj_hpath}/setpoint read ${ns}::read_setpoint ${scobj_hpath} rdValue {SOURCE:VOLTAGE?}
hsetprop ${scobj_hpath}/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint write ${ns}::write_setpoint ${scobj_hpath} noResponse {SOURCE:VOLTAGE }
hsetprop ${scobj_hpath}/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint driving 0
hsetprop ${scobj_hpath}/setpoint checklimits ${ns}::checklimits ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint halt ${ns}::halt ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint driveable working_setpoint
hsetprop ${scobj_hpath}/setpoint control true
hsetprop ${scobj_hpath}/setpoint data true
hsetprop ${scobj_hpath}/setpoint mutable true
hsetprop ${scobj_hpath}/setpoint nxsave true
hsetprop ${scobj_hpath}/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/setpoint upperlimit 150
hsetprop ${scobj_hpath}/setpoint tolerance 1
hsetprop ${scobj_hpath}/setpoint units V
hsetprop ${scobj_hpath}/setpoint oldval 0.0
hsetprop ${scobj_hpath}/setpoint klass "parameter"
hsetprop ${scobj_hpath}/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/setpoint settle_time "5"
hsetprop ${scobj_hpath}/setpoint type "drivable"
hsetprop ${scobj_hpath}/setpoint nxalias "${name}_setpoint"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/setpoint 1
${sct_controller} write ${scobj_hpath}/setpoint
hsetprop ${scobj_hpath}/setpoint simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/setpoint simulated true
}
hfactory ${scobj_hpath}/volts plain user float
hsetprop ${scobj_hpath}/volts read ${ns}::getValue ${scobj_hpath} rdValue {MEASURE:SCALAR:VOLTAGE:DC?}
hsetprop ${scobj_hpath}/volts rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/volts control true
hsetprop ${scobj_hpath}/volts data true
hsetprop ${scobj_hpath}/volts mutable true
hsetprop ${scobj_hpath}/volts nxsave true
hsetprop ${scobj_hpath}/volts units V
hsetprop ${scobj_hpath}/volts oldval 0.0
hsetprop ${scobj_hpath}/volts klass "parameter"
hsetprop ${scobj_hpath}/volts sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/volts type "part"
hsetprop ${scobj_hpath}/volts nxalias "${name}_volts"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/volts 1
hsetprop ${scobj_hpath}/volts simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/volts simulated true
}
hfactory ${scobj_hpath}/working_setpoint plain user float
hsetprop ${scobj_hpath}/working_setpoint read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:VOLTAGE?}
hsetprop ${scobj_hpath}/working_setpoint rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/working_setpoint write ${ns}::write_direct ${scobj_hpath} noResponse {}
hsetprop ${scobj_hpath}/working_setpoint noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/working_setpoint check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/working_setpoint control true
hsetprop ${scobj_hpath}/working_setpoint data true
hsetprop ${scobj_hpath}/working_setpoint mutable true
hsetprop ${scobj_hpath}/working_setpoint nxsave true
hsetprop ${scobj_hpath}/working_setpoint units V
hsetprop ${scobj_hpath}/working_setpoint oldval 0.0
hsetprop ${scobj_hpath}/working_setpoint klass "parameter"
hsetprop ${scobj_hpath}/working_setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/working_setpoint type "part"
hsetprop ${scobj_hpath}/working_setpoint nxalias "${name}_working_setpoint"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/working_setpoint 1
${sct_controller} write ${scobj_hpath}/working_setpoint
hsetprop ${scobj_hpath}/working_setpoint simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/working_setpoint simulated true
}
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/working_setpoint ${sct_controller}
hfactory ${scobj_hpath}/current plain spy none
hfactory ${scobj_hpath}/current/prot_enable plain user int
hsetprop ${scobj_hpath}/current/prot_enable read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:CURRENT:PROTECTION:STATE?}
hsetprop ${scobj_hpath}/current/prot_enable rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_enable write ${ns}::setValue ${scobj_hpath} noResponse {SOURCE:CURRENT:PROTECTION:STATE }
hsetprop ${scobj_hpath}/current/prot_enable noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_enable check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_enable control true
hsetprop ${scobj_hpath}/current/prot_enable data true
hsetprop ${scobj_hpath}/current/prot_enable mutable true
hsetprop ${scobj_hpath}/current/prot_enable nxsave true
hsetprop ${scobj_hpath}/current/prot_enable values 0,1
hsetprop ${scobj_hpath}/current/prot_enable oldval 0
hsetprop ${scobj_hpath}/current/prot_enable klass "parameter"
hsetprop ${scobj_hpath}/current/prot_enable sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/current/prot_enable type "part"
hsetprop ${scobj_hpath}/current/prot_enable nxalias "${name}_current_prot_enable"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/current/prot_enable 1
${sct_controller} write ${scobj_hpath}/current/prot_enable
hsetprop ${scobj_hpath}/current/prot_enable simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/current/prot_enable simulated true
}
hfactory ${scobj_hpath}/current/prot_limit plain user float
hsetprop ${scobj_hpath}/current/prot_limit read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:CURRENT?}
hsetprop ${scobj_hpath}/current/prot_limit rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_limit write ${ns}::setValue ${scobj_hpath} noResponse {SOURCE:CURRENT }
hsetprop ${scobj_hpath}/current/prot_limit noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_limit check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_limit control true
hsetprop ${scobj_hpath}/current/prot_limit data true
hsetprop ${scobj_hpath}/current/prot_limit mutable true
hsetprop ${scobj_hpath}/current/prot_limit nxsave true
hsetprop ${scobj_hpath}/current/prot_limit lowerlimit 0
hsetprop ${scobj_hpath}/current/prot_limit upperlimit 22
hsetprop ${scobj_hpath}/current/prot_limit units A
hsetprop ${scobj_hpath}/current/prot_limit oldval 0.0
hsetprop ${scobj_hpath}/current/prot_limit klass "parameter"
hsetprop ${scobj_hpath}/current/prot_limit sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/current/prot_limit type "part"
hsetprop ${scobj_hpath}/current/prot_limit nxalias "${name}_current_prot_limit"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/current/prot_limit 1
${sct_controller} write ${scobj_hpath}/current/prot_limit
hsetprop ${scobj_hpath}/current/prot_limit simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/current/prot_limit simulated true
}
hsetprop ${scobj_hpath}/current data "true"
hsetprop ${scobj_hpath}/current klass "@none"
hsetprop ${scobj_hpath}/current type "part"
hfactory ${scobj_hpath}/system plain spy none
hfactory ${scobj_hpath}/system/error plain user text
hsetprop ${scobj_hpath}/system/error read ${ns}::getValue ${scobj_hpath} rdValue {SYSTEM:ERROR?}
hsetprop ${scobj_hpath}/system/error rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/system/error control false
hsetprop ${scobj_hpath}/system/error data false
hsetprop ${scobj_hpath}/system/error mutable false
hsetprop ${scobj_hpath}/system/error nxsave false
hsetprop ${scobj_hpath}/system/error oldval UNKNOWN
hsetprop ${scobj_hpath}/system/error sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/system/error type "part"
hsetprop ${scobj_hpath}/system/error nxalias "${name}_system_error"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/system/error 1
hsetprop ${scobj_hpath}/system/error simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/system/error simulated true
}
hfactory ${scobj_hpath}/system/ident plain user text
hsetprop ${scobj_hpath}/system/ident read ${ns}::getValue ${scobj_hpath} rdValue {*IDN?}
hsetprop ${scobj_hpath}/system/ident rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/system/ident control false
hsetprop ${scobj_hpath}/system/ident data false
hsetprop ${scobj_hpath}/system/ident mutable false
hsetprop ${scobj_hpath}/system/ident nxsave false
hsetprop ${scobj_hpath}/system/ident oldval UNKNOWN
hsetprop ${scobj_hpath}/system/ident sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/system/ident type "part"
hsetprop ${scobj_hpath}/system/ident nxalias "${name}_system_ident"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/system/ident 15
hsetprop ${scobj_hpath}/system/ident simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/system/ident simulated true
}
hfactory ${scobj_hpath}/system/version plain user text
hsetprop ${scobj_hpath}/system/version read ${ns}::getValue ${scobj_hpath} rdValue {SYSTEM:VERSION?}
hsetprop ${scobj_hpath}/system/version rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/system/version control false
hsetprop ${scobj_hpath}/system/version data false
hsetprop ${scobj_hpath}/system/version mutable false
hsetprop ${scobj_hpath}/system/version nxsave false
hsetprop ${scobj_hpath}/system/version oldval UNKNOWN
hsetprop ${scobj_hpath}/system/version sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/system/version type "part"
hsetprop ${scobj_hpath}/system/version nxalias "${name}_system_version"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/system/version 15
hsetprop ${scobj_hpath}/system/version simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/system/version simulated true
}
hsetprop ${scobj_hpath}/system data "false"
hsetprop ${scobj_hpath}/system klass "@none"
hsetprop ${scobj_hpath}/system type "part"
hfactory ${scobj_hpath}/voltage plain spy none
hfactory ${scobj_hpath}/voltage/hilimit plain user float
hsetprop ${scobj_hpath}/voltage/hilimit read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:VOLTAGE:PROTECTION?}
hsetprop ${scobj_hpath}/voltage/hilimit rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/hilimit write ${ns}::setValue ${scobj_hpath} noResponse {SOURCE:VOLTAGE:PROTECTION }
hsetprop ${scobj_hpath}/voltage/hilimit noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/hilimit check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/hilimit control true
hsetprop ${scobj_hpath}/voltage/hilimit data true
hsetprop ${scobj_hpath}/voltage/hilimit mutable true
hsetprop ${scobj_hpath}/voltage/hilimit nxsave true
hsetprop ${scobj_hpath}/voltage/hilimit lowerlimit 0
hsetprop ${scobj_hpath}/voltage/hilimit upperlimit 165
hsetprop ${scobj_hpath}/voltage/hilimit units V
hsetprop ${scobj_hpath}/voltage/hilimit oldval 0.0
hsetprop ${scobj_hpath}/voltage/hilimit klass "parameter"
hsetprop ${scobj_hpath}/voltage/hilimit sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/voltage/hilimit type "part"
hsetprop ${scobj_hpath}/voltage/hilimit nxalias "${name}_voltage_hilimit"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/voltage/hilimit 1
${sct_controller} write ${scobj_hpath}/voltage/hilimit
hsetprop ${scobj_hpath}/voltage/hilimit simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/voltage/hilimit simulated true
}
hfactory ${scobj_hpath}/voltage/lolimit plain user float
hsetprop ${scobj_hpath}/voltage/lolimit read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:VOLTAGE:LIMIT:LOW?}
hsetprop ${scobj_hpath}/voltage/lolimit rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/lolimit write ${ns}::setValue ${scobj_hpath} noResponse {SOURCE:VOLTAGE:LIMIT:LOW }
hsetprop ${scobj_hpath}/voltage/lolimit noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/lolimit check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/lolimit control true
hsetprop ${scobj_hpath}/voltage/lolimit data true
hsetprop ${scobj_hpath}/voltage/lolimit mutable true
hsetprop ${scobj_hpath}/voltage/lolimit nxsave true
hsetprop ${scobj_hpath}/voltage/lolimit units V
hsetprop ${scobj_hpath}/voltage/lolimit oldval 0.0
hsetprop ${scobj_hpath}/voltage/lolimit klass "parameter"
hsetprop ${scobj_hpath}/voltage/lolimit sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/voltage/lolimit type "part"
hsetprop ${scobj_hpath}/voltage/lolimit nxalias "${name}_voltage_lolimit"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/voltage/lolimit 1
${sct_controller} write ${scobj_hpath}/voltage/lolimit
hsetprop ${scobj_hpath}/voltage/lolimit simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/voltage/lolimit simulated true
}
hsetprop ${scobj_hpath}/voltage data "true"
hsetprop ${scobj_hpath}/voltage klass "@none"
hsetprop ${scobj_hpath}/voltage type "part"
hsetprop ${scobj_hpath} driver keysight_N8740A
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code goes here
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
proc ::scobj::keysight_N8740A::add_driver {name device_class simulation_flag ip_address tcp_port} {
set catch_status [ catch {
::scobj::keysight_N8740A::sics_log 9 "::scobj::keysight_N8740A::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
if {[string equal -nocase "${simulation_flag}" "false"]} {
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
::scobj::keysight_N8740A::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
makesctcontroller sct_${name} aqadapter ${tcp_port}
} else {
::scobj::keysight_N8740A::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
}
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for keysight_N8740A"
::scobj::keysight_N8740A::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::keysight_N8740A::sics_log 1 "::scobj::keysight_N8740A::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
::scobj::keysight_N8740A::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
namespace eval ::scobj::keysight_N8740A {
namespace export debug_threshold
namespace export debug_log
namespace export sics_log
namespace export mkDriver
namespace export add_driver
}
proc add_keysight_N8740A {name ip_address tcp_port} {
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
::scobj::keysight_N8740A::add_driver ${name} "instrument" ${simulation_flag} ${ip_address} ${tcp_port}
}
clientput "file evaluation of keysight_N8740A_sct.tcl"
::scobj::keysight_N8740A::sics_log 9 "file evaluation of keysight_N8740A_sct.tcl"
proc ::scobj::keysight_N8740A::read_config {} {
set catch_status [ catch {
set ns "::scobj::keysight_N8740A"
dict for {k u} $::config_dict {
if { [dict exists $u "implementation"] } {
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
set device_class "instrument"
if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } {
continue
}
set enabled [string tolower [dict get $u "enabled"]]
if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } {
continue
}
if { [dict exists $u "simulation_group"] } {
set simulation_flag [SplitReply [[string tolower [dict get $u "simulation_group"]]]]
}
if { [dict exists $u "device_class"] } {
set device_class "[dict get $u "device_class"]"
}
set name [dict get $u name]
set implementation [dict get $u "implementation"]
if { !([dict exists $::config_dict $implementation]) } {
continue
}
set v [dict get $::config_dict $implementation]
if { !([dict exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "keysight_N8740A"] } {
if { ![string equal -nocase "${simulation_flag}" "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
} elseif { [dict exists $v "asyncqueue"] } {
set asyncqueue [dict get $v "asyncqueue"]
if { [string equal -nocase ${asyncqueue} "sct"] } {
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
} else {
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
} else {
if { [dict exists $v "asyncprotocol"] } {
set asyncprotocol [dict get $v "asyncprotocol"]
} else {
set asyncprotocol ${name}_protocol
MakeAsyncProtocol ${asyncprotocol}
if { [dict exists $v "sendterminator"] } {
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
}
if { [dict exists $v "replyterminator"] } {
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
}
}
set asyncqueue ${name}_queue
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port}
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::keysight_N8740A::read_config
} else {
::scobj::keysight_N8740A::sics_log 5 "No config dict"
}

View File

@ -883,6 +883,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver knauer_pump
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -1174,6 +1175,7 @@ proc ::scobj::knauer_pump::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/pump/volume klass "@none"
hsetprop ${scobj_hpath}/pump/volume type "part"
ansto_makesctdrive ${name}_pump_volume_setp ${scobj_hpath}/pump/volume/setp ${scobj_hpath}/pump/volume/pval ${sct_controller}
hsetprop ${scobj_hpath} driver knauer_pump
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -1,11 +1,12 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent nocindent
driver bruker = {
wrapper_property nosctcontroller = True
protocol = astvelsel
class = environment
simulation_group = environment_simulation
add_args = 'id datype {tol 0.1}'
make_args = 'id datype tol'
code mkWrapper = {%%
add_bruker_BEC1 $name $ip_address $tcp_port $tol
add_bruker_bec1 $name $ip_address $tcp_port $tol $id $datype
%%}
}

View File

@ -36,7 +36,7 @@ proc ::scobj::bruker::mkDriver { sct_controller name device_class simulation_fla
set catch_status [ catch {
# mkWrapper hook code starts
add_bruker_BEC1 $name $ip_address $tcp_port $tol
add_bruker_bec1 $name $ip_address $tcp_port $tol $id $datype
# mkWrapper hook code ends
} catch_message ]
handle_exception ${catch_status} ${catch_message}
@ -45,19 +45,7 @@ proc ::scobj::bruker::mkDriver { sct_controller name device_class simulation_fla
proc ::scobj::bruker::add_driver {name device_class simulation_flag ip_address tcp_port id datype {tol 0.1}} {
set catch_status [ catch {
::scobj::bruker::sics_log 9 "::scobj::bruker::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}"
if {[string equal -nocase "${simulation_flag}" "false"]} {
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
::scobj::bruker::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
makesctcontroller sct_${name} aqadapter ${tcp_port}
} else {
::scobj::bruker::sics_log 9 "makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port}"
makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port}
}
} else {
::scobj::bruker::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for bruker"
::scobj::bruker::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::bruker::sics_log 9 "No sctcontroller for bruker"
::scobj::bruker::sics_log 1 "::scobj::bruker::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}"
::scobj::bruker::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}
} catch_message ]
@ -110,46 +98,9 @@ proc ::scobj::bruker::read_config {} {
continue
}
if { [string equal -nocase [dict get $v "driver"] "bruker"] } {
if { ![string equal -nocase "${simulation_flag}" "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
} elseif { [dict exists $v "asyncqueue"] } {
set asyncqueue [dict get $v "asyncqueue"]
if { [string equal -nocase ${asyncqueue} "sct"] } {
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port}
} else {
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
} else {
if { [dict exists $v "asyncprotocol"] } {
set asyncprotocol [dict get $v "asyncprotocol"]
} else {
set asyncprotocol ${name}_protocol
MakeAsyncProtocol ${asyncprotocol}
if { [dict exists $v "sendterminator"] } {
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
}
if { [dict exists $v "replyterminator"] } {
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
}
}
set asyncqueue ${name}_queue
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port}
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
::scobj::bruker::sics_log 9 "No sctcontroller for bruker"
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
set arg_list [list]
set missing_list [list]
foreach arg {id datype tol} {

View File

@ -106,6 +106,8 @@ proc ::scobj::green_magnet_labview::read_config {} {
}
if { [string equal -nocase [dict get $v "driver"] "green_magnet_labview"] } {
::scobj::green_magnet_labview::sics_log 9 "No sctcontroller for green_magnet_labview"
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
}
}

View File

@ -37,10 +37,12 @@ proc ::scobj::oxford12tlv::mkDriver { sct_controller name device_class simulatio
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver oxford12tlv
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver oxford12tlv
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -36,7 +36,7 @@ proc ::scobj::bruker::mkDriver { sct_controller name device_class simulation_fla
set catch_status [ catch {
# mkWrapper hook code starts
add_bruker_BEC1 $name $ip_address $tcp_port $tol
add_bruker_bec1 $name $ip_address $tcp_port $tol $id $datype
# mkWrapper hook code ends
} catch_message ]
handle_exception ${catch_status} ${catch_message}
@ -45,19 +45,7 @@ proc ::scobj::bruker::mkDriver { sct_controller name device_class simulation_fla
proc ::scobj::bruker::add_driver {name device_class simulation_flag ip_address tcp_port id datype {tol 0.1}} {
set catch_status [ catch {
::scobj::bruker::sics_log 9 "::scobj::bruker::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}"
if {[string equal -nocase "${simulation_flag}" "false"]} {
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
::scobj::bruker::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
makesctcontroller sct_${name} aqadapter ${tcp_port}
} else {
::scobj::bruker::sics_log 9 "makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port}"
makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port}
}
} else {
::scobj::bruker::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for bruker"
::scobj::bruker::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::bruker::sics_log 9 "No sctcontroller for bruker"
::scobj::bruker::sics_log 1 "::scobj::bruker::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}"
::scobj::bruker::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}
} catch_message ]
@ -110,46 +98,9 @@ proc ::scobj::bruker::read_config {} {
continue
}
if { [string equal -nocase [dict get $v "driver"] "bruker"] } {
if { ![string equal -nocase "${simulation_flag}" "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
} elseif { [dict exists $v "asyncqueue"] } {
set asyncqueue [dict get $v "asyncqueue"]
if { [string equal -nocase ${asyncqueue} "sct"] } {
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port}
} else {
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
} else {
if { [dict exists $v "asyncprotocol"] } {
set asyncprotocol [dict get $v "asyncprotocol"]
} else {
set asyncprotocol ${name}_protocol
MakeAsyncProtocol ${asyncprotocol}
if { [dict exists $v "sendterminator"] } {
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
}
if { [dict exists $v "replyterminator"] } {
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
}
}
set asyncqueue ${name}_queue
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port}
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
::scobj::bruker::sics_log 9 "No sctcontroller for bruker"
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
set arg_list [list]
set missing_list [list]
foreach arg {id datype tol} {

View File

@ -375,7 +375,7 @@ proc inTolerance {expectedLength} {
set nodename $tc_root/sensor/nominal_outp_current
set setpt [hval $nodename]
set nodename $tc_root/sensor/desired_current
set nominal_outp_current [hval $nodename]
set NominalOutpCurrent [hval $nodename]
# clientput "inTolerance(): comparing sensor/setpoint=$setpt with actual sensorValue=$temp"
set diff [expr {abs($setpt - $NominalOutpCurrent)}]
if {$diff > $::scobj::bruker_BEC1::bruker_BEC1_driveTolerance} {
@ -851,7 +851,7 @@ proc checktol {tc_root} {
set catch_status [ catch {
set retVal 0
set sensorValue $tc_root/sensor/desired_current
set nominal_outp_current [hval $sensorValue]
set NominalOutpCurrent [hval $sensorValue]
set isetp $tc_root/sensor/nominal_outp_current
set setpt [hval $isetp]
set tol [hval $tc_root/emon/tolerance]

View File

@ -278,6 +278,7 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver tsi_smc
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -564,6 +565,7 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
hsetprop ${scobj_hpath}/b data "true"
hsetprop ${scobj_hpath}/b klass "@none"
hsetprop ${scobj_hpath}/b type "part"
hsetprop ${scobj_hpath} driver tsi_smc
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -99,6 +99,8 @@ proc ::scobj::mvp_valve::read_config {} {
}
if { [string equal -nocase [dict get $v "driver"] "mvp_valve"] } {
::scobj::mvp_valve::sics_log 9 "No sctcontroller for mvp_valve"
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
set arg_list [list]
set missing_list [list]
foreach arg {id datype} {

View File

@ -284,6 +284,7 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver nhq_200
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -860,6 +861,7 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name device_class simulation_fl
hsetprop ${scobj_hpath}/ch2 klass "@none"
hsetprop ${scobj_hpath}/ch2 type "part"
ansto_makesctdrive ${name}_ch2_v_sp ${scobj_hpath}/ch2/v_sp ${scobj_hpath}/ch2/voltage ${sct_controller}
hsetprop ${scobj_hpath} driver nhq_200
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -2,7 +2,7 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent
#
driver omron_hldc = {
vendor = Omron; device = 'ZS-HDLC'; protocol = std;
vendor = Omron; device = 'ZS-HDLC'; protocol = omron_ap;
class = environment;
simulation_group = environment_simulation;

View File

@ -200,6 +200,7 @@ proc ::scobj::omron_hldc::mkDriver { sct_controller name device_class simulation
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver omron_hldc
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -250,6 +251,7 @@ proc ::scobj::omron_hldc::mkDriver { sct_controller name device_class simulation
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
hsetprop ${scobj_hpath} driver omron_hldc
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
@ -266,8 +268,8 @@ proc ::scobj::omron_hldc::add_driver {name device_class simulation_flag ip_addre
::scobj::omron_hldc::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
makesctcontroller sct_${name} aqadapter ${tcp_port}
} else {
::scobj::omron_hldc::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
::scobj::omron_hldc::sics_log 9 "makesctcontroller sct_${name} omron_ap ${ip_address}:${tcp_port}"
makesctcontroller sct_${name} omron_ap ${ip_address}:${tcp_port}
}
} else {
::scobj::omron_hldc::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for omron_hldc"
@ -336,7 +338,7 @@ proc ::scobj::omron_hldc::read_config {} {
if { [string equal -nocase ${asyncqueue} "sct"] } {
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
makesctcontroller sct_${name} omron_ap ${ip_address}:${tcp_port}
} else {
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}

View File

@ -37,10 +37,12 @@ proc ::scobj::protekmm::mkDriver { sct_controller name device_class simulation_f
MakeSICSObj ${name} SCT_OBJECT user float
sicslist setatt ${name} driver protekmm
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver protekmm
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -0,0 +1,843 @@
# Generated driver for keysight_N8740A
# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent
#
namespace eval ::scobj::keysight_N8740A {
set debug_threshold 5
}
proc ::scobj::keysight_N8740A::debug_log {tc_root debug_level debug_string} {
set catch_status [ catch {
set debug_threshold [hgetpropval ${tc_root} debug_threshold]
if {${debug_level} >= ${debug_threshold}} {
set now [clock seconds]
set ts [clock format ${now} -format "%Y%m%d"]
set log_file_name "../log/keysight_N8740A_[basename ${tc_root}]_${ts}.log"
set fd [open "${log_file_name}" "a"]
set ts [clock format ${now} -format "%T"]
puts ${fd} "${ts} ${debug_string}"
close ${fd}
}
} catch_message ]
}
proc ::scobj::keysight_N8740A::sics_log {debug_level debug_string} {
set catch_status [ catch {
set debug_threshold ${::scobj::keysight_N8740A::debug_threshold}
if {${debug_level} >= ${debug_threshold}} {
sicslog "::scobj::keysight_N8740A::${debug_string}"
}
} catch_message ]
}
# checklimits function for driveable interface
proc ::scobj::keysight_N8740A::checklimits {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "checklimits tc_root=${tc_root} sct=[sct] target=[sct target]"
set setpoint [sct target]
if { [hpropexists [sct] lowerlimit] } {
set lolimit [sct lowerlimit]
} else {
# lowerlimit not set, use target
set lolimit [sct target]
}
if { [hpropexists [sct] upperlimit] } {
set hilimit [sct upperlimit]
} else {
# upperlimit not set, use target
set hilimit [sct target]
}
# checklimits hook code goes here
if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {
sct driving 0
error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"
}
return OK
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# check function for hset change
proc ::scobj::keysight_N8740A::checkrange {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "checkrange tc_root=${tc_root} sct=[sct] target=[sct target]"
set setpoint [sct target]
if { [hpropexists [sct] lowerlimit] } {
set lolimit [sct lowerlimit]
} else {
# lowerlimit not set, use target
set lolimit [sct target]
}
if { [hpropexists [sct] upperlimit] } {
set hilimit [sct upperlimit]
} else {
# upperlimit not set, use target
set hilimit [sct target]
}
# checkrange hook code goes here
if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {
error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"
}
return OK
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# checkstatus function for driveable interface
proc ::scobj::keysight_N8740A::checkstatus {tc_root} {
set catch_status [ catch {
# checkstatus hook code goes here
if {[sct driving]} {
set sp "[sct target]"
if {[hpropexists [sct] simulated] && [sct simulated] == "true"} {
set pv "${sp}"
hupdateif ${tc_root}/[sct driveable] ${sp}
} else {
set pv "[hval ${tc_root}/[sct driveable]]"
}
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
if { [hpropexists [sct] settle_time] } {
if { [hpropexists [sct] settle_time_start] } {
if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} {
sct driving 0
return "idle"
}
return "busy"
} else {
sct utime settle_time_start
return "busy"
}
}
sct driving 0
return "idle"
}
if { [hpropexists [sct] settle_time_start] } {
hdelprop [sct] settle_time_start
}
return "busy"
} else {
return "idle"
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to request the read of a parameter on a device
proc ::scobj::keysight_N8740A::getValue {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "getValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set cmd "${cmd_str}"
# getValue hook code goes here
debug_log ${tc_root} 1 "getValue sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# halt function for driveable interface
proc ::scobj::keysight_N8740A::halt {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "halt tc_root=${tc_root} sct=[sct] driving=[sct driving]"
### TODO hset [sct] [hval [sct]]
# halt hook code goes here
sct driving 0
return "idle"
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to check the write parameter on a device
proc ::scobj::keysight_N8740A::noResponse {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "noResponse tc_root=${tc_root} sct=[sct] resp=[sct result]"
# noResponse hook code goes here
return "idle"
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to parse the read of a parameter on a device
proc ::scobj::keysight_N8740A::rdValue {tc_root} {
set catch_status [ catch {
debug_log ${tc_root} 1 "rdValue tc_root=${tc_root} sct=[sct] result=[sct result]"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set data [sct result]
set nextState "idle"
if {[string equal -nocase -length 7 ${data} "ASCERR:"]} {
# the protocol driver has reported an error
sct geterror "${data}"
error "[sct geterror]"
}
# rdValue hook code goes here
if { ${data} != [sct oldval] } {
debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]"
sct oldval ${data}
sct update ${data}
sct utime readtime
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to request the read of a parameter on a device
proc ::scobj::keysight_N8740A::read_setpoint {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "read_setpoint tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set cmd "${cmd_str}"
# read_setpoint hook code starts
if { [hpropexists [sct] target] } {
set target [sct target]
if { [hval ${tc_root}/working_setpoint] != ${target} } {
set elapsed_time [expr {[sct utime] - [sct ramp_start_time]}]
debug_log ${tc_root} 1 "read_setpoint elapsed_time = ${elapsed_time}"
if {[hpropexists [sct] ramp_rate_value] && [sct ramp_rate_value] > 0.0} {
set ramped_value [expr {[sct ramp_rate_value] * ${elapsed_time}}]
debug_log ${tc_root} 1 "read_setpoint ramped_value = ${ramped_value}"
if { ${target} > [hval ${tc_root}/working_setpoint] } {
set working_setpoint [expr {[sct ramp_start_value] + ${ramped_value}}]
debug_log ${tc_root} 1 "read_setpoint working_setpoint+ = ${working_setpoint}"
if { ${working_setpoint} > ${target} } {
set working_setpoint ${target}
}
} else {
set working_setpoint [expr {[sct ramp_start_value] - ${ramped_value}}]
debug_log ${tc_root} 1 "read_setpoint working_setpoint- = ${working_setpoint}"
if { ${working_setpoint} < ${target} } {
set working_setpoint ${target}
}
}
} else {
set working_setpoint ${target}
debug_log ${tc_root} 1 "read_setpoint working_setpoint = ${working_setpoint}"
}
if {![hpropexists [sct] ramp_rate_value] || [sct ramp_rate_value] != [hval ${tc_root}/ramp_rate]} {
sct ramp_start_time [sct utime]
sct ramp_start_value [hval ${tc_root}/working_setpoint]
sct ramp_rate_value [hval ${tc_root}/ramp_rate]
}
set cmd "SOURCE:VOLTAGE ${working_setpoint}@@NOREPLY@@"
sct result [hval ${tc_root}/working_setpoint]
}
} else {
# cmd is fine
}
# read_setpoint hook code ends
if { [hpropexists [sct] geterror] } {
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
error "[sct geterror]"
}
debug_log ${tc_root} 1 "read_setpoint sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to write a parameter value on a device
proc ::scobj::keysight_N8740A::setValue {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "setValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set par [sct target]
set cmd "${cmd_str}${par}"
# setValue hook code starts
set cmd "${cmd_str}${par}@@NOREPLY@@"
# setValue hook code ends
if { [hpropexists [sct] geterror] } {
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
error "[sct geterror]"
}
if { [hpropexists [sct] driving] } {
if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } {
sct driving 1
}
}
debug_log ${tc_root} 1 "setValue sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to write a parameter value on a device
proc ::scobj::keysight_N8740A::write_direct {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "write_direct tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set par [sct target]
set cmd "${cmd_str}${par}"
# write_direct hook code starts
set cmd "@@NOSEND@@"
sct result ""
if { [sct target] != [sct oldval] } {
debug_log ${tc_root} 1 "[sct] changed to new:[sct target], from old:[sct oldval]"
sct oldval [sct target]
sct update [sct target]
sct utime readtime
}
# write_direct hook code ends
if { [hpropexists [sct] geterror] } {
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
error "[sct geterror]"
}
if { [hpropexists [sct] driving] } {
if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } {
sct driving 1
}
}
debug_log ${tc_root} 1 "write_direct sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
# function to write a parameter value on a device
proc ::scobj::keysight_N8740A::write_setpoint {tc_root nextState cmd_str} {
set catch_status [ catch {
debug_log ${tc_root} 1 "write_setpoint tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
set par [sct target]
set cmd "${cmd_str}${par}"
# write_setpoint hook code starts
set cmd "@@NOSEND@@"
sct result ""
sct ramp_start_time [sct utime]
sct ramp_start_value [hval ${tc_root}/working_setpoint]
sct ramp_rate_value [hval ${tc_root}/ramp_rate]
if { [sct target] != [sct oldval] } {
debug_log ${tc_root} 1 "[sct] changed to new:[sct target], from old:[sct oldval]"
sct oldval [sct target]
sct update [sct target]
sct utime readtime
}
# write_setpoint hook code ends
if { [hpropexists [sct] geterror] } {
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
error "[sct geterror]"
}
if { [hpropexists [sct] driving] } {
if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } {
sct driving 1
}
}
debug_log ${tc_root} 1 "write_setpoint sct send ${cmd}"
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
sct send "${cmd}"
}
return ${nextState}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
proc ::scobj::keysight_N8740A::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } {
::scobj::keysight_N8740A::sics_log 9 "::scobj::keysight_N8740A::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
set ns "[namespace current]"
set catch_status [ catch {
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver keysight_N8740A
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/amps plain user float
hsetprop ${scobj_hpath}/amps read ${ns}::getValue ${scobj_hpath} rdValue {MEASURE:SCALAR:CURRENT:DC?}
hsetprop ${scobj_hpath}/amps rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/amps control true
hsetprop ${scobj_hpath}/amps data true
hsetprop ${scobj_hpath}/amps mutable true
hsetprop ${scobj_hpath}/amps nxsave true
hsetprop ${scobj_hpath}/amps units A
hsetprop ${scobj_hpath}/amps oldval 0.0
hsetprop ${scobj_hpath}/amps klass "parameter"
hsetprop ${scobj_hpath}/amps sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/amps type "part"
hsetprop ${scobj_hpath}/amps nxalias "${name}_amps"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/amps 1
hsetprop ${scobj_hpath}/amps simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/amps simulated true
}
hfactory ${scobj_hpath}/output_enable plain user int
hsetprop ${scobj_hpath}/output_enable read ${ns}::getValue ${scobj_hpath} rdValue {OUTPUT:STATE?}
hsetprop ${scobj_hpath}/output_enable rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/output_enable write ${ns}::setValue ${scobj_hpath} noResponse {OUTPUT:STATE }
hsetprop ${scobj_hpath}/output_enable noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/output_enable check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/output_enable control true
hsetprop ${scobj_hpath}/output_enable data true
hsetprop ${scobj_hpath}/output_enable mutable true
hsetprop ${scobj_hpath}/output_enable nxsave true
hsetprop ${scobj_hpath}/output_enable values 0,1
hsetprop ${scobj_hpath}/output_enable oldval 0
hsetprop ${scobj_hpath}/output_enable klass "parameter"
hsetprop ${scobj_hpath}/output_enable sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/output_enable type "part"
hsetprop ${scobj_hpath}/output_enable nxalias "${name}_output_enable"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/output_enable 2
${sct_controller} write ${scobj_hpath}/output_enable
hsetprop ${scobj_hpath}/output_enable simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/output_enable simulated true
}
hfactory ${scobj_hpath}/ramp_rate plain user float
hsetprop ${scobj_hpath}/ramp_rate write ${ns}::write_direct ${scobj_hpath} noResponse {}
hsetprop ${scobj_hpath}/ramp_rate noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/ramp_rate check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ramp_rate control true
hsetprop ${scobj_hpath}/ramp_rate data true
hsetprop ${scobj_hpath}/ramp_rate mutable true
hsetprop ${scobj_hpath}/ramp_rate nxsave true
hsetprop ${scobj_hpath}/ramp_rate lowerlimit 0
hsetprop ${scobj_hpath}/ramp_rate upperlimit 15
hsetprop ${scobj_hpath}/ramp_rate units V/S
hsetprop ${scobj_hpath}/ramp_rate oldval 1.0
hset ${scobj_hpath}/ramp_rate 1.0
hsetprop ${scobj_hpath}/ramp_rate klass "parameter"
hsetprop ${scobj_hpath}/ramp_rate sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ramp_rate type "part"
hsetprop ${scobj_hpath}/ramp_rate nxalias "${name}_ramp_rate"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} write ${scobj_hpath}/ramp_rate
hsetprop ${scobj_hpath}/ramp_rate simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/ramp_rate simulated true
}
hfactory ${scobj_hpath}/setpoint plain user float
hsetprop ${scobj_hpath}/setpoint read ${ns}::read_setpoint ${scobj_hpath} rdValue {SOURCE:VOLTAGE?}
hsetprop ${scobj_hpath}/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint write ${ns}::write_setpoint ${scobj_hpath} noResponse {SOURCE:VOLTAGE }
hsetprop ${scobj_hpath}/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint driving 0
hsetprop ${scobj_hpath}/setpoint checklimits ${ns}::checklimits ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint halt ${ns}::halt ${scobj_hpath}
hsetprop ${scobj_hpath}/setpoint driveable working_setpoint
hsetprop ${scobj_hpath}/setpoint control true
hsetprop ${scobj_hpath}/setpoint data true
hsetprop ${scobj_hpath}/setpoint mutable true
hsetprop ${scobj_hpath}/setpoint nxsave true
hsetprop ${scobj_hpath}/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/setpoint upperlimit 150
hsetprop ${scobj_hpath}/setpoint tolerance 1
hsetprop ${scobj_hpath}/setpoint units V
hsetprop ${scobj_hpath}/setpoint oldval 0.0
hsetprop ${scobj_hpath}/setpoint klass "parameter"
hsetprop ${scobj_hpath}/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/setpoint settle_time "5"
hsetprop ${scobj_hpath}/setpoint type "drivable"
hsetprop ${scobj_hpath}/setpoint nxalias "${name}_setpoint"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/setpoint 1
${sct_controller} write ${scobj_hpath}/setpoint
hsetprop ${scobj_hpath}/setpoint simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/setpoint simulated true
}
hfactory ${scobj_hpath}/volts plain user float
hsetprop ${scobj_hpath}/volts read ${ns}::getValue ${scobj_hpath} rdValue {MEASURE:SCALAR:VOLTAGE:DC?}
hsetprop ${scobj_hpath}/volts rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/volts control true
hsetprop ${scobj_hpath}/volts data true
hsetprop ${scobj_hpath}/volts mutable true
hsetprop ${scobj_hpath}/volts nxsave true
hsetprop ${scobj_hpath}/volts units V
hsetprop ${scobj_hpath}/volts oldval 0.0
hsetprop ${scobj_hpath}/volts klass "parameter"
hsetprop ${scobj_hpath}/volts sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/volts type "part"
hsetprop ${scobj_hpath}/volts nxalias "${name}_volts"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/volts 1
hsetprop ${scobj_hpath}/volts simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/volts simulated true
}
hfactory ${scobj_hpath}/working_setpoint plain user float
hsetprop ${scobj_hpath}/working_setpoint read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:VOLTAGE?}
hsetprop ${scobj_hpath}/working_setpoint rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/working_setpoint write ${ns}::write_direct ${scobj_hpath} noResponse {}
hsetprop ${scobj_hpath}/working_setpoint noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/working_setpoint check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/working_setpoint control true
hsetprop ${scobj_hpath}/working_setpoint data true
hsetprop ${scobj_hpath}/working_setpoint mutable true
hsetprop ${scobj_hpath}/working_setpoint nxsave true
hsetprop ${scobj_hpath}/working_setpoint units V
hsetprop ${scobj_hpath}/working_setpoint oldval 0.0
hsetprop ${scobj_hpath}/working_setpoint klass "parameter"
hsetprop ${scobj_hpath}/working_setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/working_setpoint type "part"
hsetprop ${scobj_hpath}/working_setpoint nxalias "${name}_working_setpoint"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/working_setpoint 1
${sct_controller} write ${scobj_hpath}/working_setpoint
hsetprop ${scobj_hpath}/working_setpoint simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/working_setpoint simulated true
}
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/working_setpoint ${sct_controller}
hfactory ${scobj_hpath}/current plain spy none
hfactory ${scobj_hpath}/current/prot_enable plain user int
hsetprop ${scobj_hpath}/current/prot_enable read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:CURRENT:PROTECTION:STATE?}
hsetprop ${scobj_hpath}/current/prot_enable rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_enable write ${ns}::setValue ${scobj_hpath} noResponse {SOURCE:CURRENT:PROTECTION:STATE }
hsetprop ${scobj_hpath}/current/prot_enable noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_enable check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_enable control true
hsetprop ${scobj_hpath}/current/prot_enable data true
hsetprop ${scobj_hpath}/current/prot_enable mutable true
hsetprop ${scobj_hpath}/current/prot_enable nxsave true
hsetprop ${scobj_hpath}/current/prot_enable values 0,1
hsetprop ${scobj_hpath}/current/prot_enable oldval 0
hsetprop ${scobj_hpath}/current/prot_enable klass "parameter"
hsetprop ${scobj_hpath}/current/prot_enable sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/current/prot_enable type "part"
hsetprop ${scobj_hpath}/current/prot_enable nxalias "${name}_current_prot_enable"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/current/prot_enable 1
${sct_controller} write ${scobj_hpath}/current/prot_enable
hsetprop ${scobj_hpath}/current/prot_enable simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/current/prot_enable simulated true
}
hfactory ${scobj_hpath}/current/prot_limit plain user float
hsetprop ${scobj_hpath}/current/prot_limit read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:CURRENT?}
hsetprop ${scobj_hpath}/current/prot_limit rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_limit write ${ns}::setValue ${scobj_hpath} noResponse {SOURCE:CURRENT }
hsetprop ${scobj_hpath}/current/prot_limit noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_limit check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/current/prot_limit control true
hsetprop ${scobj_hpath}/current/prot_limit data true
hsetprop ${scobj_hpath}/current/prot_limit mutable true
hsetprop ${scobj_hpath}/current/prot_limit nxsave true
hsetprop ${scobj_hpath}/current/prot_limit lowerlimit 0
hsetprop ${scobj_hpath}/current/prot_limit upperlimit 22
hsetprop ${scobj_hpath}/current/prot_limit units A
hsetprop ${scobj_hpath}/current/prot_limit oldval 0.0
hsetprop ${scobj_hpath}/current/prot_limit klass "parameter"
hsetprop ${scobj_hpath}/current/prot_limit sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/current/prot_limit type "part"
hsetprop ${scobj_hpath}/current/prot_limit nxalias "${name}_current_prot_limit"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/current/prot_limit 1
${sct_controller} write ${scobj_hpath}/current/prot_limit
hsetprop ${scobj_hpath}/current/prot_limit simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/current/prot_limit simulated true
}
hsetprop ${scobj_hpath}/current data "true"
hsetprop ${scobj_hpath}/current klass "@none"
hsetprop ${scobj_hpath}/current type "part"
hfactory ${scobj_hpath}/system plain spy none
hfactory ${scobj_hpath}/system/error plain user text
hsetprop ${scobj_hpath}/system/error read ${ns}::getValue ${scobj_hpath} rdValue {SYSTEM:ERROR?}
hsetprop ${scobj_hpath}/system/error rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/system/error control false
hsetprop ${scobj_hpath}/system/error data false
hsetprop ${scobj_hpath}/system/error mutable false
hsetprop ${scobj_hpath}/system/error nxsave false
hsetprop ${scobj_hpath}/system/error oldval UNKNOWN
hsetprop ${scobj_hpath}/system/error sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/system/error type "part"
hsetprop ${scobj_hpath}/system/error nxalias "${name}_system_error"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/system/error 1
hsetprop ${scobj_hpath}/system/error simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/system/error simulated true
}
hfactory ${scobj_hpath}/system/ident plain user text
hsetprop ${scobj_hpath}/system/ident read ${ns}::getValue ${scobj_hpath} rdValue {*IDN?}
hsetprop ${scobj_hpath}/system/ident rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/system/ident control false
hsetprop ${scobj_hpath}/system/ident data false
hsetprop ${scobj_hpath}/system/ident mutable false
hsetprop ${scobj_hpath}/system/ident nxsave false
hsetprop ${scobj_hpath}/system/ident oldval UNKNOWN
hsetprop ${scobj_hpath}/system/ident sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/system/ident type "part"
hsetprop ${scobj_hpath}/system/ident nxalias "${name}_system_ident"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/system/ident 15
hsetprop ${scobj_hpath}/system/ident simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/system/ident simulated true
}
hfactory ${scobj_hpath}/system/version plain user text
hsetprop ${scobj_hpath}/system/version read ${ns}::getValue ${scobj_hpath} rdValue {SYSTEM:VERSION?}
hsetprop ${scobj_hpath}/system/version rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/system/version control false
hsetprop ${scobj_hpath}/system/version data false
hsetprop ${scobj_hpath}/system/version mutable false
hsetprop ${scobj_hpath}/system/version nxsave false
hsetprop ${scobj_hpath}/system/version oldval UNKNOWN
hsetprop ${scobj_hpath}/system/version sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/system/version type "part"
hsetprop ${scobj_hpath}/system/version nxalias "${name}_system_version"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/system/version 15
hsetprop ${scobj_hpath}/system/version simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/system/version simulated true
}
hsetprop ${scobj_hpath}/system data "false"
hsetprop ${scobj_hpath}/system klass "@none"
hsetprop ${scobj_hpath}/system type "part"
hfactory ${scobj_hpath}/voltage plain spy none
hfactory ${scobj_hpath}/voltage/hilimit plain user float
hsetprop ${scobj_hpath}/voltage/hilimit read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:VOLTAGE:PROTECTION?}
hsetprop ${scobj_hpath}/voltage/hilimit rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/hilimit write ${ns}::setValue ${scobj_hpath} noResponse {SOURCE:VOLTAGE:PROTECTION }
hsetprop ${scobj_hpath}/voltage/hilimit noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/hilimit check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/hilimit control true
hsetprop ${scobj_hpath}/voltage/hilimit data true
hsetprop ${scobj_hpath}/voltage/hilimit mutable true
hsetprop ${scobj_hpath}/voltage/hilimit nxsave true
hsetprop ${scobj_hpath}/voltage/hilimit lowerlimit 0
hsetprop ${scobj_hpath}/voltage/hilimit upperlimit 165
hsetprop ${scobj_hpath}/voltage/hilimit units V
hsetprop ${scobj_hpath}/voltage/hilimit oldval 0.0
hsetprop ${scobj_hpath}/voltage/hilimit klass "parameter"
hsetprop ${scobj_hpath}/voltage/hilimit sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/voltage/hilimit type "part"
hsetprop ${scobj_hpath}/voltage/hilimit nxalias "${name}_voltage_hilimit"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/voltage/hilimit 1
${sct_controller} write ${scobj_hpath}/voltage/hilimit
hsetprop ${scobj_hpath}/voltage/hilimit simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/voltage/hilimit simulated true
}
hfactory ${scobj_hpath}/voltage/lolimit plain user float
hsetprop ${scobj_hpath}/voltage/lolimit read ${ns}::getValue ${scobj_hpath} rdValue {SOURCE:VOLTAGE:LIMIT:LOW?}
hsetprop ${scobj_hpath}/voltage/lolimit rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/lolimit write ${ns}::setValue ${scobj_hpath} noResponse {SOURCE:VOLTAGE:LIMIT:LOW }
hsetprop ${scobj_hpath}/voltage/lolimit noResponse ${ns}::noResponse ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/lolimit check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/voltage/lolimit control true
hsetprop ${scobj_hpath}/voltage/lolimit data true
hsetprop ${scobj_hpath}/voltage/lolimit mutable true
hsetprop ${scobj_hpath}/voltage/lolimit nxsave true
hsetprop ${scobj_hpath}/voltage/lolimit units V
hsetprop ${scobj_hpath}/voltage/lolimit oldval 0.0
hsetprop ${scobj_hpath}/voltage/lolimit klass "parameter"
hsetprop ${scobj_hpath}/voltage/lolimit sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/voltage/lolimit type "part"
hsetprop ${scobj_hpath}/voltage/lolimit nxalias "${name}_voltage_lolimit"
if {[string equal -nocase "${simulation_flag}" "false"]} {
${sct_controller} poll ${scobj_hpath}/voltage/lolimit 1
${sct_controller} write ${scobj_hpath}/voltage/lolimit
hsetprop ${scobj_hpath}/voltage/lolimit simulated false
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for keysight_N8740A"
hsetprop ${scobj_hpath}/voltage/lolimit simulated true
}
hsetprop ${scobj_hpath}/voltage data "true"
hsetprop ${scobj_hpath}/voltage klass "@none"
hsetprop ${scobj_hpath}/voltage type "part"
hsetprop ${scobj_hpath} driver keysight_N8740A
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code goes here
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
proc ::scobj::keysight_N8740A::add_driver {name device_class simulation_flag ip_address tcp_port} {
set catch_status [ catch {
::scobj::keysight_N8740A::sics_log 9 "::scobj::keysight_N8740A::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
if {[string equal -nocase "${simulation_flag}" "false"]} {
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
::scobj::keysight_N8740A::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
makesctcontroller sct_${name} aqadapter ${tcp_port}
} else {
::scobj::keysight_N8740A::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
}
} else {
::scobj::keysight_N8740A::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for keysight_N8740A"
::scobj::keysight_N8740A::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
}
::scobj::keysight_N8740A::sics_log 1 "::scobj::keysight_N8740A::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
::scobj::keysight_N8740A::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
namespace eval ::scobj::keysight_N8740A {
namespace export debug_threshold
namespace export debug_log
namespace export sics_log
namespace export mkDriver
namespace export add_driver
}
proc add_keysight_N8740A {name ip_address tcp_port} {
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
::scobj::keysight_N8740A::add_driver ${name} "instrument" ${simulation_flag} ${ip_address} ${tcp_port}
}
clientput "file evaluation of sct_keysight_N8740A.tcl"
::scobj::keysight_N8740A::sics_log 9 "file evaluation of sct_keysight_N8740A.tcl"
proc ::scobj::keysight_N8740A::read_config {} {
set catch_status [ catch {
set ns "::scobj::keysight_N8740A"
dict for {k u} $::config_dict {
if { [dict exists $u "implementation"] } {
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
set device_class "instrument"
if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } {
continue
}
set enabled [string tolower [dict get $u "enabled"]]
if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } {
continue
}
if { [dict exists $u "simulation_group"] } {
set simulation_flag [SplitReply [[string tolower [dict get $u "simulation_group"]]]]
}
if { [dict exists $u "device_class"] } {
set device_class "[dict get $u "device_class"]"
}
set name [dict get $u name]
set implementation [dict get $u "implementation"]
if { !([dict exists $::config_dict $implementation]) } {
continue
}
set v [dict get $::config_dict $implementation]
if { !([dict exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "keysight_N8740A"] } {
if { ![string equal -nocase "${simulation_flag}" "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
makesctcontroller sct_${name} aqadapter NULL
} elseif { [dict exists $v "asyncqueue"] } {
set asyncqueue [dict get $v "asyncqueue"]
if { [string equal -nocase ${asyncqueue} "sct"] } {
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
} else {
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
} else {
if { [dict exists $v "asyncprotocol"] } {
set asyncprotocol [dict get $v "asyncprotocol"]
} else {
set asyncprotocol ${name}_protocol
MakeAsyncProtocol ${asyncprotocol}
if { [dict exists $v "sendterminator"] } {
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
}
if { [dict exists $v "replyterminator"] } {
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
} elseif { [dict exists $v "terminator"] } {
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
}
}
set asyncqueue ${name}_queue
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port}
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
makesctcontroller sct_${name} aqadapter ${asyncqueue}
}
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
}
}
}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
if { [info exists ::config_dict] } {
::scobj::keysight_N8740A::read_config
} else {
::scobj::keysight_N8740A::sics_log 5 "No config dict"
}

View File

@ -99,6 +99,8 @@ proc ::scobj::mvp_valve::read_config {} {
}
if { [string equal -nocase [dict get $v "driver"] "mvp_valve"] } {
::scobj::mvp_valve::sics_log 9 "No sctcontroller for mvp_valve"
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
set arg_list [list]
set missing_list [list]
foreach arg {id datype} {

View File

@ -239,6 +239,7 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver eurotherm_3200
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -564,6 +565,7 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
hsetprop ${scobj_hpath}/util data "false"
hsetprop ${scobj_hpath}/util klass "@none"
hsetprop ${scobj_hpath}/util type "part"
hsetprop ${scobj_hpath} driver eurotherm_3200
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -37,10 +37,12 @@ proc ::scobj::eurotherm_m2000::mkDriver { sct_controller name device_class simul
MakeSICSObj ${name} SCT_OBJECT user float
sicslist setatt ${name} driver eurotherm_m2000
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver eurotherm_m2000
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -379,6 +379,7 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver julabo_lh45_gen
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -674,6 +675,7 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
hsetprop ${scobj_hpath}/sensor data "true"
hsetprop ${scobj_hpath}/sensor klass "@none"
hsetprop ${scobj_hpath}/sensor type "part"
hsetprop ${scobj_hpath} driver julabo_lh45_gen
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -200,6 +200,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver lakeshore_218
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -419,6 +420,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
hsetprop ${scobj_hpath}/sensor data "true"
hsetprop ${scobj_hpath}/sensor klass "@none"
hsetprop ${scobj_hpath}/sensor type "part"
hsetprop ${scobj_hpath} driver lakeshore_218
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -37,10 +37,12 @@ proc ::scobj::lakeshore_m370::mkDriver { sct_controller name device_class simula
MakeSICSObj ${name} SCT_OBJECT user none
sicslist setatt ${name} driver lakeshore_m370
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver lakeshore_m370
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -37,10 +37,12 @@ proc ::scobj::ls336::mkDriver { sct_controller name device_class simulation_flag
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver ls336
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver ls336
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -37,10 +37,12 @@ proc ::scobj::ls340::mkDriver { sct_controller name device_class simulation_flag
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver ls340
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver ls340
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -281,6 +281,7 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver mercury_base
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -606,6 +607,7 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
hsetprop ${scobj_hpath}/Loop3 klass "@none"
hsetprop ${scobj_hpath}/Loop3 type "part"
ansto_makesctdrive ${name}_Loop3_setpoint ${scobj_hpath}/Loop3/setpoint ${scobj_hpath}/Loop3/sensor ${sct_controller}
hsetprop ${scobj_hpath} driver mercury_base
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -147,6 +147,7 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name device_class simulat
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver mercury_level
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -202,6 +203,7 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name device_class simulat
hsetprop ${scobj_hpath}/Level data "true"
hsetprop ${scobj_hpath}/Level klass "@none"
hsetprop ${scobj_hpath}/Level type "part"
hsetprop ${scobj_hpath} driver mercury_level
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -287,6 +287,7 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name device_class simulati
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver mercury_pres
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -379,6 +380,7 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name device_class simulati
hsetprop ${scobj_hpath}/Loop8 klass "@none"
hsetprop ${scobj_hpath}/Loop8 type "part"
ansto_makesctdrive ${name}_Loop8_setpoint ${scobj_hpath}/Loop8/setpoint ${scobj_hpath}/Loop8/sensor ${sct_controller}
hsetprop ${scobj_hpath} driver mercury_pres
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -315,6 +315,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver mercury_scpi
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -860,6 +861,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
hsetprop ${scobj_hpath}/Valve klass "@none"
hsetprop ${scobj_hpath}/Valve type "part"
ansto_makesctdrive ${name}_Valve_setpoint ${scobj_hpath}/Valve/setpoint ${scobj_hpath}/Valve/sensor ${sct_controller}
hsetprop ${scobj_hpath} driver mercury_scpi
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -281,6 +281,7 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name device_class simulati
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver mercury_temp
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -392,6 +393,7 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name device_class simulati
hsetprop ${scobj_hpath}/Loop4 klass "@none"
hsetprop ${scobj_hpath}/Loop4 type "part"
ansto_makesctdrive ${name}_Loop4_setpoint ${scobj_hpath}/Loop4/setpoint ${scobj_hpath}/Loop4/sensor ${sct_controller}
hsetprop ${scobj_hpath} driver mercury_temp
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -259,6 +259,7 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name device_class simulat
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver mercury_valve
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -325,6 +326,7 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name device_class simulat
hsetprop ${scobj_hpath}/Valve klass "@none"
hsetprop ${scobj_hpath}/Valve type "part"
ansto_makesctdrive ${name}_Valve_setpoint ${scobj_hpath}/Valve/setpoint ${scobj_hpath}/Valve/sensor ${sct_controller}
hsetprop ${scobj_hpath} driver mercury_valve
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -37,10 +37,12 @@ proc ::scobj::nprvasm2::mkDriver { sct_controller name device_class simulation_f
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver nprvasm2
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver nprvasm2
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -19,96 +19,151 @@ driver oxford_mercury = {
group_property 'cards' = '${cards}';
group_property 'assoc' = '${assoc}';
group Temp0 = {
group temp0 = {
# Always the motherboard, always there
priv = user; type = float; readable = 5;
var sensor = { readable = 1; read_command = 'READ:DEV:MB1.T1:TEMP:SIG:TEMP'; permlink = 'T.S00'; }
var nick = { type=text; readable = 15; read_command = 'READ:DEV:MB1.T1:TEMP:NICK'; read_function = rdText; }
var power = { read_command = 'READ:DEV:MB0.H1:HTR:SIG:POWR'; }
var auto = {
type = int; allowed = '0,1';
read_function = rdOnOff; read_command = 'READ:DEV:MB1.T1:TEMP:LOOP:ENAB';
writeable = 1; write_function = wrOnOff; write_command = 'SET:DEV:MB1.T1:TEMP:LOOP:ENAB:';
}
var setpoint = { read_command = 'READ:DEV:MB1.T1:TEMP:LOOP:TSET';
driveable = Temp0/sensor; lowerlimit = 0; upperlimit = 333; tolerance = '${ttol}'; property settle_time = 15;
driveable = temp0/sensor; lowerlimit = 0; upperlimit = 333; tolerance = '${ttol}'; property settle_time = 15;
writeable = 1; write_function = setPoint; write_command = 'SET:DEV:MB1.T1:TEMP:LOOP:TSET:';
permlink = 'T.SP00';
}
group heater = {
var power = { read_command = 'READ:DEV:MB0.H1:HTR:SIG:POWR'; }
var perc = { read_command = 'READ:DEV:MB0.H1:HTR:SIG:PERC'; }
var hset = {
read_command = 'READ:DEV:MB1.T1:TEMP:LOOP:HSET';
lowerlimit = 0; upperlimit = 100;
writeable = 1; write_command = 'SET:DEV:MB1.T1:TEMP:LOOP:HSET:';
}
}
}
%exec
exec_output = []
for i in range(8):
exec_output += [""]
exec_output += [" group Temp%d = {" % (i+1)]
exec_output += [" group temp%d = {" % (i+1)]
exec_output += [" conditional = '[string equal -nocase [string index ${cards} %d] T]';" % i]
exec_output += [" priv = user; type = float; readable = 5;"]
exec_output += [" var sensor = { readable = 1; read_command = 'READ:DEV:DB%d.T1:TEMP:SIG:TEMP'; permlink = 'T.S%02d'; }" % (i+1,i+1)]
exec_output += [" var nick = { type=text; readable = 15; read_command = 'READ:DEV:DB%d.T1:TEMP:NICK'; read_function = rdText; }" % (i+1)]
if i > 4:
exec_output += [" var power = {"]
exec_output += [" var auto = {"]
exec_output += [" conditional = '[string equal -nocase [string index ${cards} %d] H] && [string equal -nocase [string index ${assoc} %d] %d]';" % (i-5, i, i-4)]
exec_output += [" read_command = 'READ:DEV:DB%d.H1:HTR:SIG:POWR';" % (i - 4)]
exec_output += [" type = int; allowed = '0,1'; read_command = 'READ:DEV:DB%d.T1:TEMP:LOOP:ENAB';" % (i + 1)]
exec_output += [" read_function = rdOnOff; read_command = 'READ:DEV:DB%d.T1:TEMP:LOOP:ENAB';" % (i + 1)]
exec_output += [" writeable = 1; write_function = wrOnOff; write_command = 'SET:DEV:DB%d.T1:TEMP:LOOP:ENAB:';" % (i + 1)]
exec_output += [" }"]
exec_output += [" var setpoint = {"]
exec_output += [" conditional = '[string equal -nocase [string index ${cards} %d] H] && [string equal -nocase [string index ${assoc} %d] %d]';" % (i-5, i, i-4)]
exec_output += [" read_command = 'READ:DEV:DB%d.T1:TEMP:LOOP:TSET';" % (i + 1)]
exec_output += [" driveable = Temp%d/sensor; lowerlimit = 0; upperlimit = 333; tolerance = '${ttol}'; property settle_time = 15;" % (i + 1)]
exec_output += [" driveable = temp%d/sensor; lowerlimit = 0; upperlimit = 333; tolerance = '${ttol}'; property settle_time = 15;" % (i + 1)]
exec_output += [" writeable = 1; write_function = setPoint; write_command = 'SET:DEV:DB%d.T1:TEMP:LOOP:TSET:';" % (i + 1)]
exec_output += [" permlink = 'T.SP%02d';" % (i + 1)]
exec_output += [" }"]
exec_output += [" group heater = {"]
exec_output += [" conditional = '[string equal -nocase [string index ${cards} %d] H] && [string equal -nocase [string index ${assoc} %d] %d]';" % (i-5, i, i-4)]
exec_output += [" var power = { read_command = 'READ:DEV:DB%d.H1:HTR:SIG:POWR'; }" % (i - 4)]
exec_output += [" var perc = { read_command = 'READ:DEV:DB%d.H1:HTR:SIG:PERC'; }" % (i - 4)]
exec_output += [" var hset = {"]
exec_output += [" read_command = 'READ:DEV:DB%d.T1:TEMP:LOOP:HSET';" % (i + 1)]
exec_output += [" lowerlimit = 0; upperlimit = 100;"]
exec_output += [" writeable = 1; write_command = 'SET:DEV:DB%d.T1:TEMP:LOOP:HSET:';" % (i + 1)]
exec_output += [" }"]
exec_output += [" }"]
exec_output += [" }"]
%end
group Pres5 = {
group pres5 = {
conditional = '[string equal -nocase [string index ${cards} 4] P]';
priv = user; type = float; readable = 5;
var sensor = { readable = 1; read_command = 'READ:DEV:DB5.P1:PRES:SIG:PRES'; permlink = 'P.PS05'; units = "mB"; }
var nick = { type=text; readable = 15; read_command = 'READ:DEV:DB5.P1:PRES:NICK'; read_function = rdText; }
var valve = {
conditional = '[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 4] 4]';
read_command = 'READ:DEV:DB4.G1:AUX:SIG:OPEN';
read_command = 'READ:DEV:DB4.G1:AUX:SIG:PERC';
}
var enab = {
conditional = '[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 4] 4]';
type = int; allowed = '0,1';
read_function = rdOnOff; read_command = 'READ:DEV:DB5.P1:PRES:LOOP:ENAB';
writeable = 1; write_function = wrOnOff; write_command = 'SET:DEV:DB5.P1:PRES:LOOP:ENAB:';
}
var auto = {
conditional = '[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 4] 4]';
type = int; allowed = '0,1';
read_function = rdOnOff; read_command = 'READ:DEV:DB5.P1:PRES:LOOP:FAUT';
writeable = 1; write_function = wrOnOff; write_command = 'SET:DEV:DB5.P1:PRES:LOOP:FAUT:';
}
var setpoint = {
conditional = '[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 4] 4]';
read_command = 'READ:DEV:DB5.P1:PRES:LOOP:TSET';
driveable = Pres5/sensor; lowerlimit = 0; upperlimit = 333; tolerance = '${ptol}'; property settle_time = 15;
driveable = pres5/sensor; lowerlimit = 0; upperlimit = 333; tolerance = '${ptol}'; property settle_time = 15;
writeable = 1; write_function = setPoint; write_command = 'SET:DEV:DB8.P1:PRES:LOOP:TSET:';
permlink = 'P.PSP05'; units = "mB";
}
var fset = {
read_command = 'READ:DEV:DB5.P1:PRES:LOOP:FSET';
lowerlimit = 0; upperlimit = 100;
writeable = 1; write_command = 'SET:DEV:DB5.P1:PRES:LOOP:FSET:';
}
}
group Pres8 = {
group pres8 = {
conditional = '[string equal -nocase [string index ${cards} 7] P]';
priv = user; type = float; readable = 5;
var sensor = { readable = 1; read_command = 'READ:DEV:DB8.P1:PRES:SIG:PRES'; permlink = 'P.PS08'; units = "mB"; }
var nick = { type=text; readable = 15; read_command = 'READ:DEV:DB8.P1:PRES:NICK'; read_function = rdText; }
var valve = {
conditional = '[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 7] 4]';
read_command = 'READ:DEV:DB4.G1:AUX:SIG:OPEN';
read_command = 'READ:DEV:DB4.G1:AUX:SIG:PERC';
}
var enab = {
conditional = '[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 7] 4]';
type = int; allowed = '0,1';
read_function = rdOnOff; read_command = 'READ:DEV:DB8.P1:PRES:LOOP:ENAB';
writeable = 1; write_function = wrOnOff; write_command = 'SET:DEV:DB8.P1:PRES:LOOP:ENAB:';
}
var auto = {
conditional = '[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 7] 4]';
type = int; allowed = '0,1';
read_function = rdOnOff; read_command = 'READ:DEV:DB8.P1:PRES:LOOP:FAUT';
writeable = 1; write_function = wrOnOff; write_command = 'SET:DEV:DB8.P1:PRES:LOOP:FAUT:';
}
var setpoint = {
conditional = '[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 7] 4]';
read_command = 'READ:DEV:DB8.P1:PRES:LOOP:TSET';
driveable = Pres8/sensor; lowerlimit = 0; upperlimit = 333; tolerance = '${ptol}'; property settle_time = 15;
driveable = pres8/sensor; lowerlimit = 0; upperlimit = 333; tolerance = '${ptol}'; property settle_time = 15;
writeable = 1; write_function = setPoint; write_command = 'SET:DEV:DB8.P1:PRES:LOOP:TSET:';
permlink = 'P.PSP08'; units = "mB";
}
var fset = {
read_command = 'READ:DEV:DB8.P1:PRES:LOOP:FSET';
lowerlimit = 0; upperlimit = 100;
writeable = 1; write_command = 'SET:DEV:DB8.P1:PRES:LOOP:FSET:';
}
}
group Valve = {
group valve = {
conditional = '[string equal -nocase [string index ${cards} 3] V]';
priv = user; type = float;
var sensor = {
readable = 5; read_command = 'READ:DEV:DB4.G1:AUX:SIG:OPEN';
readable = 5; read_command = 'READ:DEV:DB4.G1:AUX:SIG:PERC';
}
var nick = { type=text; readable = 15; read_command = 'READ:DEV:DB4.G1:AUX:NICK'; read_function = rdText; }
var setpoint = {
driveable = Valve/sensor; lowerlimit = 0; upperlimit = 100; tolerance = '${vtol}'; property settle_time = 30;
writeable = 1; write_function = setValve; write_command = 'SET:DEV:DB4.G1:AUX:SIG:OPEN:';
}
}
group Level = {
group level = {
conditional = '[string equal -nocase [string index ${cards} 4] L]';
priv = user; type = float; readable = 15;
var Nitrogen = { read_command = 'READ:DEV:DB5.L1:LVL:SIG:NIT:LEV'; permlink = 'T.N2'; }
var Helium = { read_command = 'READ:DEV:DB5.L1:LVL:SIG:HEL:LEV'; permlink = 'T.He'; }
var nitrogen = { read_command = 'READ:DEV:DB5.L1:LVL:SIG:NIT:LEV'; permlink = 'T.N2'; }
var helium = { read_command = 'READ:DEV:DB5.L1:LVL:SIG:HEL:LEV'; permlink = 'T.He'; }
var nick = { type=text; readable = 15; read_command = 'READ:DEV:DB5.L1:LVL:NICK'; read_function = rdText; }
}
@ -116,18 +171,17 @@ for i in range(8):
code read_function rdValue = {
@TCL
set value [lindex [split "${data}" ":"] end]
if {[string equal -nocase [string index ${value} end] K]} {
set value [string range ${value} 0 end-1]
}
if {[string equal -nocase ${value} NaN]} {
if {[string equal -nocase -length 3 ${value} NaN]} {
set value 0
}
if {[string equal -nocase ${value} inf] || [string equal -nocase ${value} -inf]} {
if {[string equal -nocase -length 3 ${value} inf] || [string equal -nocase -length 4 ${value} -inf]} {
set value 0
}
if {![string is double ${value}]} {
if {![string is digit [string index ${value} 0]]} {
set value 0
}
debug_log ${tc_root} 1 "rdValue tc_root=${tc_root} sct=[sct] result=[sct result]"
debug_log ${tc_root} 1 "rdValue tc_root=${tc_root} data=${data} value=${value}"
scan ${value} "%g" data
@END
}
@ -136,10 +190,31 @@ for i in range(8):
@ scan [lindex [split "$data" ":"] end] "%s" data
}
code Write_function setPoint = {
code write_function setPoint = {
}
code Write_function setValve = {
code write_function setValve = {
}
code read_function rdOnOff = {
@TCL
scan [lindex [split "$data" ":"] end] "%s" data
if {[string equal -nocase ${data} "ON"]} {
set data 1
} else {
set data 0
}
@END
}
code write_function wrOnOff = {
@TCL
if { ${par} == 1 } {
set cmd "${cmd_str}ON"
} else {
set cmd "${cmd_str}OFF"
}
@END
}
code preamble = {
@ -147,7 +222,7 @@ for i in range(8):
proc make_config {sct_controller} {
set syscat [${sct_controller} transact READ:SYS:CAT]
set result ""
set devs [regexp -inline -all {DEV:D[[:alnum:]\.]*:[[:alnum:]]*} ${syscat}]
set devs [regexp -inline -all {DEV:[DM][[:alnum:]\.]*:[[:alnum:]]*} ${syscat}]
foreach dev [lsort ${devs}] {
set typ [string index [lindex [split ${dev} :] end] 0]
set typ [string map {A V} ${typ}]
@ -157,6 +232,34 @@ for i in range(8):
clientput "Result: ${result}"
return ${result}
}
proc read_all {sct_controller} {
set syscat [${sct_controller} transact READ:SYS:CAT]
set devs [regexp -inline -all {DEV:[DM][[:alnum:]\.]*:[[:alnum:]]*} ${syscat}]
foreach dev [lsort ${devs}] {
set response [${sct_controller} transact READ:${dev}]
clientput "Device: ${response}"
}
}
proc read_loop {sct_controller} {
set pat {\m[A-Z]{1,}:[^:]{1,}}
set syscat [${sct_controller} transact READ:SYS:CAT]
set devs [regexp -inline -all {DEV:[DM][[:alnum:]\.]*:[[:alnum:]]*} ${syscat}]
foreach dev [lsort ${devs}] {
set response [${sct_controller} transact READ:${dev}:LOOP]
clientput "Device: ${response}"
clientput " Loop: [regexp -inline -all $pat [string trim ${response}]]"
}
}
proc read_sig {sct_controller} {
set pat {\m[A-Z]{1,}:[^:]{1,}}
set syscat [${sct_controller} transact READ:SYS:CAT]
set devs [regexp -inline -all {DEV:[DM][[:alnum:]\.]*:[[:alnum:]]*} ${syscat}]
foreach dev [lsort ${devs}] {
set response [${sct_controller} transact READ:${dev}:SIG]
clientput "Device: ${response}"
clientput " Sig: [regexp -inline -all $pat [string trim ${response}]]"
}
}
@END
}
}

View File

@ -387,6 +387,7 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name device_class simulatio
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver pfeiffer_hg
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -477,6 +478,7 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name device_class simulatio
hsetprop ${scobj_hpath}/pressure klass "@none"
hsetprop ${scobj_hpath}/pressure type "part"
ansto_makesctdrive ${name}_pressure_setpoint ${scobj_hpath}/pressure/setpoint ${scobj_hpath}/pressure/sensor ${sct_controller}
hsetprop ${scobj_hpath} driver pfeiffer_hg
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -239,6 +239,7 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver eurotherm_3200
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -564,6 +565,7 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
hsetprop ${scobj_hpath}/util data "false"
hsetprop ${scobj_hpath}/util klass "@none"
hsetprop ${scobj_hpath}/util type "part"
hsetprop ${scobj_hpath} driver eurotherm_3200
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -201,6 +201,7 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver srs_sr630
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -399,6 +400,7 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
hsetprop ${scobj_hpath} driver srs_sr630
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -350,6 +350,7 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver west_6100
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -630,6 +631,7 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
hsetprop ${scobj_hpath}/aux data "false"
hsetprop ${scobj_hpath}/aux klass "@none"
hsetprop ${scobj_hpath}/aux type "part"
hsetprop ${scobj_hpath} driver west_6100
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -201,6 +201,7 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver srs_sr630
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -399,6 +400,7 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
hsetprop ${scobj_hpath} driver srs_sr630
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -37,10 +37,12 @@ proc ::scobj::watlow_mpm::mkDriver { sct_controller name device_class simulation
MakeSICSObj ${name} SCT_OBJECT user float
sicslist setatt ${name} driver watlow_mpm
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver watlow_mpm
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -37,10 +37,12 @@ proc ::scobj::watlow_mrm::mkDriver { sct_controller name device_class simulation
MakeSICSObj ${name} SCT_OBJECT user float
sicslist setatt ${name} driver watlow_mrm
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver watlow_mrm
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -37,10 +37,12 @@ proc ::scobj::watlow_mst4::mkDriver { sct_controller name device_class simulatio
MakeSICSObj ${name} SCT_OBJECT user float
sicslist setatt ${name} driver watlow_mst4
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} driver watlow_mst4
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -99,6 +99,8 @@ proc ::scobj::west4100::read_config {} {
}
if { [string equal -nocase [dict get $v "driver"] "west4100"] } {
::scobj::west4100::sics_log 9 "No sctcontroller for west4100"
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
set arg_list [list]
set missing_list [list]
foreach arg {dev_id} {

View File

@ -350,6 +350,7 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver west_6100
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -630,6 +631,7 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
hsetprop ${scobj_hpath}/aux data "false"
hsetprop ${scobj_hpath}/aux klass "@none"
hsetprop ${scobj_hpath}/aux type "part"
hsetprop ${scobj_hpath} driver west_6100
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -100,6 +100,8 @@ proc ::scobj::epson_pandp::read_config {} {
}
if { [string equal -nocase [dict get $v "driver"] "epson_pandp"] } {
::scobj::epson_pandp::sics_log 9 "No sctcontroller for epson_pandp"
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
set arg_list [list]
set missing_list [list]
foreach arg {robot_name} {

View File

@ -100,6 +100,8 @@ proc ::scobj::epson_pandp::read_config {} {
}
if { [string equal -nocase [dict get $v "driver"] "epson_pandp"] } {
::scobj::epson_pandp::sics_log 9 "No sctcontroller for epson_pandp"
set ip_address [dict get $v ip]
set tcp_port [dict get $v port]
set arg_list [list]
set missing_list [list]
foreach arg {robot_name} {

View File

@ -226,6 +226,7 @@ proc ::scobj::reactor_status::mkDriver { sct_controller name device_class simula
MakeSICSObj ${name} SCT_OBJECT
sicslist setatt ${name} driver reactor_status
sicslist setatt ${name} klass ${device_class}
sicslist setatt ${name} long_name ${name}
@ -310,6 +311,7 @@ proc ::scobj::reactor_status::mkDriver { sct_controller name device_class simula
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
hsetprop ${scobj_hpath} driver reactor_status
hsetprop ${scobj_hpath} klass ${device_class}
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5

View File

@ -131,7 +131,6 @@ desc = "Function Generator"
driver = agilent_33220A
imptype = function_generator
ip = 10.157.205.16
name = pulser
port = 5025
[eularian_cradle]
@ -254,27 +253,44 @@ ip = 10.157.205.42
port = 4001
tol = 1.0
[mercury_scpi_01]
desc = "Oxford Mercury temperature controller in Mercury mode"
driver = "mercury_scpi"
[mercury_01]
assoc = 00000124
cards = HHHVLTTP
desc = "Oxford Mercury temperature controller (12T)"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.5
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[mercury_scpi_02]
desc = "Oxford Mercury temperature controller in Mercury mode"
driver = "mercury_scpi"
[mercury_02]
assoc = 00000124
cards = HHTVTTTP
desc = "Oxford Mercury temperature controller (CF10)"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.46
port = 7020
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[mercury_03]
assoc = 00000123
cards = HHHNNTTT
desc = "Oxford Mercury temperature controller ()"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.47
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[normal_sample_stage]
desc = "This is the default sample stage configuration with xy translation and phi and chi tilt stages"

View File

@ -40,7 +40,6 @@ fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl
fileeval $cfPath(environment)/temperature/ls340_sct.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl
fileeval $cfPath(environment)/temperature/lakeshore_m370_sct.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_itc.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl
fileeval $cfPath(environment)/sct_protek_common.tcl
fileeval $cfPath(environment)/protekmm_sct.tcl

View File

@ -40,7 +40,6 @@ fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl
fileeval $cfPath(environment)/temperature/sct_ls340.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_m370.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_itc.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl
fileeval $cfPath(environment)/sct_protek_common.tcl
fileeval $cfPath(environment)/sct_protekmm.tcl

View File

@ -233,27 +233,44 @@ ip = 10.157.205.42
port = 4001
tol = 1.0
[mercury_scpi_01]
desc = "Oxford Mercury temperature controller in Mercury mode"
driver = "mercury_scpi"
[mercury_01]
assoc = 00000124
cards = HHHVLTTP
desc = "Oxford Mercury temperature controller (12T)"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.5
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[mercury_scpi_02]
desc = "Oxford Mercury temperature controller in Mercury mode"
driver = "mercury_scpi"
[mercury_02]
assoc = 00000124
cards = HHTVTTTP
desc = "Oxford Mercury temperature controller (CF10)"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.46
port = 7020
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[mercury_03]
assoc = 00000123
cards = HHHNNTTT
desc = "Oxford Mercury temperature controller ()"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.47
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[normal_sample_stage]
desc = "This is the default sample stage configuration with xy translation and phi and chi tilt stages"

View File

@ -910,7 +910,7 @@ proc get_vei {} {
proc set_vwi {wavelength} {
set dd 3.35416
set theta [expr (180.0 / 3.141592654) * asin($wavelength / (2.0 * $dd))]
set result [format "moma=%f,momb=%f,momc=%f,mtth=%f" $theta $theta $theta [expr 2.0 * $theta]]
set result [format "moma=%f,momb=%f,momc=%f,mtth=%f" -$theta -$theta -$theta [expr 2.0 * $theta]]
return $result
}
@ -930,10 +930,15 @@ vwi drivescript set_vwi
sicslist setatt vwi units Angstrom
sicslist setatt vwi klass crystal
sicslist setatt vwi long_name wavelength
sicslist setatt vwi hdbchain mtth
MakeConfigurableMotor vei
vei readscript get_vei
vei drivescript set_vei
sicslist setatt vei units mEv
sicslist setatt vei klass crystal
sicslist setatt vei long_name energy
sicslist setatt vei hdbchain mtth
publish get_vwi user
publish set_vwi user

View File

@ -42,7 +42,6 @@ fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl
fileeval $cfPath(environment)/temperature/ls340_sct.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl
fileeval $cfPath(environment)/temperature/lakeshore_m370_sct.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_itc.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl
fileeval $cfPath(environment)/sct_protek_common.tcl
fileeval $cfPath(environment)/protekmm_sct.tcl

View File

@ -250,27 +250,44 @@ terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[mercury_scpi_01]
desc = "Oxford Mercury temperature controller with three temperature loops."
driver = "mercury_base"
[mercury_01]
assoc = 00000124
cards = HHHVLTTP
desc = "Oxford Mercury temperature controller (12T)"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.5
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[mercury_scpi_02]
desc = "Oxford Mercury temperature controller with four temperature loops and needle valve control"
driver = "mercury_scpi"
[mercury_02]
assoc = 00000124
cards = HHTVTTTP
desc = "Oxford Mercury temperature controller (CF10)"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.46
port = 7020
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[mercury_03]
assoc = 00000123
cards = HHHNNTTT
desc = "Oxford Mercury temperature controller ()"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.47
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[normal_sample_stage]
desc = "This is the default sample stage configuration"

View File

@ -49,9 +49,9 @@ fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_itc.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl
fileeval $cfPath(environment)/temperature/west400.tcl
fileeval $cfPath(environment)/he3/sct_he3.tcl
fileeval $cfPath(environment)/magneticField/oxford_labview.tcl
fileeval $cfPath(environment)/magneticField/sct_oxford12tlv.tcl
fileeval $cfPath(environment)/he3/sct_he3.tcl
fileeval config/load_setup.tcl
fileeval log.tcl
publish logbook spy

View File

@ -124,7 +124,6 @@ desc = "Function Generator"
driver = agilent_33220A
imptype = function_generator
ip = 10.157.205.16
name = pulser
port = 5025
[ls336_01]
@ -235,27 +234,44 @@ terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[mercury_scpi_01]
desc = "Oxford Mercury temperature controller with three temperature loops."
driver = "mercury_base"
[mercury_01]
assoc = 00000124
cards = HHHVLTTP
desc = "Oxford Mercury temperature controller (12T)"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.5
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[mercury_scpi_02]
desc = "Oxford Mercury temperature controller with four temperature loops and needle valve control"
driver = "mercury_scpi"
[mercury_02]
assoc = 00000124
cards = HHTVTTTP
desc = "Oxford Mercury temperature controller (CF10)"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.46
port = 7020
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[mercury_03]
assoc = 00000123
cards = HHHNNTTT
desc = "Oxford Mercury temperature controller ()"
driver = "oxford_mercury"
imptype = temperature
ip = 10.157.205.47
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
ptol = 5
terminator = \n
ttol = 1.0
vtol = 5
[normal_sample_stage]
desc = "This is the default sample stage configuration"

View File

@ -1628,6 +1628,7 @@ def put_mkDriver(MyDriver):
ms_line = ' MakeSICSObj ${name} SCT_OBJECT'
txt += [ms_line]
txt += ['']
txt += [' sicslist setatt ${name} driver %s' % MyDriver['name']]
txt += [' sicslist setatt ${name} klass ${device_class}']
txt += [' sicslist setatt ${name} long_name ${name}']
if 'DriverProperty' in MyDriver:
@ -1639,6 +1640,7 @@ def put_mkDriver(MyDriver):
for group in sorted(MyDriver['Groups']):
txt += put_group(MyDriver, MyDriver['Groups'][group])
txt += [' hsetprop ${scobj_hpath} driver %s' % MyDriver['name']]
txt += [' hsetprop ${scobj_hpath} klass ${device_class}']
txt += [' hsetprop ${scobj_hpath} data true']
txt += [' hsetprop ${scobj_hpath} debug_threshold %s' % str(MyDriver['debug_threshold'])]
@ -1785,6 +1787,8 @@ def put_read_config(MyDriver):
txt += [' if { [string equal -nocase [dict get $v "driver"] "%s"] } {' % MyDriver['name']]
if ('WrapperProperty' in MyDriver) and ('nosctcontroller' in MyDriver['WrapperProperty']):
txt += [' %s::sics_log 9 "No sctcontroller for %s"' % (MyDriver['namespace'], MyDriver['name'])]
txt += [' set ip_address [dict get $v ip]']
txt += [' set tcp_port [dict get $v port]']
else:
txt += [' if { ![string equal -nocase "${simulation_flag}" "false"] } {']
txt += [' set asyncqueue "null"']