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

Conflicts:
	sics/site_ansto/instrument/bilby/config/chopper/sct_astrium_chopper.tcl
	sics/site_ansto/instrument/hipd/wombat_configuration.tcl
	sics/site_ansto/instrument/pelican/pelican_configuration.tcl
This commit is contained in:
Douglas Clowes
2014-08-06 13:53:18 +10:00
80 changed files with 2274 additions and 819 deletions

View File

@ -465,6 +465,13 @@ static int CommandTimeout(void *cntx, int mode)
pAsyncQueue self = (pAsyncQueue) cntx;
pAQ_Cmd myCmd = self->command_head;
self->nw_tmr = 0;
if (self->trace) {
struct timeval tv;
gettimeofday(&tv, NULL);
SICSLogTimePrintf(eLog, &tv,
"Timeout Trace on AsyncQueue %s", self->queue_name);
SICSLogWriteHexTime(myCmd->tran->inp_buf, myCmd->tran->inp_idx, eLog, &tv);
}
if (myCmd->retries > 0) {
--myCmd->retries;
StartCommand(self);

View File

@ -632,3 +632,14 @@ int ANETreadTillTerm(int handle,
}
return ANETTIMEOUT;
}
char *ANETgetWBuffer(int handle) {
pSocketDescriptor sock;
int len;
char *wdata;
sock = findSocketDescriptor(handle);
wdata = (char *) GetRWBufferData(sock->writeBuffer, &len);
wdata[len] = '\0';
return wdata;
}

View File

@ -207,4 +207,9 @@ int ANETreadTillTerm(int handle,
* \param userData An opaque pointer with data for lcb
*/
void ANETsetLog(ANETlog lcb, void *userData);
/**
* \brief Return a pointer to the socket descriptor write buffer
* \param handle Connection object socket handle
*/
char *ANETgetWBuffer(int handle);
#endif /*ASYNNET_H_ */

View File

@ -19,12 +19,13 @@ void print_state(state_t s) {
}
void print_event(event_t E) {
char *ca, *cm, *cd, *dr;
char *ca, *cm, *cd, *dr, *cl;
ca = event_names[E.ca];
cm = event_names[E.cm];
cd = event_names[E.cd];
dr = event_names[E.dr];
printf("%s,%s,%s,%s", ca, cm, cd, dr);
cl = event_names[E.cl];
printf("%s,%s,%s,%s,%s", ca, cm, cd, dr, cl);
}
event_t output(state_t Sc, enum event_codes Ei) {
@ -78,7 +79,7 @@ int test_camrep2sym(void) {
int test_trans_fn(void) {
int i;
event_t Eo={0,0,0,0};
event_t Eo={0,0,0,0,0};
state_t Sc = {.cl=SCL_RDY, .cm=SCM_IDLE, .dr=SDR_IDLE};
@ -101,6 +102,15 @@ int test_trans_fn(void) {
printf(",\t");
print_event(Eo);
printf("\n");
if (Eo.cl) {
/* TODO Handle feedback in the general case where there may be multiple events in Eo to feed back into the transition function */
printf("%s,\t",event_names[Eo.cl]);
print_state(Sc);
cam_trans_fn(Sc, Eo.cl, &Sc, &Eo);
printf(",\t");
print_event(Eo);
printf("\n");
}
}
fprintf(stderr, "TEST_TRANS_FN:OUTPUT:END\n");
return 1;
@ -120,7 +130,10 @@ int camdriv_out(void *me, event_t Eo) {
if (Eo.dr) {
printf("camdriv_out: symbol=%s, output=%s\n", event_names[Eo.dr], event_signatures[Eo.dr]);
}
return 1;
if (Eo.cl) {
printf("camdriv_out: symbol=%s, output=%s\n", event_names[Eo.cl], event_signatures[Eo.cl]);
}
return -1;
}
int test_camdriv_event_io(void) {
@ -139,12 +152,14 @@ int test_camdriv_event_io(void) {
printf("input: %s :", event_names[Ein]);
print_state(cdinfo.Sc);
printf("\n");
camdriv_input(&self, &cdinfo, Ein);
Ein = ECM_IDLE;
printf("input: %s :", event_names[Ein]);
cdinfo.Sc.cl=SCL_TK_SHOT;
print_state(cdinfo.Sc);
printf("\n");
camdriv_input(&self, &cdinfo, Ein);
fprintf(stderr, "TEST_CAMDRIVER_EVENT_IO:OUPUT:END\n");

View File

@ -12,7 +12,7 @@
#define TR(a,b) #a,
#define TE(a,b) #a
char *event_names[] = { "0", CAMERA_CMDS_TABLE, CAMERA_MSGS_TABLE, CAM_MOD_EVENT_TABLE, DRIVER_EVENT_TABLE, CMD_EVENT_TABLE };
char *event_names[] = { "0", CAMERA_CMDS_TABLE, CAMERA_MSGS_TABLE, CAM_MOD_EVENT_TABLE, DRIVER_EVENT_TABLE, CMD_EVENT_TABLE, CMD_LATCH_EVENT_TABLE};
#undef TR
#undef TE
@ -47,6 +47,7 @@ void EVclr(event_t *E) {
E->cm=0;
E->cd=0;
E->dr=0;
E->cl=0;
}
/* Set event channel */
@ -55,6 +56,7 @@ void EVset(event_t *E, event_t Ev) {
if (Ev.cm) E->cm = Ev.cm;
if (Ev.cd) E->cd = Ev.cd;
if (Ev.dr) E->dr = Ev.dr;
if (Ev.cl) E->cl = Ev.cl;
}
/* Set system state */
@ -121,7 +123,14 @@ enum event_codes cam_rep2sym(char *msg) {
return -1;
}
/* return 0 = no transition,
/* \brief Transition function. Given an input event it maps the current state
* to the next state and output.
*
* \param Sc current state.
* \param Ein input event.
* \param Sn will be set to the next state.
* \param Eo will be set as the output event.
* return 0 = no transition,
* return 1 = transition
*/
int cam_trans_fn(state_t Sc, enum event_codes Ein, state_t *Sn, event_t *Eo) {
@ -141,11 +150,23 @@ int cam_trans_fn(state_t Sc, enum event_codes Ein, state_t *Sn, event_t *Eo) {
}
/* TODO Do we need Eo in self, should camsm_t be refactored to remove it? */
/* \brief Takes an input event from the camera driver, runs it through the
* state machine and sets the current state equal to the next state.
*
* \param caller is a reference to the object (ie camera driver) sending the event.
* \param self is a reference to the state machine transfer object.
* \param event_sym is the input event symbol.
*/
void camdriv_input(void *caller, camsm_t *self, enum event_codes event_sym) {
int input_event;
state_t Sn;
cam_trans_fn(self->Sc, event_sym, &Sn, &self->Eo);
self->output_fn(caller, self->Eo);
self->Sc = Sn;
input_event = event_sym;
while (input_event != -1) {
cam_trans_fn(self->Sc, input_event, &Sn, &self->Eo);
input_event = self->output_fn(caller, self->Eo);
self->Sc = Sn;
}
}
char *strstate(state_t s) {
@ -158,12 +179,13 @@ char *strstate(state_t s) {
}
char *strevent(event_t E) {
char *ca, *cm, *cd, *dr;
char *ca, *cm, *cd, *dr, *cl;
ca = event_names[E.ca];
cm = event_names[E.cm];
cd = event_names[E.cd];
dr = event_names[E.dr];
snprintf(event_str, ESLEN, "%s,%s,%s,%s", ca, cm, cd, dr);
cl = event_names[E.cl];
snprintf(event_str, ESLEN, "%s,%s,%s,%s,%s", ca, cm, cd, dr, cl);
return event_str;
}
@ -190,16 +212,18 @@ char *strevent(event_t E) {
* 0 = no change for components of next state.
*/
trans_t TRANS_TABLE[] = {
{{.cl=SCL_RDY, .dr=SDR_IDLE}, ECD_TK_SHOT, {.dr=0}, {.cl=SCL_TK_SHOT}},
{{.cl=SCL_RDY, .dr=SDR_IDLE}, ECD_MLTI_ON, {.dr=0}, {.cl=SCL_TK_MLTI}},
{{.cl=SCL_RDY}, ECD_TK_SHOT, {.dr=0}, {.cl=SCL_CFG_TK_SHOT}},
{{.cl=SCL_RDY}, ECD_MLTI_ON, {.dr=0}, {.cl=SCL_CFG_TK_MLTI}},
{{.cl=SCL_CFG_TK_SHOT}, ECM_IDLE, {.ca=ECA_CFG}, {.cl=SCL_TK_SHOT}},
{{.cl=SCL_TK_SHOT}, ECM_IDLE, {.ca=ECA_TK_SHOT}, {.cl=SCL_WT}},
{{.cl=SCL_TK_MLTI}, ECD_MLTI_OFF,{.dr=0}, {.cl=SCL_RDY}},
{{.cl=SCL_CFG_TK_MLTI}, ECD_MLTI_OFF,{.cl=ECL_RDY}, {.cl=SCL_RDY}},
{{.cl=SCL_TK_MLTI}, ECD_MLTI_OFF,{.cl=ECL_RDY}, {.cl=SCL_RDY}},
{{.cl=SCL_CFG_TK_MLTI}, ECM_IDLE, {.ca=ECA_CFG}, {.cl=SCL_TK_MLTI}},
{{.cl=SCL_TK_MLTI}, ECM_IDLE, {.ca=ECA_MLTI_ON}, {.cl=SCL_MLTI_ON}},
{{.cl=SCL_MLTI_ON}, ECD_MLTI_OFF,{.ca=ECA_MLTI_OFF},{.cl=SCL_WT}},
{{.cl=SCL_WT}, ECM_ACQ, {.dr=0}, {.cl=SCL_RDY}},
{{.cl=SCL_WT}, ECM_PROC, {.dr=0}, {.cl=SCL_RDY}},
{{.cl=SCL_WT}, ECM_STOP, {.dr=0}, {.cl=SCL_RDY}},
{{.cl=SCL_WT}, ECM_IDLE, {.dr=0}, {.cl=SCL_RDY}},
{{.cl=SCL_WT}, ECM_PROC, {.cl=ECL_RDY}, {.cl=SCL_RDY}},
{{.cl=SCL_WT}, ECM_STOP, {.cl=ECL_RDY}, {.cl=SCL_RDY}},
{{.cl=SCL_WT}, ECM_IDLE, {.cl=ECL_RDY}, {.cl=SCL_RDY}},
{{.cm=SCM_IDLE}, ECM_ACQ, {.dr=0}, {.cm=SCM_ACQ}},
{{.cm=SCM_IDLE}, ECM_PROC, {.dr=0}, {.cm=SCM_PROC}},
@ -211,8 +235,6 @@ trans_t TRANS_TABLE[] = {
{{.dr=SDR_IDLE}, ECD_TK_SHOT, {.dr=EDR_BUSY}, {.dr=SDR_BUSY}},
{{.dr=SDR_IDLE}, ECD_MLTI_ON, {.dr=EDR_BUSY}, {.dr=SDR_BUSY}},
{{.dr=SDR_BUSY, .cl=SCL_RDY}, ECM_PROC, {.dr=EDR_IDLE}, {.dr=SDR_IDLE}},
{{.dr=SDR_BUSY, .cl=SCL_RDY}, ECM_STOP, {.dr=EDR_IDLE}, {.dr=SDR_IDLE}},
{{.dr=SDR_BUSY, .cl=SCL_RDY}, ECM_IDLE, {.dr=EDR_IDLE}, {.dr=SDR_IDLE}},
{{.dr=SDR_BUSY}, ECL_RDY, {.dr=EDR_IDLE}, {.dr=SDR_IDLE}},
{{.dr=END_TABLE}, END_TABLE, {.dr=END_TABLE}, {.dr=END_TABLE}}
};

View File

@ -9,15 +9,15 @@
*
* Deterministic Finite State machine transducer (Mealy)
* The idea is to synthesize a state machine which handles the union of input
* events for a given set state machines in a system.
* events for a given set of state machines in a system.
*
* The system is made up of three components, a command latch (CL), a camera
* model (CM) and the driver (DR). The system state machine is considered to be
* model (CM) and the driver (DR). The system's state machine is considered to be
* made up of the component state machines running in parallel and with some of
* the component state machine transitions being restricted by system state
* transition rules.
* The sets of states are,
* SCL:Command Latch states, SCM:Camera Model states, SCDR:Driver states.
* SCL:Command Latch states, SCM:Camera Model states, SDR:Driver states.
* Q is the set of system states.
* The sets of event symbols are defined as,
* ECA:Camera events, ECM:Camera model events, ECD:User command events,
@ -25,11 +25,20 @@
*
* The system state machine for the camera driver is defined as follows.
* In the following, '<' means subset
* Q < SCL X SCM X SCDR
* Ein = ECA U ECM U ECD U EDR
* Eo < ECA X ECM X ECD X EDR
* Q < SCL X SCM X SDR
* Ein = ECA U ECM U ECD U EDR U ECL
* Eo < ECA X ECM X ECD X EDR X ECL
* trans fn: QXEin -> Q
* out fn : QXEin -> Eo
* out fn: QXEin -> Eo
*
* Command Latch State Machine (the SCL_XXX states):
* Waits for camera to be idle before sending a command and emits a ECL_RDY
* event when it is ready to accept a new command.
* Camera Model State Machine (the SCM_XXX states):
* Reduces the number of camera states by grouping them into categories of
* interest to the driver.
* Driver State Machine (the SDR_XXX states):
* Reports HWIdle, HWBusy, HWFault states to SICS.
*
* In the implementation the transition and output functions are combined in
* TRANS_TABLE.
@ -52,7 +61,8 @@
TR(ECA_MLTI_ON, "take multi on") \
TR(ECA_MLTI_OFF, "take multi off") \
TR(ECA_GET_STATUS, "get status") \
TE(ECA_GET_STATE, "get state")
TR(ECA_GET_STATE, "get state") \
TE(ECA_CFG, "update camera settings, file configuration and meta data")
#define CAMERA_MSGS_TABLE \
TR(ECA_START, "StartTime") \
@ -95,7 +105,14 @@
TR(EDR_BUSY, "HWBUSY") \
TE(EDR_FAULT, "HWFAULT")
#define ESLEN 32
/* COMMAND LATCH EVENT TABLE
* These events are of interest to the SDR driver state machine.
*/
#define CMD_LATCH_EVENT_TABLE \
TE(ECL_RDY, "Latch ready to accept a command")
/* Event message/description string length excluding \0 */
#define ESLEN 64
/* STATE CODES
* SXX_ State code enum constants, XX identifies a component of the system.
@ -105,7 +122,9 @@
*/
#define COMMAND_LATCH_STATE_TABLE \
TR(SCL_RDY, "command latch ready to accept") \
TR(SCL_CFG_TK_SHOT, "take shot waiting to send config") \
TR(SCL_TK_SHOT, "latched a take shot command") \
TR(SCL_CFG_TK_MLTI, "multi-shot waiting to send config") \
TR(SCL_TK_MLTI, "latched a multi-shot command") \
TR(SCL_MLTI_ON, "multi-shot is running") \
TE(SCL_WT, "waiting for camera to start acquisition")
@ -125,7 +144,7 @@
/* Enumerate event and state symbols */
#define TR(a,b) a,
#define TE(a,b) a
enum event_codes {ECA_UNKNOWN, CAMERA_CMDS_TABLE, CAMERA_MSGS_TABLE, CAM_MOD_EVENT_TABLE, DRIVER_EVENT_TABLE, CMD_EVENT_TABLE};
enum event_codes {ECA_UNKNOWN, CAMERA_CMDS_TABLE, CAMERA_MSGS_TABLE, CAM_MOD_EVENT_TABLE, DRIVER_EVENT_TABLE, CMD_EVENT_TABLE, CMD_LATCH_EVENT_TABLE};
#undef TR
#undef TE
@ -152,13 +171,14 @@ extern char *event_signatures[];
/* Output event channel
* A tuple (Eca,Ecm,Ecd,Edr) in ECA X ECM X ECD X EDR
* A tuple (Eca,Ecm,Ecd,Edr,Ecl) in ECA X ECM X ECD X EDR X ECL
*/
typedef struct {
enum event_codes ca;
enum event_codes cm;
enum event_codes cd;
enum event_codes dr;
enum event_codes cl;
} event_t;
/* A tuple (Scl,Scm,Sdr) in SCL X SCM X SDR */
@ -211,7 +231,7 @@ void STset(state_t *Sc, state_t St);
/* \brief Translates a camera status message to a camera (ECA_) event */
enum event_codes cam_rep2sym(char *msg);
/* \brief Converts a camera (ECA_) event to a camera modle (ECM_) event */
/* \brief Converts a camera (ECA_) event to a camera model (ECM_) event */
enum event_codes camera_model(enum event_codes event);
/* \brief Determines camera state from camera status message and reads acquisition

View File

@ -8,6 +8,8 @@
*
* Copyright: see file Copyright.txt
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sics.h>
#include <obdes.h>
@ -17,8 +19,12 @@
#include <math.h>
#include "camera.h"
#define NAMELEN 32
#define IFMTLEN 4
#define ERRLEN 256
#define MSGLEN 512
#define MAX_META_COUNT 32
#define MAX_SCANVAR_COUNT 16
enum camstates {idle, acquiring, processing, saving};
#define CAMDRIV_ERRTABLE \
@ -73,22 +79,32 @@ static int NUMCAMPAR = CAMDRIV_PARTABLE;
#define TR(a,b) a,
#define TE(a,b) a
enum campar {CAMDRIV_PARTABLE, MULTI};
enum campar {CAMDRIV_PARTABLE, MULTI, DEBUG};
enum flipval {FLIP_TABLE};
#undef TR
#undef TE
#define TR(a,b) b,
#define TE(a,b) b
static char *cacmdstr[] = {CAMDRIV_PARTABLE, "multi", NULL};
static char *cacmdstr[] = {CAMDRIV_PARTABLE, "multi", "debug", NULL};
static char *flipcmdstr[] = {FLIP_TABLE, NULL};
#undef TR
#undef TE
// Camera get/set commands: ['status', 'info', 'state', 'camera', 'meta', 'file']
#define ECMDSTART 0
#define EGETSTART 100
#define ESETSTART 200
#define UPDATE_SETTINGS_CFG 1
#define CLEAR_META_CFG 2
#define UPDATE_META_CFG 4
#define UPDATE_SCANVAR_CFG 8
#define UPDATE_FILE_CFG 16
typedef struct {
char path[MSGLEN];
char basename[MSGLEN];
long startnumber;
char imageformat[IFMTLEN];
char experimentdetail[MSGLEN];
} filecfg_t;
typedef struct {
float clockMHz;
float bin;
@ -105,18 +121,17 @@ typedef struct {
float shopt;
float shclt;
int updatecfg;
filecfg_t file;
char meta_list[MAX_META_COUNT][MSGLEN];
char scanvar_list[MAX_SCANVAR_COUNT][NAMELEN];
pDummy scanvar_dummy[MAX_SCANVAR_COUNT];
pIDrivable pscanvar[MAX_SCANVAR_COUNT];
int meta_count;
int scanvar_count;
} camcfg_t;
typedef struct {
char path[MSGLEN];
char basename[MSGLEN];
int startnumber;
char imageformat[MSGLEN];
char experimentdetail[MSGLEN];
int updatecfg;
} filecfg_t;
typedef struct {
pObjectDescriptor pDes;
int debug;
char *asynq;
camsm_t state_machine;
@ -124,15 +139,31 @@ typedef struct {
int status;
enum errcodes camError;
camcfg_t camera;
/* filecfg_t file;*/
pAsyncUnit asyncUnit;
SicsInterp *pSics;
} CamObj;
/* Camera communications and protocol handlers */
static pAsyncProtocol CAM_Protocol = NULL;
static int cb_state_timer(void *ctx, int mode);
static int cb_getstate(pAsyncTxn txn);
static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal);
/* if emsg == NULL conversion OK else if emsg == num not an integer else emsg == error message */
long getlong(char *num, char *emsg) {
long val = 0;
char *endptr;
errno = 0;
emsg = NULL;
val = strtol(num, &endptr, 10);
if ( (errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) || (errno != 0 && val == 0) )
emsg = strerror(errno);
if (endptr == num)
emsg = num;
return val;
}
static void CAM_Notify(void* context, int event) {
CamObj *self = (CamObj *) context;
@ -214,78 +245,25 @@ static int CamGetStatus(CounterDriver *cntrData, float *fControl) {
* \param ev_sym, input event
*/
static void run_sm(CamObj *self, enum event_codes ev_sym) {
char sscur[SSLEN+1], ssnext[SSLEN+1], esout[ESLEN+1], message[MSGLEN+1];
char *sscur, *ssnext, *esout, message[MSGLEN+1];
if (self->debug)
strncpy(sscur, strstate(self->state_machine.Sc), SSLEN);
if (self->debug) {
sscur = strstate(self->state_machine.Sc);
snprintf(message, MSGLEN, "DEBUG:(run_sm) Scurr:%s Ei:%s",
sscur,event_names[ev_sym]);
SICSLogWrite(message, eLog);
}
camdriv_input(self, &self->state_machine, ev_sym);
if (self->debug) {
strncpy(ssnext, strstate(self->state_machine.Sc), SSLEN);
strncpy(esout, strevent(self->state_machine.Eo), ESLEN);
snprintf(message, MSGLEN, "DEBUG:(run_sm) Scurr:%s Ei:%s",
sscur,event_names[ev_sym]);
SICSLogWrite(message, eLog);
snprintf(message, MSGLEN, "DEBUG:(run_sm) Snext:%s Eo:%s", ssnext,esout);
ssnext = strstate(self->state_machine.Sc), SSLEN;
esout = strevent(self->state_machine.Eo), ESLEN;
snprintf(message, MSGLEN, "DEBUG:(run_sm) Snext:%s Eo:%s", ssnext, esout);
SICSLogWrite(message, eLog);
}
}
/* \brief sendcfg, Send the camera configuration to the camera server
*/
int sendcfg(CamObj *self) {
int status, replen=MSGLEN;
char reply[MSGLEN+1], logmsg[MSGLEN+1];
char cfgCmd[MSGLEN+1];
float clock = self->camera.clockMHz;
if(self->camera.updatecfg) {
sprintf(cfgCmd,
"set camera,clock=%.*fmhz,bin=%dx,size=%d,gain=%dxhs,flip=%s,xstart=%d,ystart=%d,xend=%d,yend=%d,exposure=%f,temperature=%f,threshold=%d,shutteropentime=%d,shutterclosetime=%d",
clock>=1 ? 0 : 1, clock, (int)self->camera.bin, (int)self->camera.size,
(int)self->camera.gain, flipcmdstr[self->camera.flip],
(int)self->camera.xstart, (int)self->camera.ystart,
(int)self->camera.xend, (int)self->camera.yend, self->camera.exposure,
self->camera.temp, (int)self->camera.thresh, (int)self->camera.shopt,
(int)self->camera.shclt
);
status = AsyncUnitTransact(self->asyncUnit, cfgCmd, strlen(cfgCmd), reply, &replen);
if (status <= 0)
return 0;
else
if (strncmp("OK", reply, 2) == 0)
return 1;
else {
snprintf(logmsg, MSGLEN, "CAM:(sendcfg) set camera reply=%s", reply);
SICSLogWrite(logmsg, eLogError);
return 0;
}
}
/* TBD, other fields to be set
if(self->file.updatecfg) {
sprintf(cfgCmd, "set camera, path=%s,basename=%s,startnumber=%d,imageformat=%s,experimentdetail=%s",
self->file.path,
self->file.basename,
self->file.startnumber,
self->file.imageformat, self->file.experimentdetail);
status = AsyncUnitTransact(self->asyncUnit, cfgCmd, strlen(cfgCmd), reply, &replen);
if (status <= 0)
return 0;
else
if (strncmp("OK", reply, 2) == 0)
return 1;
else {
snprintf(logmsg, MSGLEN, "CAM:(sendcfg) set file reply=%s", reply);
SICSLogWrite(logmsg, eLogError);
return 0;
}
} */
}
/* Called by the scan command and via the count and countnb subcommands of a
* counter object. Will update the configuration if necessary.
*/
@ -295,18 +273,12 @@ static int CamStart(CounterDriver *cntrData) {
char logmsg[MSGLEN+1];
self = cntrData->pData;
/* Send the updated configuration to the camera server if it has been changed
* on SICS since the last shot was taken. */
if (self->camera.updatecfg) {
if (sendcfg(self) == 0) {
snprintf(logmsg, MSGLEN, "CAM:(CamStart) Failed to upload configuration");
SICSLogWrite(logmsg, eLogError);
return 0;
}
self->camera.updatecfg = 0;
if (self->debug) {
snprintf(logmsg, MSGLEN, "DEBUG:(CamStart): preset=%f\n",cntrData->fPreset);
SICSLogWrite(logmsg, eLog);
}
CamSet(cntrData, "exposure", 0, cntrData->fPreset);
if (self->state_machine.multi) {
cd_sym = ECD_MLTI_ON;
} else {
@ -324,13 +296,18 @@ static int CamContinue(CounterDriver *cntrData) {
}
static int CamHalt(CounterDriver *cntrData) {
CamObj *self = cntrData->pData;
state_t start_state = {.cl=SCL_RDY, .cm=SCM_IDLE, .dr=SDR_IDLE};
if (self->state_machine.multi) {
run_sm(self, ECD_MLTI_OFF);
} else {
STset(&self->state_machine.Sc, start_state);
EVclr(&self->state_machine.Eo);
self->status = HWIdle;
}
return 1;
}
/* TODO what should the counter data be set to? Total intensity? */
/* FIXME what should the counter data be set to? Total intensity? */
static int CamReadValues(CounterDriver *cntrData) {
int status, iReplyLen=MSGLEN;
char *cmd="TODO ", pReply[MSGLEN];
@ -395,6 +372,12 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
return 0;
}
switch (id) {
case DEBUG:
if (fVal == 1)
camdriv->debug = 1;
else
camdriv->debug = 0;
break;
case MULTI:
if (fVal != 0 && fVal != 1) {
return 0;
@ -405,7 +388,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case CLOCK:
if (fVal > 0) {
camdriv->camera.clockMHz = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -413,7 +396,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case BIN:
if (fVal > 0) {
camdriv->camera.bin = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -421,7 +404,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case SIZE:
if (fVal > 0) {
camdriv->camera.size = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -429,7 +412,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case GAIN:
if (fVal > 0) {
camdriv->camera.gain = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -446,7 +429,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case INVFV:
case INVFHV:
camdriv->camera.flip = flip;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
break;
default:
return 0;
@ -456,7 +439,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case XSTART:
if (fVal > 0) {
camdriv->camera.xstart = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -464,7 +447,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case YSTART:
if (fVal > 0) {
camdriv->camera.ystart = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -472,7 +455,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case XEND:
if (fVal > 0) {
camdriv->camera.xend = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -480,7 +463,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case YEND:
if (fVal > 0) {
camdriv->camera.yend = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -488,19 +471,19 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case EXPOSURE:
if (fVal > 0) {
camdriv->camera.exposure = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
break;
case TEMP:
camdriv->camera.temp = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
break;
case THRESH:
if (fVal > 0) {
camdriv->camera.thresh = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -508,7 +491,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case SHOPT:
if (fVal > 0) {
camdriv->camera.shopt = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -516,7 +499,7 @@ static int CamSet(CounterDriver *cntrData, char *name, int iCter, float fVal) {
case SHCLT:
if (fVal > 0) {
camdriv->camera.shclt = fVal;
camdriv->camera.updatecfg = 1;
camdriv->camera.updatecfg |= UPDATE_SETTINGS_CFG;
} else {
return 0;
}
@ -616,8 +599,11 @@ static int CamSend(CounterDriver *cntrData, char *pText, char *pReply, int iRepl
static int cb_shotcmd(pAsyncTxn txn) {
CamObj *self = (CamObj *) txn->cntx;
char *resp = txn->inp_buf, message[MSGLEN+1];
enum event_codes cd_sym;
if (self->debug) {
snprintf(message, MSGLEN, "DEBUG:(cb_shotcmd) Camera reply: %s", resp);
SICSLogWrite(message, eLog);
}
if (strncmp(resp, "OK", 2) != 0) {
self->camError = EFAIL;
return 0;
@ -625,50 +611,139 @@ static int cb_shotcmd(pAsyncTxn txn) {
return 1;
}
/**
* \brief Decides if an output message is targeted at the camera or SICS or if
* it should be fed back into the state transition function.
*/
int camdriv_out(void *me, event_t Eo) {
int len;
int i, len, pend=0;
char cmd[MSGLEN]="", logmsg[MSGLEN+1]="";
float clock, fVal;
CamObj *self = (CamObj *)me;
if (Eo.ca) {
/* send command to camera */
switch (Eo.ca) {
case ECA_TK_SHOT:
len = strlen(event_signatures[ECA_TK_SHOT]);
strncpy(cmd, event_signatures[ECA_TK_SHOT], len);
break;
case ECA_MLTI_ON:
len = strlen(event_signatures[ECA_MLTI_ON]);
strncpy(cmd, event_signatures[ECA_MLTI_ON], len);
break;
case ECA_MLTI_OFF:
len = strlen(event_signatures[ECA_MLTI_OFF]);
strncpy(cmd, event_signatures[ECA_MLTI_OFF], len);
break;
default:
snprintf(logmsg, MSGLEN, "CAM:(camdriv_out) Unhandled event %s", event_names[Eo.ca]);
SICSLogWrite(logmsg, eLogError);
return 0;
}
AsyncUnitSendTxn(self->asyncUnit, cmd, len, cb_shotcmd, self, MSGLEN);
if (self->debug) {
snprintf(logmsg, MSGLEN, "DEBUG:(camdriv_out:Eo.ca): ev=%s, output=%s\n",
event_names[Eo.ca], event_signatures[Eo.ca]);
SICSLogWrite(logmsg, eLog);
}
switch (Eo.ca) {
case ECA_TK_SHOT:
len = strlen(event_signatures[ECA_TK_SHOT]);
strncpy(cmd, event_signatures[ECA_TK_SHOT], len);
len = strlen(cmd);
AsyncUnitSendTxn(self->asyncUnit, cmd, len, cb_shotcmd, self, MSGLEN);
break;
case ECA_MLTI_ON:
len = strlen(event_signatures[ECA_MLTI_ON]);
strncpy(cmd, event_signatures[ECA_MLTI_ON], len);
len = strlen(cmd);
AsyncUnitSendTxn(self->asyncUnit, cmd, len, cb_shotcmd, self, MSGLEN);
break;
case ECA_MLTI_OFF:
len = strlen(event_signatures[ECA_MLTI_OFF]);
strncpy(cmd, event_signatures[ECA_MLTI_OFF], len);
len = strlen(cmd);
AsyncUnitSendTxn(self->asyncUnit, cmd, len, cb_shotcmd, self, MSGLEN);
break;
case ECA_CFG:
/* TODO Should we retry sending a command if AsyncUnitSendTxn fails?
* The driver should abort the shot and then try to send the
* configuration the next time a shot is taken. */
if( (self->camera.updatecfg & UPDATE_SETTINGS_CFG) == UPDATE_SETTINGS_CFG) {
clock = self->camera.clockMHz;
snprintf(cmd, MSGLEN,
"set camera,clock=%.*fmhz,bin=%dx,size=%d,gain=%dxhs,flip=%s,xstart=%d,ystart=%d,xend=%d,yend=%d,exposure=%f,temperature=%f,threshold=%d,shutteropentime=%d,shutterclosetime=%d",
clock>=1 ? 0 : 1, clock, (int)self->camera.bin, (int)self->camera.size,
(int)self->camera.gain, flipcmdstr[self->camera.flip],
(int)self->camera.xstart, (int)self->camera.ystart,
(int)self->camera.xend, (int)self->camera.yend, self->camera.exposure,
self->camera.temp, (int)self->camera.thresh, (int)self->camera.shopt,
(int)self->camera.shclt
);
len = strlen(cmd);
self->camera.updatecfg &= ~UPDATE_SETTINGS_CFG;
if (self->debug) {
snprintf(logmsg, MSGLEN, "DEBUG:(camdriv_out:UPDATE_SETTINGS_CFG): cmd=%s\n", cmd);
SICSLogWrite(logmsg, eLog);
}
AsyncUnitSendTxn(self->asyncUnit, cmd, len, cb_shotcmd, self, MSGLEN);
}
if( (self->camera.updatecfg & CLEAR_META_CFG) == CLEAR_META_CFG) {
snprintf(cmd, MSGLEN, "clear meta");
len = strlen(cmd);
if (self->debug) {
snprintf(logmsg, MSGLEN, "DEBUG:(camdriv_out:CLEAR_META_CFG): cmd=%s\n", cmd);
SICSLogWrite(logmsg, eLog);
}
AsyncUnitSendTxn(self->asyncUnit, cmd, len, cb_shotcmd, self, MSGLEN);
}
if( (self->camera.updatecfg & UPDATE_META_CFG) == UPDATE_META_CFG) {
//TODO concatenate the meta_list into a comma separated string and send it in MSGLEN chunks.
for (i=0; i < self->camera.meta_count && pend < MSGLEN; i++) {
pend = sprintf(cmd, "set meta,");
pend += snprintf(&cmd[pend], MSGLEN, "%s", self->camera.meta_list[i]);
len = strlen(cmd);
if (self->debug) {
snprintf(logmsg, MSGLEN, "DEBUG:(camdriv_out:UPDATE_META_CFG): cmd=%s\n", cmd);
SICSLogWrite(logmsg, eLog);
}
AsyncUnitSendTxn(self->asyncUnit, cmd, len, cb_shotcmd, self, MSGLEN);
}
}
if( (self->camera.updatecfg & UPDATE_SCANVAR_CFG) == UPDATE_SCANVAR_CFG) {
pend = sprintf(cmd, "set meta");
//TODO Send in MSGLEN chunks even though the string may never exceed MSGLEN
for (i=0; i < self->camera.scanvar_count && pend < MSGLEN; i++) {
fVal = self->camera.pscanvar[i]->GetValue(self->camera.scanvar_dummy[i], pServ->dummyCon);
pend += snprintf(&cmd[pend], MSGLEN, ",%s=%f", self->camera.scanvar_list[i], fVal);
}
len = strlen(cmd);
if (self->debug) {
snprintf(logmsg, MSGLEN, "DEBUG:(camdriv_out:UPDATE_SCANVAR_CFG): cmd=%s\n", cmd);
SICSLogWrite(logmsg, eLog);
}
AsyncUnitSendTxn(self->asyncUnit, cmd, len, cb_shotcmd, self, MSGLEN);
}
if( (self->camera.updatecfg & UPDATE_FILE_CFG) == UPDATE_FILE_CFG) {
snprintf(cmd, MSGLEN, "set file,path=%s,basename=%s,startnumber=%ld,imageformat=%s,experimentdetail=%s",
self->camera.file.path, self->camera.file.basename, self->camera.file.startnumber, self->camera.file.imageformat,self->camera.file.experimentdetail);
len = strlen(cmd);
if (self->debug) {
snprintf(logmsg, MSGLEN, "DEBUG:(camdriv_out:UPDATE_FILE_CFG): cmd=%s\n", cmd);
SICSLogWrite(logmsg, eLog);
}
AsyncUnitSendTxn(self->asyncUnit, cmd, len, cb_shotcmd, self, MSGLEN);
self->camera.updatecfg &= ~UPDATE_FILE_CFG;
}
break;
default:
snprintf(logmsg, MSGLEN, "CAM:(camdriv_out) Unhandled event %s", event_names[Eo.ca]);
SICSLogWrite(logmsg, eLogError);
return -1;
}
return -1;
}
if (Eo.cm) {
snprintf(logmsg, MSGLEN, "TODO:(camdriv_out:Eo.cm): ev=%s, output=%s\n",
event_names[Eo.cm], event_signatures[Eo.cm]);
SICSLogWrite(logmsg, eLogError);
return -1;
}
if (Eo.cd) {
snprintf(logmsg, MSGLEN, "TODO:(camdriv_out:Eo.cm): ev=%s, output=%s\n",
event_names[Eo.cd], event_signatures[Eo.cd]);
SICSLogWrite(logmsg, eLogError);
return -1;
}
if (Eo.dr) {
/* send msg to SICS */
if (self->debug) {
snprintf(logmsg, MSGLEN, "DEBUG:(camdriv_out): ev=%s, output=%s\n",
event_names[Eo.dr], event_signatures[Eo.dr]);
SICSLogWrite(logmsg, eLog);
}
switch (Eo.dr) {
case EDR_IDLE:
self->status = HWIdle;
@ -682,15 +757,23 @@ int camdriv_out(void *me, event_t Eo) {
default:
snprintf(logmsg, MSGLEN, "CAM:(camdriv_out) Unhandled event %s", event_names[Eo.dr]);
SICSLogWrite(logmsg, eLogError);
return 0;
}
if (self->debug) {
snprintf(logmsg, MSGLEN, "DEBUG:(camdriv_out): ev=%s, output=%s\n",
event_names[Eo.dr], event_signatures[Eo.dr]);
SICSLogWrite(logmsg, eLog);
return -1;
}
return -1;
}
return 1;
if (Eo.cl) {
switch (Eo.cl) {
case ECL_RDY:
return ECL_RDY;
break;
default:
snprintf(logmsg, MSGLEN, "CAM:(camdriv_out) Unhandled event %s", event_names[Eo.cl]);
SICSLogWrite(logmsg, eLogError);
return -1;
}
return -1;
}
return -1;
}
static int cb_state_timer(void *ctx, int mode) {
CamObj *self = (CamObj *) ctx;
@ -715,7 +798,7 @@ static int cb_state_timer(void *ctx, int mode) {
static int cb_getstate(pAsyncTxn txn) {
CamObj *self = (CamObj *) txn->cntx;
char *resp = txn->inp_buf, message[MSGLEN+1];
int len = txn->inp_idx, ret=1, time_rem, time_tot;
int ret=1, time_rem, time_tot;
enum event_codes ca_sym, cm_sym;
@ -727,15 +810,192 @@ static int cb_getstate(pAsyncTxn txn) {
SICSLogWrite(message, eLogError);
ret = 0;
} else {
if (self->debug) {
snprintf(message, MSGLEN, "DEBUG:(cb_getstate) Camera reply: %s", resp);
SICSLogWrite(message, eLog);
}
cm_sym = camera_model(ca_sym);
run_sm(self, cm_sym);
}
return ret;
}
/* Auxiliary Camera Driver commands */
int cmd_code(char **cmd_list, char *cmd) {
int i;
for (i=0; cmd_list[i] != NULL; i++)
if (strcasecmp(cmd_list[i], cmd) == 0)
return i;
return -1;
}
int file_cmd(CamObj *camdriv, SConnection *pCon, char *subcmd, char *data) {
int i, subcmd_code, retval = 1;
long numval;
enum file_subcmd_codes {PATH, BASENAME, IMAGEFMT, STARTNUM, EXPDETAIL};
char *file_subcmd_names[] = {"path", "name", "format", "startnumber", "detail", NULL};
char *glemsg = NULL, emsg[MSGLEN];
if ( (subcmd_code = cmd_code(file_subcmd_names, subcmd)) == -1) {
return 0;
}
switch (subcmd_code) {
case PATH:
snprintf(camdriv->camera.file.path, MSGLEN, "%s", data);
break;
case BASENAME:
snprintf(camdriv->camera.file.basename, MSGLEN, "%s", data);
break;
case STARTNUM:
numval = getlong(data, glemsg);
if (glemsg == NULL) {
camdriv->camera.file.startnumber = numval;
} else if (glemsg == data) {
snprintf(emsg, MSGLEN, "CAM:(file_cmd) %s is not an integer", data);
SCWrite(pCon, emsg, eError);
retval = 0;
} else {
snprintf(emsg, MSGLEN, "CAM:(file_cmd) %s", glemsg);
SCWrite(pCon, emsg, eError);
retval = 0;
}
break;
case IMAGEFMT:
if (strcasecmp(data, "tif") == 0) {
for (i=0; data[i]; i++) {
data[i] = tolower(data[i]);
}
snprintf(camdriv->camera.file.imageformat, IFMTLEN, "%s", data);
} else {
retval = 0;
}
break;
case EXPDETAIL:
snprintf(camdriv->camera.file.experimentdetail, MSGLEN, "%s", data);
break;
default:
retval = 0;
}
return retval;
}
/**
* \brief Auxiliary command interface which gets around type and string length
* limitations of the CountAction command.
*/
int CamAuxCmd(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]) {
char *cmd = NULL;
char message[MSGLEN];
enum auxcmd_codes {CLEAR_META, META, FILECMD, SCANVAR, MOTOR};
char *auxcmd_names[] = {"clearmeta", "meta", "file", "scanvar", "motor", NULL};
int i, code, retval = 1, pend=0;
CamObj *camdriv = (CamObj *)pData;
CommandList *pCom = NULL;
pIDrivable pDriv = NULL;
pDummy pDumData = NULL;
if (argc < 2) {
snprintf(message, MSGLEN, "CAM: You must specify a command");
SCWrite(pCon, message, eError);
return 0;
}
if ( (code = cmd_code(auxcmd_names, argv[1])) == -1 ) {
snprintf(message, MSGLEN, "CAM: %s is not a valid command", argv[1]);
SCWrite(pCon, message, eError);
retval = 0;
goto END;
}
switch (code) {
case CLEAR_META:
camdriv->camera.meta_count = 0;
camdriv->camera.scanvar_count = 0;
camdriv->camera.updatecfg |= CLEAR_META_CFG;
camdriv->camera.updatecfg &= ~UPDATE_META_CFG;
camdriv->camera.updatecfg &= ~UPDATE_SCANVAR_CFG;
break;
case META:
if (argc < 3) {
snprintf(message, MSGLEN, "CAM: Insufficient arguments, the META command requires name=val data");
SCWrite(pCon, message, eError);
retval = 0;
goto END;
}
if (camdriv->camera.meta_count < MAX_META_COUNT) {
for (i=2; i < argc; i++) {
pend += snprintf(&(camdriv->camera.meta_list[camdriv->camera.meta_count][pend]), MSGLEN, "%s ", argv[i]);
}
camdriv->camera.meta_count++;
camdriv->camera.updatecfg |= UPDATE_META_CFG;
} else {
goto END;
}
break;
case SCANVAR:
case MOTOR:
if (argc < 3) {
snprintf(message, MSGLEN, "CAM: Insufficient arguments, the MOTOR/SCANVAR command requires the name of something you can drive like a motor or environment control");
SCWrite(pCon, message, eError);
retval = 0;
goto END;
}
if (camdriv->camera.scanvar_count < MAX_SCANVAR_COUNT) {
pCom = FindCommand(pSics, argv[2]);
if (!pCom) {
snprintf(message, MSGLEN, "CAM: There is no command object for a driveable with this name %s", argv[2]);
SCWrite(pCon, message, eError);
retval = 0;
goto END;
}
pDumData = (pDummy) pCom->pData;
if (!pDumData) {
snprintf(message, MSGLEN, "CAM: There is no data for the command object of a driveable with this name %s", argv[2]);
SCWrite(pCon, message, eError);
retval = 0;
goto END;
}
pDriv = (pIDrivable) pDumData->pDescriptor->GetInterface(pDumData, DRIVEID);
if (!pDriv) {
snprintf(message, MSGLEN, "CAM: %s is not a driveable object", argv[2]);
SCWrite(pCon, message, eError);
retval = 0;
goto END;
}
camdriv->camera.scanvar_dummy[camdriv->camera.scanvar_count] = pDumData;
camdriv->camera.pscanvar[camdriv->camera.scanvar_count] = pDriv;
snprintf(camdriv->camera.scanvar_list[camdriv->camera.scanvar_count++], NAMELEN, "%s", argv[2]);
camdriv->camera.updatecfg |= UPDATE_SCANVAR_CFG;
} else {
snprintf(message, MSGLEN, "CAM: Exceeded maximum number (%d) of driveable objects", MAX_SCANVAR_COUNT);
SCWrite(pCon, message, eError);
retval = 0;
goto END;
}
break;
case FILECMD:
if (argc < 4) {
snprintf(message, MSGLEN, "CAM: Insufficient arguments for the FILE command");
SCWrite(pCon, message, eError);
retval = 0;
goto END;
}
if (file_cmd(camdriv, pCon, argv[2], argv[3]))
camdriv->camera.updatecfg |= UPDATE_FILE_CFG;
else {
snprintf(message, MSGLEN, "CAM: Failed to create camera file configuration");
SCWrite(pCon, message, eError);
retval = 0;
goto END;
}
break;
}
END:
if (cmd != NULL)
free(cmd);
return retval;
}
pCounterDriver CreateCam(SConnection *pCon, char *name, char *asynq) {
char msg[ERRLEN], cmd[MSGLEN], reply[MSGLEN];
int len, reply_len;
char msg[ERRLEN], cmd[MSGLEN], auxcmd[NAMELEN];
int len;
state_t start_state = {.cl=SCL_RDY, .cm=SCM_IDLE, .dr=SDR_IDLE};
pCounterDriver pCntDriv = NULL;
@ -743,6 +1003,7 @@ pCounterDriver CreateCam(SConnection *pCon, char *name, char *asynq) {
pNewCam = (CamObj *) malloc(sizeof(CamObj));
memset(pNewCam, 0, sizeof(CamObj));
pNewCam->pDes = CreateDescriptor("CameraCommandObject");
STset(&pNewCam->state_machine.Sc, start_state);
EVclr(&pNewCam->state_machine.Eo);
pNewCam->state_machine.output_fn = camdriv_out;
@ -751,8 +1012,14 @@ pCounterDriver CreateCam(SConnection *pCon, char *name, char *asynq) {
pNewCam->status = HWIdle;
pNewCam->camError = ENONE;
pNewCam->debug = 1;
pNewCam->camera.updatecfg = 1;
pNewCam->camera.updatecfg = 0;
pNewCam->camera.meta_count = 0;
pNewCam->camera.scanvar_count = 0;
pNewCam->camera.file.startnumber = 1;
snprintf(pNewCam->camera.file.imageformat, IFMTLEN, "tif");
pNewCam->camera.file.experimentdetail[0] = '\0';
pNewCam->asynq = strdup(asynq);
pNewCam->pSics = pServ->pSics;
if (!AsyncUnitCreate(asynq, &pNewCam->asyncUnit)) {
snprintf(msg, ERRLEN, "CAM:AsyncQueue %s has not been defined", asynq);
@ -785,5 +1052,8 @@ pCounterDriver CreateCam(SConnection *pCon, char *name, char *asynq) {
len = strlen(event_signatures[ECA_GET_STATE]);
strncpy(cmd, event_signatures[ECA_GET_STATE], len);
NetWatchRegisterTimerPeriodic(&pNewCam->state_timer, 2000, 500, cb_state_timer, pNewCam);
snprintf(auxcmd, NAMELEN, "%s_cmd", name);
AddCommand(pNewCam->pSics, auxcmd, CamAuxCmd, NULL, pNewCam);
return pCntDriv;
}

View File

@ -17,6 +17,10 @@ config/commands/commands_common.tcl
config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/motors/sct_jogmotor_common.tcl
config/motors/magnet_configuration.tcl

View File

@ -1,5 +1,4 @@
driver astrium_chopper = {
debug_threshold = 2;
vendor = astrium; device = chopper; protocol = std;
class = NXdisk_chopper; simulation_group = chopper_simulation;
@ -108,6 +107,5 @@ driver astrium_chopper = {
%%}
code mkDriver = {%%
hsetprop ${scobj_hpath} debug_threshold 1
%%}
}

View File

@ -210,7 +210,7 @@ proc ::scobj::shutters::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/fast_shutter read_switch_pair ${ns}::read_switch_pair ${scobj_hpath}
hsetprop ${scobj_hpath}/fast_shutter control true
hsetprop ${scobj_hpath}/fast_shutter data true
hsetprop ${scobj_hpath}/fast_shutter mutable false
hsetprop ${scobj_hpath}/fast_shutter mutable true
hsetprop ${scobj_hpath}/fast_shutter nxsave true
hsetprop ${scobj_hpath}/fast_shutter oldval UNKNOWN
hsetprop ${scobj_hpath}/fast_shutter klass "collimator"
@ -226,7 +226,7 @@ proc ::scobj::shutters::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/rough_100 check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/rough_100 control true
hsetprop ${scobj_hpath}/rough_100 data true
hsetprop ${scobj_hpath}/rough_100 mutable false
hsetprop ${scobj_hpath}/rough_100 mutable true
hsetprop ${scobj_hpath}/rough_100 nxsave true
hsetprop ${scobj_hpath}/rough_100 values in,out
hsetprop ${scobj_hpath}/rough_100 oldval UNKNOWN
@ -243,7 +243,7 @@ proc ::scobj::shutters::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/rough_40 check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/rough_40 control true
hsetprop ${scobj_hpath}/rough_40 data true
hsetprop ${scobj_hpath}/rough_40 mutable false
hsetprop ${scobj_hpath}/rough_40 mutable true
hsetprop ${scobj_hpath}/rough_40 nxsave true
hsetprop ${scobj_hpath}/rough_40 values in,out
hsetprop ${scobj_hpath}/rough_40 oldval UNKNOWN
@ -253,7 +253,9 @@ proc ::scobj::shutters::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/rough_40 type "part"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} nxsave "true"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [motor_simulation]] "false"]} {
${sct_controller} poll ${scobj_hpath}/fast_shutter 1
@ -265,6 +267,7 @@ proc ::scobj::shutters::mkDriver { sct_controller name } {
::scobj::shutters::sics_log 9 "[motor_simulation] => No poll/write for shutters"
}
hsetprop ${scobj_hpath} klass instrument
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
# mkDriver hook code ends

View File

@ -221,10 +221,15 @@ proc ::scobj::tank::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/pos mutable true
hsetprop ${scobj_hpath}/pos nxsave true
hsetprop ${scobj_hpath}/pos oldval 0.0
hsetprop ${scobj_hpath}/pos klass "parameter"
hsetprop ${scobj_hpath}/pos sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/pos type "part"
hsetprop ${scobj_hpath}/pos nxalias "${name}_pos"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [motor_simulation]] "false"]} {
${sct_controller} poll ${scobj_hpath}/pos 1
} else {
@ -232,15 +237,19 @@ proc ::scobj::tank::mkDriver { sct_controller name } {
}
hfactory ${scobj_hpath}/limits plain spy none
hsetprop ${scobj_hpath}/limits data "true"
hsetprop ${scobj_hpath}/limits klass "@none"
hsetprop ${scobj_hpath}/limits type "part"
hfactory ${scobj_hpath}/limits/forward plain user text
hsetprop ${scobj_hpath}/limits/forward read ${ns}::getValue ${scobj_hpath} read_switch {MG _LFH}
hsetprop ${scobj_hpath}/limits/forward read_switch ${ns}::read_switch ${scobj_hpath}
hsetprop ${scobj_hpath}/limits/forward control true
hsetprop ${scobj_hpath}/limits/forward data true
hsetprop ${scobj_hpath}/limits/forward mutable false
hsetprop ${scobj_hpath}/limits/forward mutable true
hsetprop ${scobj_hpath}/limits/forward nxsave true
hsetprop ${scobj_hpath}/limits/forward oldval UNKNOWN
hsetprop ${scobj_hpath}/limits/forward klass "parameter"
hsetprop ${scobj_hpath}/limits/forward sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/limits/forward type "part"
hsetprop ${scobj_hpath}/limits/forward nxalias "${name}_limits_forward"
@ -250,9 +259,10 @@ proc ::scobj::tank::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/limits/reverse read_switch ${ns}::read_switch ${scobj_hpath}
hsetprop ${scobj_hpath}/limits/reverse control true
hsetprop ${scobj_hpath}/limits/reverse data true
hsetprop ${scobj_hpath}/limits/reverse mutable false
hsetprop ${scobj_hpath}/limits/reverse mutable true
hsetprop ${scobj_hpath}/limits/reverse nxsave true
hsetprop ${scobj_hpath}/limits/reverse oldval UNKNOWN
hsetprop ${scobj_hpath}/limits/reverse klass "parameter"
hsetprop ${scobj_hpath}/limits/reverse sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/limits/reverse type "part"
hsetprop ${scobj_hpath}/limits/reverse nxalias "${name}_limits_reverse"
@ -265,15 +275,19 @@ proc ::scobj::tank::mkDriver { sct_controller name } {
}
hfactory ${scobj_hpath}/switches plain spy none
hsetprop ${scobj_hpath}/switches data "true"
hsetprop ${scobj_hpath}/switches klass "@none"
hsetprop ${scobj_hpath}/switches type "part"
hfactory ${scobj_hpath}/switches/forward plain user text
hsetprop ${scobj_hpath}/switches/forward read ${ns}::getValue ${scobj_hpath} read_switch {MG @IN[5]}
hsetprop ${scobj_hpath}/switches/forward read_switch ${ns}::read_switch ${scobj_hpath}
hsetprop ${scobj_hpath}/switches/forward control true
hsetprop ${scobj_hpath}/switches/forward data true
hsetprop ${scobj_hpath}/switches/forward mutable false
hsetprop ${scobj_hpath}/switches/forward mutable true
hsetprop ${scobj_hpath}/switches/forward nxsave true
hsetprop ${scobj_hpath}/switches/forward oldval UNKNOWN
hsetprop ${scobj_hpath}/switches/forward klass "parameter"
hsetprop ${scobj_hpath}/switches/forward sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/switches/forward type "part"
hsetprop ${scobj_hpath}/switches/forward nxalias "${name}_switches_forward"
@ -283,9 +297,10 @@ proc ::scobj::tank::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/switches/reverse read_switch ${ns}::read_switch ${scobj_hpath}
hsetprop ${scobj_hpath}/switches/reverse control true
hsetprop ${scobj_hpath}/switches/reverse data true
hsetprop ${scobj_hpath}/switches/reverse mutable false
hsetprop ${scobj_hpath}/switches/reverse mutable true
hsetprop ${scobj_hpath}/switches/reverse nxsave true
hsetprop ${scobj_hpath}/switches/reverse oldval UNKNOWN
hsetprop ${scobj_hpath}/switches/reverse klass "parameter"
hsetprop ${scobj_hpath}/switches/reverse sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/switches/reverse type "part"
hsetprop ${scobj_hpath}/switches/reverse nxalias "${name}_switches_reverse"
@ -297,6 +312,7 @@ proc ::scobj::tank::mkDriver { sct_controller name } {
::scobj::tank::sics_log 9 "[motor_simulation] => No poll/write for tank"
}
hsetprop ${scobj_hpath} klass instrument
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
::utility::mkVar vessel_y float user vessel_y true instrument true true

View File

@ -16,14 +16,14 @@ proc SetVolt {volt} {
PulserOff
} else {
set pulservolt [VoltScale $volt]
pulser send "VOLT:OFFS $pulservolt; OFFS?"
sct_pulser send "VOLT:OFFS $pulservolt; OFFS?"
PulserDC $pulservolt
PulserOn
}
}
proc GetVolt {} {
pulser transact VOLT:OFFS?
sct_pulser transact VOLT:OFFS?
}
proc SingleVolt {volt oscno} {
@ -33,7 +33,7 @@ proc SingleVolt {volt oscno} {
PulserOff
} else {
set pulservolt [VoltScale $volt]
pulser send "VOLT:OFFS $pulservolt; OFFS?"
sct_pulser send "VOLT:OFFS $pulservolt; OFFS?"
pulserDC $pulservolt
PulserOn
}
@ -47,7 +47,7 @@ proc SetDC {} {
pulseroff
#NOTE: Setting FUNC DC generates a remote ctrl error if the
# burst mode happens to be on
set resp [pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 0; OFFS?"]
set resp [sct_pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 0; OFFS?"]
pulseron
}
@ -187,7 +187,7 @@ proc SquarePulseVolt {start step fin freq bins oscno} {
set pulservolt [VoltScale $j]
PulserSquare $freq $pulservolt
PulserOn
# pulser send "APPL:SQU $freq,$pulservolt,0"
# sct_pulser send "APPL:SQU $freq,$pulservolt,0"
}
oscmd start $oscno
hmm countblock
@ -208,7 +208,7 @@ proc SquarePulseFreq {volt freqlist bins oscno} {
wait 3
PulserSquare $freq $pulservolt
PulserOn
# pulser send "APPL:SQU $freq,$pulservolt,0"
# sct_pulser send "APPL:SQU $freq,$pulservolt,0"
oscmd start $oscno
hmm countblock
save $i
@ -270,7 +270,7 @@ proc UniPulseFreq {volt freqlist bins oscno} {
set pulseroffs [VoltScale [expr {$volt*0.5}]]
PulserSquareOffs $freq $pulservolt $pulseroffs
PulserOn
# pulser send "APPL:SQU $freq,$pulservolt,[expr {$pulservolt/2}]"
# sct_pulser send "APPL:SQU $freq,$pulservolt,[expr {$pulservolt/2}]"
oscmd start $oscno
hmm countblock
save $i
@ -305,13 +305,13 @@ proc UniPulseFatigue {volt freq bins oscno reps runs} {
proc PulserBurst {} {
pulser send "BURS:MODE TRIG; MODE?"
pulser send "TRIG:SOUR BUS; SOUR?"
pulser send "BURS:STAT ON; STAT?"
sct_pulser send "BURS:MODE TRIG; MODE?"
sct_pulser send "TRIG:SOUR BUS; SOUR?"
sct_pulser send "BURS:STAT ON; STAT?"
PulserOn
pulser send "*TRG;:BURS:NCYC?"
sct_pulser send "*TRG;:BURS:NCYC?"
while {1} {
set sval [pulser transact *OPC?]
set sval [sct_pulser transact *OPC?]
if {[string first 1 $sval] >-1} {break}
}
PulserOff
@ -322,11 +322,11 @@ proc PulserBurst {} {
proc VoltPulseRun {vlo vhi freq cycl} {
PulserOff
pulser send "VOLT:LOW [VoltScale $vlo]; LOW?"
pulser send "VOLT:HIGH [VoltScale $vhi]; HIGH?"
pulser send "FREQ $freq;:FREQ?"
pulser send "BURS:PHAS [expr {90.0 - ($vhi*180.0)/(($vhi-$vlo)*1.0)}]; PHAS?"
pulser send "BURS:MODE TRIG; MODE?"
sct_pulser send "VOLT:LOW [VoltScale $vlo]; LOW?"
sct_pulser send "VOLT:HIGH [VoltScale $vhi]; HIGH?"
sct_pulser send "FREQ $freq;:FREQ?"
sct_pulser send "BURS:PHAS [expr {90.0 - ($vhi*180.0)/(($vhi-$vlo)*1.0)}]; PHAS?"
sct_pulser send "BURS:MODE TRIG; MODE?"
set ploop [expr {int($cycl/50000)}]
set prem [expr {$cycl % 50000}]
if {$ploop >0} {
@ -335,45 +335,45 @@ proc VoltPulseRun {vlo vhi freq cycl} {
PulserBurst
}
}
pulser send "BURS:NCYC $prem; NCYC?"
sct_pulser send "BURS:NCYC $prem; NCYC?"
PulserBurst
PulserOff
pulser send "BURS:STAT OFF; STAT?"
sct_pulser send "BURS:STAT OFF; STAT?"
}
proc VoltPulses {vlo vhi freq cycl} {
PulserOff
pulser send "FUNC SQU;:FUNC?"
sct_pulser send "FUNC SQU;:FUNC?"
VoltPulseRun $vlo $vhi $freq $cycl
}
proc VoltTriPulses {vlo vhi freq cycl} {
PulserOff
pulser send "FUNC RAMP;:FUNC?"
pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?"
sct_pulser send "FUNC RAMP;:FUNC?"
sct_pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?"
VoltPulseRun $vlo $vhi $freq $cycl
}
proc OneTri {volt period} {
PulserOff
if {$volt > 0} {
pulser send "VOLT:LOW 0; LOW?"
pulser send "VOLT:HIGH [VoltScale $volt]; HIGH?"
pulser send "BURS:PHAS -90; PHAS?"
sct_pulser send "VOLT:LOW 0; LOW?"
sct_pulser send "VOLT:HIGH [VoltScale $volt]; HIGH?"
sct_pulser send "BURS:PHAS -90; PHAS?"
} else {
pulser send "VOLT:LOW [VoltScale $volt]; LOW?"
pulser send "VOLT:HIGH 0; HIGH?"
pulser send "BURS:PHAS 90; PHAS?"
sct_pulser send "VOLT:LOW [VoltScale $volt]; LOW?"
sct_pulser send "VOLT:HIGH 0; HIGH?"
sct_pulser send "BURS:PHAS 90; PHAS?"
}
pulser send "FUNC RAMP;:FUNC?"
pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?"
pulser send "FREQ [expr {1.0/$period}];:FREQ?"
sct_pulser send "FUNC RAMP;:FUNC?"
sct_pulser send "FUNC:RAMP:SYMM 50;:FUNC:RAMP:SYMM?"
sct_pulser send "FREQ [expr {1.0/$period}];:FREQ?"
pulser send "BURS:MODE TRIG; MODE?"
sct_pulser send "BURS:MODE TRIG; MODE?"
pulser send "BURS:NCYC 1; NCYC?"
sct_pulser send "BURS:NCYC 1; NCYC?"
PulserBurst
PulserOff
}

View File

@ -1,10 +1,10 @@
proc PulserOn {} {
pulser send "OUTP ON;:OUTP?"
sct_pulser send "OUTP ON;:OUTP?"
}
proc PulserOff {} {
pulser send "OUTP OFF;:OUTP?"
sct_pulser send "OUTP OFF;:OUTP?"
}
@ -12,41 +12,41 @@ proc PulserTTLOn {} {
#NOTE: Setting FUNC DC generates a remote ctrl error if the
# burst mode happens to be on
# Set 5.2 Volts to get about 5.1. (5 actually gives 4.8)
pulser send "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 5.2; OFFS?"
sct_pulser send "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS 5.2; OFFS?"
PulserOn
}
proc PulserSin {Freq Volt} {
set resp [pulser transact FUNC?]
set resp [sct_pulser transact FUNC?]
if {[string first "SIN" $resp ] == -1 } {
pulser send "FUNC SIN;:FUNC?"
sct_pulser send "FUNC SIN;:FUNC?"
}
pulser send "VOLT $Volt;:VOLT?"
pulser send "FREQ $Freq;:FREQ?"
pulser send "VOLT:OFFS 0; OFFS?"
sct_pulser send "VOLT $Volt;:VOLT?"
sct_pulser send "FREQ $Freq;:FREQ?"
sct_pulser send "VOLT:OFFS 0; OFFS?"
}
proc PulserSquare {Freq Volt} {
set resp [pulser transact FUNC?]
set resp [sct_pulser transact FUNC?]
if {[string first "SQU" $resp ] == -1 } {
pulser send "FUNC SQU;:FUNC?"
sct_pulser send "FUNC SQU;:FUNC?"
}
pulser send "VOLT $Volt;:VOLT?"
pulser send "FREQ $Freq;:FREQ?"
pulser send "VOLT:OFFS 0; OFFS?"
sct_pulser send "VOLT $Volt;:VOLT?"
sct_pulser send "FREQ $Freq;:FREQ?"
sct_pulser send "VOLT:OFFS 0; OFFS?"
}
proc PulserSquareOffs {Freq Volt Offs} {
set resp [pulser transact FUNC?]
set resp [sct_pulser transact FUNC?]
if {[string first "SQU" $resp ] == -1 } {
pulser send "FUNC SQU;:FUNC?"
sct_pulser send "FUNC SQU;:FUNC?"
}
pulser send "VOLT $Volt;:VOLT?"
pulser send "FREQ $Freq;:FREQ?"
pulser send "VOLT:OFFS $Offs; OFFS?"
sct_pulser send "VOLT $Volt;:VOLT?"
sct_pulser send "FREQ $Freq;:FREQ?"
sct_pulser send "VOLT:OFFS $Offs; OFFS?"
}
@ -54,7 +54,7 @@ proc PulserSquareOffs {Freq Volt Offs} {
proc PulserDC {Volt} {
#NOTE: Setting FUNC DC generates a remote ctrl error if the
# burst mode happens to be on
set resp [pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS $Volt; OFFS?"]
set resp [sct_pulser transact "BURS:STAT OFF;:FUNC DC;:VOLT:OFFS $Volt; OFFS?"]
broadcast $resp
}

View File

@ -39,6 +39,7 @@ proc ::scobj::agilent_33220A::mkDriver { sct_controller name } {
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
makesctcontroller $name $ip $port

View File

@ -765,7 +765,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/enabled check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/enabled control true
hsetprop ${scobj_hpath}/enabled data true
hsetprop ${scobj_hpath}/enabled mutable false
hsetprop ${scobj_hpath}/enabled mutable true
hsetprop ${scobj_hpath}/enabled nxsave true
hsetprop ${scobj_hpath}/enabled values 0,1
hsetprop ${scobj_hpath}/enabled permlink data_set "G[format "%02d" ${id}]X02"
@ -779,7 +779,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hfactory ${scobj_hpath}/flow1 plain user float
hsetprop ${scobj_hpath}/flow1 control false
hsetprop ${scobj_hpath}/flow1 data false
hsetprop ${scobj_hpath}/flow1 mutable false
hsetprop ${scobj_hpath}/flow1 mutable true
hsetprop ${scobj_hpath}/flow1 nxsave false
hsetprop ${scobj_hpath}/flow1 oldval 0.0
hsetprop ${scobj_hpath}/flow1 klass "environment"
@ -790,7 +790,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hfactory ${scobj_hpath}/flow2 plain user float
hsetprop ${scobj_hpath}/flow2 control false
hsetprop ${scobj_hpath}/flow2 data false
hsetprop ${scobj_hpath}/flow2 mutable false
hsetprop ${scobj_hpath}/flow2 mutable true
hsetprop ${scobj_hpath}/flow2 nxsave false
hsetprop ${scobj_hpath}/flow2 oldval 0.0
hsetprop ${scobj_hpath}/flow2 klass "environment"
@ -801,7 +801,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hfactory ${scobj_hpath}/flow3 plain user float
hsetprop ${scobj_hpath}/flow3 control false
hsetprop ${scobj_hpath}/flow3 data false
hsetprop ${scobj_hpath}/flow3 mutable false
hsetprop ${scobj_hpath}/flow3 mutable true
hsetprop ${scobj_hpath}/flow3 nxsave false
hsetprop ${scobj_hpath}/flow3 oldval 0.0
hsetprop ${scobj_hpath}/flow3 klass "environment"
@ -812,7 +812,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hfactory ${scobj_hpath}/gas_factor plain user float
hsetprop ${scobj_hpath}/gas_factor control true
hsetprop ${scobj_hpath}/gas_factor data true
hsetprop ${scobj_hpath}/gas_factor mutable false
hsetprop ${scobj_hpath}/gas_factor mutable true
hsetprop ${scobj_hpath}/gas_factor nxsave true
hsetprop ${scobj_hpath}/gas_factor oldval 1.0
hset ${scobj_hpath}/gas_factor 1.0
@ -824,7 +824,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hfactory ${scobj_hpath}/temperature plain user float
hsetprop ${scobj_hpath}/temperature control false
hsetprop ${scobj_hpath}/temperature data false
hsetprop ${scobj_hpath}/temperature mutable false
hsetprop ${scobj_hpath}/temperature mutable true
hsetprop ${scobj_hpath}/temperature nxsave false
hsetprop ${scobj_hpath}/temperature oldval 0.0
hsetprop ${scobj_hpath}/temperature klass "environment"
@ -833,7 +833,9 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/temperature nxalias "${name}_temperature"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} nxsave "true"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
${sct_controller} poll ${scobj_hpath}/enabled 10
@ -843,13 +845,16 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
}
hfactory ${scobj_hpath}/analog plain spy none
hsetprop ${scobj_hpath}/analog data "false"
hsetprop ${scobj_hpath}/analog klass "@none"
hsetprop ${scobj_hpath}/analog type "part"
hfactory ${scobj_hpath}/analog/ansto_temp plain user float
hsetprop ${scobj_hpath}/analog/ansto_temp read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,12}
hsetprop ${scobj_hpath}/analog/ansto_temp read_sixteen ${ns}::read_sixteen ${scobj_hpath}
hsetprop ${scobj_hpath}/analog/ansto_temp control false
hsetprop ${scobj_hpath}/analog/ansto_temp data false
hsetprop ${scobj_hpath}/analog/ansto_temp mutable false
hsetprop ${scobj_hpath}/analog/ansto_temp mutable true
hsetprop ${scobj_hpath}/analog/ansto_temp nxsave false
hsetprop ${scobj_hpath}/analog/ansto_temp oldval 0.0
hsetprop ${scobj_hpath}/analog/ansto_temp base "0"
@ -863,7 +868,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/analog/pv1 read_sixteen ${ns}::read_sixteen ${scobj_hpath}
hsetprop ${scobj_hpath}/analog/pv1 control false
hsetprop ${scobj_hpath}/analog/pv1 data false
hsetprop ${scobj_hpath}/analog/pv1 mutable false
hsetprop ${scobj_hpath}/analog/pv1 mutable true
hsetprop ${scobj_hpath}/analog/pv1 nxsave false
hsetprop ${scobj_hpath}/analog/pv1 oldval 0.0
hsetprop ${scobj_hpath}/analog/pv1 base "0"
@ -877,7 +882,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/analog/pv2 read_sixteen ${ns}::read_sixteen ${scobj_hpath}
hsetprop ${scobj_hpath}/analog/pv2 control false
hsetprop ${scobj_hpath}/analog/pv2 data false
hsetprop ${scobj_hpath}/analog/pv2 mutable false
hsetprop ${scobj_hpath}/analog/pv2 mutable true
hsetprop ${scobj_hpath}/analog/pv2 nxsave false
hsetprop ${scobj_hpath}/analog/pv2 oldval 0.0
hsetprop ${scobj_hpath}/analog/pv2 base "0"
@ -891,7 +896,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/analog/pv3 read_sixteen ${ns}::read_sixteen ${scobj_hpath}
hsetprop ${scobj_hpath}/analog/pv3 control false
hsetprop ${scobj_hpath}/analog/pv3 data false
hsetprop ${scobj_hpath}/analog/pv3 mutable false
hsetprop ${scobj_hpath}/analog/pv3 mutable true
hsetprop ${scobj_hpath}/analog/pv3 nxsave false
hsetprop ${scobj_hpath}/analog/pv3 oldval 0.0
hsetprop ${scobj_hpath}/analog/pv3 base "0"
@ -905,7 +910,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/analog/rhsense read_sixteen ${ns}::read_sixteen ${scobj_hpath}
hsetprop ${scobj_hpath}/analog/rhsense control false
hsetprop ${scobj_hpath}/analog/rhsense data false
hsetprop ${scobj_hpath}/analog/rhsense mutable false
hsetprop ${scobj_hpath}/analog/rhsense mutable true
hsetprop ${scobj_hpath}/analog/rhsense nxsave false
hsetprop ${scobj_hpath}/analog/rhsense oldval 0.0
hsetprop ${scobj_hpath}/analog/rhsense base "0"
@ -919,7 +924,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/analog/rhtemp read_sixteen ${ns}::read_sixteen ${scobj_hpath}
hsetprop ${scobj_hpath}/analog/rhtemp control false
hsetprop ${scobj_hpath}/analog/rhtemp data false
hsetprop ${scobj_hpath}/analog/rhtemp mutable false
hsetprop ${scobj_hpath}/analog/rhtemp mutable true
hsetprop ${scobj_hpath}/analog/rhtemp nxsave false
hsetprop ${scobj_hpath}/analog/rhtemp oldval 0.0
hsetprop ${scobj_hpath}/analog/rhtemp base "0"
@ -936,7 +941,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/analog/sp1 check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/analog/sp1 control false
hsetprop ${scobj_hpath}/analog/sp1 data false
hsetprop ${scobj_hpath}/analog/sp1 mutable false
hsetprop ${scobj_hpath}/analog/sp1 mutable true
hsetprop ${scobj_hpath}/analog/sp1 nxsave false
hsetprop ${scobj_hpath}/analog/sp1 oldval 0.0
hsetprop ${scobj_hpath}/analog/sp1 base "0"
@ -953,7 +958,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/analog/sp2 check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/analog/sp2 control false
hsetprop ${scobj_hpath}/analog/sp2 data false
hsetprop ${scobj_hpath}/analog/sp2 mutable false
hsetprop ${scobj_hpath}/analog/sp2 mutable true
hsetprop ${scobj_hpath}/analog/sp2 nxsave false
hsetprop ${scobj_hpath}/analog/sp2 oldval 0.0
hsetprop ${scobj_hpath}/analog/sp2 base "0"
@ -970,7 +975,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/analog/sp3 check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/analog/sp3 control false
hsetprop ${scobj_hpath}/analog/sp3 data false
hsetprop ${scobj_hpath}/analog/sp3 mutable false
hsetprop ${scobj_hpath}/analog/sp3 mutable true
hsetprop ${scobj_hpath}/analog/sp3 nxsave false
hsetprop ${scobj_hpath}/analog/sp3 oldval 0.0
hsetprop ${scobj_hpath}/analog/sp3 base "0"
@ -998,7 +1003,9 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hfactory ${scobj_hpath}/flow plain spy none
hsetprop ${scobj_hpath}/flow data "true"
hsetprop ${scobj_hpath}/flow klass "@none"
hsetprop ${scobj_hpath}/flow nxsave "true"
hsetprop ${scobj_hpath}/flow type "part"
hfactory ${scobj_hpath}/flow/sensor plain user float
hsetprop ${scobj_hpath}/flow/sensor read ${ns}::fetch_flow ${scobj_hpath} read_flow {None}
@ -1056,7 +1063,9 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
hfactory ${scobj_hpath}/humidity plain spy none
hsetprop ${scobj_hpath}/humidity data "true"
hsetprop ${scobj_hpath}/humidity klass "@none"
hsetprop ${scobj_hpath}/humidity nxsave "true"
hsetprop ${scobj_hpath}/humidity type "part"
hfactory ${scobj_hpath}/humidity/sensor plain user float
hsetprop ${scobj_hpath}/humidity/sensor read ${ns}::getValue ${scobj_hpath} read_all_data {?ALL DATA}
@ -1112,6 +1121,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name id } {
::scobj::hiden_xcs::sics_log 9 "[environment_simulation] => No poll/write for hiden_xcs"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_flow_setpoint ${scobj_hpath}/flow/setpoint ${scobj_hpath}/flow/sensor ${sct_controller}

View File

@ -2,7 +2,6 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent
#
driver huber_pilot = {
debug_threshold = 1;
vendor = Huber; device = 'Pilot ONE'; protocol = std;
class = environment;
simulation_group = environment_simulation;

View File

@ -3,7 +3,7 @@
#
namespace eval ::scobj::huber_pilot {
set debug_threshold 1
set debug_threshold 5
if { ![info exists ::scobj::permlink_device_counter]} {
set ::scobj::permlink_device_counter 0
}
@ -302,6 +302,9 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name } {
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/Loop1 plain spy none
hsetprop ${scobj_hpath}/Loop1 data "true"
hsetprop ${scobj_hpath}/Loop1 klass "@none"
hsetprop ${scobj_hpath}/Loop1 type "part"
hfactory ${scobj_hpath}/Loop1/sensor_int plain user float
hsetprop ${scobj_hpath}/Loop1/sensor_int read ${ns}::getValue ${scobj_hpath} rdTemp {01}
@ -313,6 +316,7 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/Loop1/sensor_int permlink data_set "T${permlink_device_number}S01"
hsetprop ${scobj_hpath}/Loop1/sensor_int @description "T${permlink_device_number}S01"
hsetprop ${scobj_hpath}/Loop1/sensor_int oldval 0.0
hsetprop ${scobj_hpath}/Loop1/sensor_int klass "parameter"
hsetprop ${scobj_hpath}/Loop1/sensor_int sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/sensor_int type "part"
hsetprop ${scobj_hpath}/Loop1/sensor_int nxalias "${name}_Loop1_sensor_int"
@ -338,6 +342,7 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/Loop1/setpoint permlink data_set "T${permlink_device_number}SP01"
hsetprop ${scobj_hpath}/Loop1/setpoint @description "T${permlink_device_number}SP01"
hsetprop ${scobj_hpath}/Loop1/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop1/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop1/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/setpoint settle_time "10"
hsetprop ${scobj_hpath}/Loop1/setpoint type "drivable"
@ -351,6 +356,7 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/Loop1/vMaxSP mutable true
hsetprop ${scobj_hpath}/Loop1/vMaxSP nxsave true
hsetprop ${scobj_hpath}/Loop1/vMaxSP oldval 0.0
hsetprop ${scobj_hpath}/Loop1/vMaxSP klass "parameter"
hsetprop ${scobj_hpath}/Loop1/vMaxSP sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/vMaxSP type "part"
hsetprop ${scobj_hpath}/Loop1/vMaxSP nxalias "${name}_Loop1_vMaxSP"
@ -363,6 +369,7 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/Loop1/vMinSP mutable true
hsetprop ${scobj_hpath}/Loop1/vMinSP nxsave true
hsetprop ${scobj_hpath}/Loop1/vMinSP oldval 0.0
hsetprop ${scobj_hpath}/Loop1/vMinSP klass "parameter"
hsetprop ${scobj_hpath}/Loop1/vMinSP sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/vMinSP type "part"
hsetprop ${scobj_hpath}/Loop1/vMinSP nxalias "${name}_Loop1_vMinSP"
@ -377,6 +384,7 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/Loop1/vTE permlink data_set "T${permlink_device_number}S07"
hsetprop ${scobj_hpath}/Loop1/vTE @description "T${permlink_device_number}S07"
hsetprop ${scobj_hpath}/Loop1/vTE oldval 0.0
hsetprop ${scobj_hpath}/Loop1/vTE klass "parameter"
hsetprop ${scobj_hpath}/Loop1/vTE sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/vTE type "part"
hsetprop ${scobj_hpath}/Loop1/vTE nxalias "${name}_Loop1_vTE"
@ -389,6 +397,7 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/Loop1/vTmpActive mutable true
hsetprop ${scobj_hpath}/Loop1/vTmpActive nxsave true
hsetprop ${scobj_hpath}/Loop1/vTmpActive oldval 0
hsetprop ${scobj_hpath}/Loop1/vTmpActive klass "parameter"
hsetprop ${scobj_hpath}/Loop1/vTmpActive sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/vTmpActive type "part"
hsetprop ${scobj_hpath}/Loop1/vTmpActive nxalias "${name}_Loop1_vTmpActive"
@ -401,6 +410,7 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/Loop1/vTmpMode mutable true
hsetprop ${scobj_hpath}/Loop1/vTmpMode nxsave true
hsetprop ${scobj_hpath}/Loop1/vTmpMode oldval 0
hsetprop ${scobj_hpath}/Loop1/vTmpMode klass "parameter"
hsetprop ${scobj_hpath}/Loop1/vTmpMode sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/vTmpMode type "part"
hsetprop ${scobj_hpath}/Loop1/vTmpMode nxalias "${name}_Loop1_vTmpMode"
@ -418,7 +428,8 @@ proc ::scobj::huber_pilot::mkDriver { sct_controller name } {
::scobj::huber_pilot::sics_log 9 "[environment_simulation] => No poll/write for huber_pilot"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} debug_threshold 1
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_Loop1_setpoint ${scobj_hpath}/Loop1/setpoint ${scobj_hpath}/Loop1/sensor_int ${sct_controller}
}

View File

@ -261,6 +261,7 @@ proc ::scobj::isotech_ps::mkDriver { sct_controller name } {
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"
@ -276,6 +277,7 @@ proc ::scobj::isotech_ps::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/relay mutable true
hsetprop ${scobj_hpath}/relay nxsave true
hsetprop ${scobj_hpath}/relay oldval 0
hsetprop ${scobj_hpath}/relay klass "parameter"
hsetprop ${scobj_hpath}/relay sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/relay type "part"
hsetprop ${scobj_hpath}/relay nxalias "${name}_relay"
@ -292,10 +294,15 @@ proc ::scobj::isotech_ps::mkDriver { sct_controller name } {
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"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
${sct_controller} poll ${scobj_hpath}/amps 5
${sct_controller} poll ${scobj_hpath}/relay 5
@ -306,6 +313,7 @@ proc ::scobj::isotech_ps::mkDriver { sct_controller name } {
::scobj::isotech_ps::sics_log 9 "[environment_simulation] => No poll/write for isotech_ps"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code goes here
} catch_message ]

View File

@ -39,6 +39,7 @@ proc ::scobj::keithley_m2700::mkDriver { sct_controller name id datype tol } {
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
mk_sct_keithley_2700 $sct_controller environment $name $tol $id $datype

View File

@ -569,14 +569,14 @@ proc ::scobj::oxford_labview::read_config {} {
}
}
set arg_list [list]
foreach arg {interval} {
if {[dict exists $v $arg]} {
lappend arg_list "[dict get $v $arg]"
} else {
${ns}::sics_log 9 "Missing configuration value $arg"
error "Missing configuration value $arg"
}
}
# foreach arg {interval} {
# if {[dict exists $v $arg]} {
# lappend arg_list "[dict get $v $arg]"
# } else {
# ${ns}::sics_log 9 "Missing configuration value $arg"
# error "Missing configuration value $arg"
# }
# }
${ns}::sics_log 9 "add_oxford_labview ${name} aqadapter ${asyncqueue} {*}$arg_list"
add_oxford_labview ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}

View File

@ -317,6 +317,8 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath} control "true"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
${sct_controller} write ${scobj_hpath}/setpoint
@ -325,13 +327,16 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
}
hfactory ${scobj_hpath}/a plain spy none
hsetprop ${scobj_hpath}/a data "false"
hsetprop ${scobj_hpath}/a klass "@none"
hsetprop ${scobj_hpath}/a type "part"
hfactory ${scobj_hpath}/a/G plain user text
hsetprop ${scobj_hpath}/a/G read ${ns}::getValue ${scobj_hpath} rdValue {G}
hsetprop ${scobj_hpath}/a/G rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/a/G control false
hsetprop ${scobj_hpath}/a/G data false
hsetprop ${scobj_hpath}/a/G mutable false
hsetprop ${scobj_hpath}/a/G mutable true
hsetprop ${scobj_hpath}/a/G nxsave true
hsetprop ${scobj_hpath}/a/G oldval UNKNOWN
hsetprop ${scobj_hpath}/a/G offset "16.116"
@ -344,7 +349,7 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/a/J rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/a/J control false
hsetprop ${scobj_hpath}/a/J data false
hsetprop ${scobj_hpath}/a/J mutable false
hsetprop ${scobj_hpath}/a/J mutable true
hsetprop ${scobj_hpath}/a/J nxsave true
hsetprop ${scobj_hpath}/a/J oldval UNKNOWN
hsetprop ${scobj_hpath}/a/J sdsinfo "::nexus::scobj::sdsinfo"
@ -356,7 +361,7 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/a/K rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/a/K control false
hsetprop ${scobj_hpath}/a/K data false
hsetprop ${scobj_hpath}/a/K mutable false
hsetprop ${scobj_hpath}/a/K mutable true
hsetprop ${scobj_hpath}/a/K nxsave true
hsetprop ${scobj_hpath}/a/K oldval UNKNOWN
hsetprop ${scobj_hpath}/a/K sdsinfo "::nexus::scobj::sdsinfo"
@ -368,7 +373,7 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/a/N rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/a/N control false
hsetprop ${scobj_hpath}/a/N data false
hsetprop ${scobj_hpath}/a/N mutable false
hsetprop ${scobj_hpath}/a/N mutable true
hsetprop ${scobj_hpath}/a/N nxsave true
hsetprop ${scobj_hpath}/a/N oldval UNKNOWN
hsetprop ${scobj_hpath}/a/N sdsinfo "::nexus::scobj::sdsinfo"
@ -380,7 +385,7 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/a/O rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/a/O control false
hsetprop ${scobj_hpath}/a/O data false
hsetprop ${scobj_hpath}/a/O mutable false
hsetprop ${scobj_hpath}/a/O mutable true
hsetprop ${scobj_hpath}/a/O nxsave true
hsetprop ${scobj_hpath}/a/O oldval UNKNOWN
hsetprop ${scobj_hpath}/a/O sdsinfo "::nexus::scobj::sdsinfo"
@ -392,7 +397,7 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/a/S rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/a/S control false
hsetprop ${scobj_hpath}/a/S data false
hsetprop ${scobj_hpath}/a/S mutable false
hsetprop ${scobj_hpath}/a/S mutable true
hsetprop ${scobj_hpath}/a/S nxsave true
hsetprop ${scobj_hpath}/a/S oldval UNKNOWN
hsetprop ${scobj_hpath}/a/S sdsinfo "::nexus::scobj::sdsinfo"
@ -411,6 +416,9 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
}
hfactory ${scobj_hpath}/b plain spy none
hsetprop ${scobj_hpath}/b data "true"
hsetprop ${scobj_hpath}/b klass "@none"
hsetprop ${scobj_hpath}/b type "part"
hfactory ${scobj_hpath}/b/Lower plain user float
hsetprop ${scobj_hpath}/b/Lower write ${ns}::setValue ${scobj_hpath} noResponse {L}
@ -418,11 +426,12 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/b/Lower check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/b/Lower control true
hsetprop ${scobj_hpath}/b/Lower data true
hsetprop ${scobj_hpath}/b/Lower mutable false
hsetprop ${scobj_hpath}/b/Lower mutable true
hsetprop ${scobj_hpath}/b/Lower nxsave true
hsetprop ${scobj_hpath}/b/Lower lowerlimit 0
hsetprop ${scobj_hpath}/b/Lower upperlimit 2
hsetprop ${scobj_hpath}/b/Lower oldval 0.0
hsetprop ${scobj_hpath}/b/Lower klass "parameter"
hsetprop ${scobj_hpath}/b/Lower sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/b/Lower type "part"
hsetprop ${scobj_hpath}/b/Lower units "A"
@ -434,12 +443,13 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/b/Pause check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/b/Pause control true
hsetprop ${scobj_hpath}/b/Pause data true
hsetprop ${scobj_hpath}/b/Pause mutable false
hsetprop ${scobj_hpath}/b/Pause mutable true
hsetprop ${scobj_hpath}/b/Pause nxsave true
hsetprop ${scobj_hpath}/b/Pause lowerlimit 0
hsetprop ${scobj_hpath}/b/Pause upperlimit 1
hsetprop ${scobj_hpath}/b/Pause values 0,1
hsetprop ${scobj_hpath}/b/Pause oldval 0
hsetprop ${scobj_hpath}/b/Pause klass "parameter"
hsetprop ${scobj_hpath}/b/Pause sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/b/Pause type "part"
hsetprop ${scobj_hpath}/b/Pause nxalias "${name}_b_Pause"
@ -450,12 +460,13 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/b/Ramp check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/b/Ramp control true
hsetprop ${scobj_hpath}/b/Ramp data true
hsetprop ${scobj_hpath}/b/Ramp mutable false
hsetprop ${scobj_hpath}/b/Ramp mutable true
hsetprop ${scobj_hpath}/b/Ramp nxsave true
hsetprop ${scobj_hpath}/b/Ramp lowerlimit 0
hsetprop ${scobj_hpath}/b/Ramp upperlimit 1
hsetprop ${scobj_hpath}/b/Ramp values 0,1
hsetprop ${scobj_hpath}/b/Ramp oldval 0
hsetprop ${scobj_hpath}/b/Ramp klass "parameter"
hsetprop ${scobj_hpath}/b/Ramp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/b/Ramp type "part"
hsetprop ${scobj_hpath}/b/Ramp nxalias "${name}_b_Ramp"
@ -466,9 +477,10 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/b/Rate check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/b/Rate control true
hsetprop ${scobj_hpath}/b/Rate data true
hsetprop ${scobj_hpath}/b/Rate mutable false
hsetprop ${scobj_hpath}/b/Rate mutable true
hsetprop ${scobj_hpath}/b/Rate nxsave true
hsetprop ${scobj_hpath}/b/Rate oldval 0.0
hsetprop ${scobj_hpath}/b/Rate klass "parameter"
hsetprop ${scobj_hpath}/b/Rate sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/b/Rate type "part"
hsetprop ${scobj_hpath}/b/Rate nxalias "${name}_b_Rate"
@ -482,6 +494,7 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name id } {
::scobj::tsi_smc::sics_log 9 "[environment_simulation] => No poll/write for tsi_smc"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/value ${sct_controller}

View File

@ -2,7 +2,6 @@
# vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent
#
driver nhq_200 = {
debug_threshold = 1;
vendor = FastComTech; device = NHQ; protocol = std;
class = environment;
simulation_group = environment_simulation;

View File

@ -3,7 +3,7 @@
#
namespace eval ::scobj::nhq_200 {
set debug_threshold 1
set debug_threshold 5
}
proc ::scobj::nhq_200::debug_log {tc_root debug_level debug_string} {
@ -286,9 +286,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/break rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/break control true
hsetprop ${scobj_hpath}/break data true
hsetprop ${scobj_hpath}/break mutable false
hsetprop ${scobj_hpath}/break mutable true
hsetprop ${scobj_hpath}/break nxsave true
hsetprop ${scobj_hpath}/break oldval 0
hsetprop ${scobj_hpath}/break klass "parameter"
hsetprop ${scobj_hpath}/break sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/break type "part"
hsetprop ${scobj_hpath}/break nxalias "${name}_break"
@ -298,13 +299,18 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/id rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/id control true
hsetprop ${scobj_hpath}/id data true
hsetprop ${scobj_hpath}/id mutable false
hsetprop ${scobj_hpath}/id mutable true
hsetprop ${scobj_hpath}/id nxsave true
hsetprop ${scobj_hpath}/id oldval UNKNOWN
hsetprop ${scobj_hpath}/id klass "parameter"
hsetprop ${scobj_hpath}/id sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/id type "part"
hsetprop ${scobj_hpath}/id nxalias "${name}_id"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
${sct_controller} poll ${scobj_hpath}/break 10
${sct_controller} poll ${scobj_hpath}/id 10
@ -313,6 +319,9 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
}
hfactory ${scobj_hpath}/ch1 plain spy none
hsetprop ${scobj_hpath}/ch1 data "true"
hsetprop ${scobj_hpath}/ch1 klass "@none"
hsetprop ${scobj_hpath}/ch1 type "part"
hfactory ${scobj_hpath}/ch1/auto_start plain user int
hsetprop ${scobj_hpath}/ch1/auto_start read ${ns}::getValue ${scobj_hpath} rdValue {A1}
@ -322,9 +331,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/auto_start check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/auto_start control true
hsetprop ${scobj_hpath}/ch1/auto_start data true
hsetprop ${scobj_hpath}/ch1/auto_start mutable false
hsetprop ${scobj_hpath}/ch1/auto_start mutable true
hsetprop ${scobj_hpath}/ch1/auto_start nxsave true
hsetprop ${scobj_hpath}/ch1/auto_start oldval 0
hsetprop ${scobj_hpath}/ch1/auto_start klass "parameter"
hsetprop ${scobj_hpath}/ch1/auto_start sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/auto_start type "part"
hsetprop ${scobj_hpath}/ch1/auto_start nxalias "${name}_ch1_auto_start"
@ -334,9 +344,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/current rdCurrent ${ns}::rdCurrent ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/current control true
hsetprop ${scobj_hpath}/ch1/current data true
hsetprop ${scobj_hpath}/ch1/current mutable false
hsetprop ${scobj_hpath}/ch1/current mutable true
hsetprop ${scobj_hpath}/ch1/current nxsave true
hsetprop ${scobj_hpath}/ch1/current oldval UNKNOWN
hsetprop ${scobj_hpath}/ch1/current klass "parameter"
hsetprop ${scobj_hpath}/ch1/current sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/current type "part"
hsetprop ${scobj_hpath}/ch1/current nxalias "${name}_ch1_current"
@ -347,9 +358,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/go check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/go control true
hsetprop ${scobj_hpath}/ch1/go data true
hsetprop ${scobj_hpath}/ch1/go mutable false
hsetprop ${scobj_hpath}/ch1/go mutable true
hsetprop ${scobj_hpath}/ch1/go nxsave true
hsetprop ${scobj_hpath}/ch1/go oldval 0
hsetprop ${scobj_hpath}/ch1/go klass "parameter"
hsetprop ${scobj_hpath}/ch1/go sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/go type "part"
hsetprop ${scobj_hpath}/ch1/go nxalias "${name}_ch1_go"
@ -359,9 +371,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/i_lim rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/i_lim control true
hsetprop ${scobj_hpath}/ch1/i_lim data true
hsetprop ${scobj_hpath}/ch1/i_lim mutable false
hsetprop ${scobj_hpath}/ch1/i_lim mutable true
hsetprop ${scobj_hpath}/ch1/i_lim nxsave true
hsetprop ${scobj_hpath}/ch1/i_lim oldval 0
hsetprop ${scobj_hpath}/ch1/i_lim klass "parameter"
hsetprop ${scobj_hpath}/ch1/i_lim sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/i_lim type "part"
hsetprop ${scobj_hpath}/ch1/i_lim nxalias "${name}_ch1_i_lim"
@ -374,9 +387,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/i_trip check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/i_trip control true
hsetprop ${scobj_hpath}/ch1/i_trip data true
hsetprop ${scobj_hpath}/ch1/i_trip mutable false
hsetprop ${scobj_hpath}/ch1/i_trip mutable true
hsetprop ${scobj_hpath}/ch1/i_trip nxsave true
hsetprop ${scobj_hpath}/ch1/i_trip oldval 0
hsetprop ${scobj_hpath}/ch1/i_trip klass "parameter"
hsetprop ${scobj_hpath}/ch1/i_trip sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/i_trip type "part"
hsetprop ${scobj_hpath}/ch1/i_trip nxalias "${name}_ch1_i_trip"
@ -386,9 +400,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/module rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/module control true
hsetprop ${scobj_hpath}/ch1/module data true
hsetprop ${scobj_hpath}/ch1/module mutable false
hsetprop ${scobj_hpath}/ch1/module mutable true
hsetprop ${scobj_hpath}/ch1/module nxsave true
hsetprop ${scobj_hpath}/ch1/module oldval 0
hsetprop ${scobj_hpath}/ch1/module klass "parameter"
hsetprop ${scobj_hpath}/ch1/module sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/module type "part"
hsetprop ${scobj_hpath}/ch1/module nxalias "${name}_ch1_module"
@ -398,9 +413,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/status rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/status control true
hsetprop ${scobj_hpath}/ch1/status data true
hsetprop ${scobj_hpath}/ch1/status mutable false
hsetprop ${scobj_hpath}/ch1/status mutable true
hsetprop ${scobj_hpath}/ch1/status nxsave true
hsetprop ${scobj_hpath}/ch1/status oldval UNKNOWN
hsetprop ${scobj_hpath}/ch1/status klass "parameter"
hsetprop ${scobj_hpath}/ch1/status sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/status type "part"
hsetprop ${scobj_hpath}/ch1/status nxalias "${name}_ch1_status"
@ -410,9 +426,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/v_lim rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/v_lim control true
hsetprop ${scobj_hpath}/ch1/v_lim data true
hsetprop ${scobj_hpath}/ch1/v_lim mutable false
hsetprop ${scobj_hpath}/ch1/v_lim mutable true
hsetprop ${scobj_hpath}/ch1/v_lim nxsave true
hsetprop ${scobj_hpath}/ch1/v_lim oldval 0
hsetprop ${scobj_hpath}/ch1/v_lim klass "parameter"
hsetprop ${scobj_hpath}/ch1/v_lim sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/v_lim type "part"
hsetprop ${scobj_hpath}/ch1/v_lim nxalias "${name}_ch1_v_lim"
@ -425,9 +442,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/v_ramp check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/v_ramp control true
hsetprop ${scobj_hpath}/ch1/v_ramp data true
hsetprop ${scobj_hpath}/ch1/v_ramp mutable false
hsetprop ${scobj_hpath}/ch1/v_ramp mutable true
hsetprop ${scobj_hpath}/ch1/v_ramp nxsave true
hsetprop ${scobj_hpath}/ch1/v_ramp oldval 0
hsetprop ${scobj_hpath}/ch1/v_ramp klass "parameter"
hsetprop ${scobj_hpath}/ch1/v_ramp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/v_ramp type "part"
hsetprop ${scobj_hpath}/ch1/v_ramp nxalias "${name}_ch1_v_ramp"
@ -445,12 +463,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/v_sp driveable ch1/voltage
hsetprop ${scobj_hpath}/ch1/v_sp control true
hsetprop ${scobj_hpath}/ch1/v_sp data true
hsetprop ${scobj_hpath}/ch1/v_sp mutable false
hsetprop ${scobj_hpath}/ch1/v_sp mutable true
hsetprop ${scobj_hpath}/ch1/v_sp nxsave true
hsetprop ${scobj_hpath}/ch1/v_sp lowerlimit 0
hsetprop ${scobj_hpath}/ch1/v_sp upperlimit 3000
hsetprop ${scobj_hpath}/ch1/v_sp tolerance 5
hsetprop ${scobj_hpath}/ch1/v_sp oldval 0
hsetprop ${scobj_hpath}/ch1/v_sp klass "parameter"
hsetprop ${scobj_hpath}/ch1/v_sp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/v_sp settle_time "10"
hsetprop ${scobj_hpath}/ch1/v_sp type "drivable"
@ -461,9 +480,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch1/voltage rdVoltage ${ns}::rdVoltage ${scobj_hpath}
hsetprop ${scobj_hpath}/ch1/voltage control true
hsetprop ${scobj_hpath}/ch1/voltage data true
hsetprop ${scobj_hpath}/ch1/voltage mutable false
hsetprop ${scobj_hpath}/ch1/voltage mutable true
hsetprop ${scobj_hpath}/ch1/voltage nxsave true
hsetprop ${scobj_hpath}/ch1/voltage oldval 0
hsetprop ${scobj_hpath}/ch1/voltage klass "parameter"
hsetprop ${scobj_hpath}/ch1/voltage sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch1/voltage type "part"
hsetprop ${scobj_hpath}/ch1/voltage nxalias "${name}_ch1_voltage"
@ -489,6 +509,9 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
}
hfactory ${scobj_hpath}/ch2 plain spy none
hsetprop ${scobj_hpath}/ch2 data "true"
hsetprop ${scobj_hpath}/ch2 klass "@none"
hsetprop ${scobj_hpath}/ch2 type "part"
hfactory ${scobj_hpath}/ch2/auto_start plain user int
hsetprop ${scobj_hpath}/ch2/auto_start read ${ns}::getValue ${scobj_hpath} rdValue {A2}
@ -498,9 +521,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/auto_start check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/auto_start control true
hsetprop ${scobj_hpath}/ch2/auto_start data true
hsetprop ${scobj_hpath}/ch2/auto_start mutable false
hsetprop ${scobj_hpath}/ch2/auto_start mutable true
hsetprop ${scobj_hpath}/ch2/auto_start nxsave true
hsetprop ${scobj_hpath}/ch2/auto_start oldval 0
hsetprop ${scobj_hpath}/ch2/auto_start klass "parameter"
hsetprop ${scobj_hpath}/ch2/auto_start sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/auto_start type "part"
hsetprop ${scobj_hpath}/ch2/auto_start nxalias "${name}_ch2_auto_start"
@ -510,9 +534,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/current rdCurrent ${ns}::rdCurrent ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/current control true
hsetprop ${scobj_hpath}/ch2/current data true
hsetprop ${scobj_hpath}/ch2/current mutable false
hsetprop ${scobj_hpath}/ch2/current mutable true
hsetprop ${scobj_hpath}/ch2/current nxsave true
hsetprop ${scobj_hpath}/ch2/current oldval UNKNOWN
hsetprop ${scobj_hpath}/ch2/current klass "parameter"
hsetprop ${scobj_hpath}/ch2/current sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/current type "part"
hsetprop ${scobj_hpath}/ch2/current nxalias "${name}_ch2_current"
@ -523,9 +548,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/go check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/go control true
hsetprop ${scobj_hpath}/ch2/go data true
hsetprop ${scobj_hpath}/ch2/go mutable false
hsetprop ${scobj_hpath}/ch2/go mutable true
hsetprop ${scobj_hpath}/ch2/go nxsave true
hsetprop ${scobj_hpath}/ch2/go oldval 0
hsetprop ${scobj_hpath}/ch2/go klass "parameter"
hsetprop ${scobj_hpath}/ch2/go sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/go type "part"
hsetprop ${scobj_hpath}/ch2/go nxalias "${name}_ch2_go"
@ -535,9 +561,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/i_lim rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/i_lim control true
hsetprop ${scobj_hpath}/ch2/i_lim data true
hsetprop ${scobj_hpath}/ch2/i_lim mutable false
hsetprop ${scobj_hpath}/ch2/i_lim mutable true
hsetprop ${scobj_hpath}/ch2/i_lim nxsave true
hsetprop ${scobj_hpath}/ch2/i_lim oldval 0
hsetprop ${scobj_hpath}/ch2/i_lim klass "parameter"
hsetprop ${scobj_hpath}/ch2/i_lim sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/i_lim type "part"
hsetprop ${scobj_hpath}/ch2/i_lim nxalias "${name}_ch2_i_lim"
@ -550,9 +577,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/i_trip check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/i_trip control true
hsetprop ${scobj_hpath}/ch2/i_trip data true
hsetprop ${scobj_hpath}/ch2/i_trip mutable false
hsetprop ${scobj_hpath}/ch2/i_trip mutable true
hsetprop ${scobj_hpath}/ch2/i_trip nxsave true
hsetprop ${scobj_hpath}/ch2/i_trip oldval 0
hsetprop ${scobj_hpath}/ch2/i_trip klass "parameter"
hsetprop ${scobj_hpath}/ch2/i_trip sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/i_trip type "part"
hsetprop ${scobj_hpath}/ch2/i_trip nxalias "${name}_ch2_i_trip"
@ -562,9 +590,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/module rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/module control true
hsetprop ${scobj_hpath}/ch2/module data true
hsetprop ${scobj_hpath}/ch2/module mutable false
hsetprop ${scobj_hpath}/ch2/module mutable true
hsetprop ${scobj_hpath}/ch2/module nxsave true
hsetprop ${scobj_hpath}/ch2/module oldval 0
hsetprop ${scobj_hpath}/ch2/module klass "parameter"
hsetprop ${scobj_hpath}/ch2/module sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/module type "part"
hsetprop ${scobj_hpath}/ch2/module nxalias "${name}_ch2_module"
@ -574,9 +603,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/status rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/status control true
hsetprop ${scobj_hpath}/ch2/status data true
hsetprop ${scobj_hpath}/ch2/status mutable false
hsetprop ${scobj_hpath}/ch2/status mutable true
hsetprop ${scobj_hpath}/ch2/status nxsave true
hsetprop ${scobj_hpath}/ch2/status oldval UNKNOWN
hsetprop ${scobj_hpath}/ch2/status klass "parameter"
hsetprop ${scobj_hpath}/ch2/status sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/status type "part"
hsetprop ${scobj_hpath}/ch2/status nxalias "${name}_ch2_status"
@ -586,9 +616,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/v_lim rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/v_lim control true
hsetprop ${scobj_hpath}/ch2/v_lim data true
hsetprop ${scobj_hpath}/ch2/v_lim mutable false
hsetprop ${scobj_hpath}/ch2/v_lim mutable true
hsetprop ${scobj_hpath}/ch2/v_lim nxsave true
hsetprop ${scobj_hpath}/ch2/v_lim oldval 0
hsetprop ${scobj_hpath}/ch2/v_lim klass "parameter"
hsetprop ${scobj_hpath}/ch2/v_lim sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/v_lim type "part"
hsetprop ${scobj_hpath}/ch2/v_lim nxalias "${name}_ch2_v_lim"
@ -601,9 +632,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/v_ramp check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/v_ramp control true
hsetprop ${scobj_hpath}/ch2/v_ramp data true
hsetprop ${scobj_hpath}/ch2/v_ramp mutable false
hsetprop ${scobj_hpath}/ch2/v_ramp mutable true
hsetprop ${scobj_hpath}/ch2/v_ramp nxsave true
hsetprop ${scobj_hpath}/ch2/v_ramp oldval 0
hsetprop ${scobj_hpath}/ch2/v_ramp klass "parameter"
hsetprop ${scobj_hpath}/ch2/v_ramp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/v_ramp type "part"
hsetprop ${scobj_hpath}/ch2/v_ramp nxalias "${name}_ch2_v_ramp"
@ -621,12 +653,13 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/v_sp driveable ch2/voltage
hsetprop ${scobj_hpath}/ch2/v_sp control true
hsetprop ${scobj_hpath}/ch2/v_sp data true
hsetprop ${scobj_hpath}/ch2/v_sp mutable false
hsetprop ${scobj_hpath}/ch2/v_sp mutable true
hsetprop ${scobj_hpath}/ch2/v_sp nxsave true
hsetprop ${scobj_hpath}/ch2/v_sp lowerlimit 0
hsetprop ${scobj_hpath}/ch2/v_sp upperlimit 3000
hsetprop ${scobj_hpath}/ch2/v_sp tolerance 5
hsetprop ${scobj_hpath}/ch2/v_sp oldval 0
hsetprop ${scobj_hpath}/ch2/v_sp klass "parameter"
hsetprop ${scobj_hpath}/ch2/v_sp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/v_sp settle_time "10"
hsetprop ${scobj_hpath}/ch2/v_sp type "drivable"
@ -637,9 +670,10 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/ch2/voltage rdVoltage ${ns}::rdVoltage ${scobj_hpath}
hsetprop ${scobj_hpath}/ch2/voltage control true
hsetprop ${scobj_hpath}/ch2/voltage data true
hsetprop ${scobj_hpath}/ch2/voltage mutable false
hsetprop ${scobj_hpath}/ch2/voltage mutable true
hsetprop ${scobj_hpath}/ch2/voltage nxsave true
hsetprop ${scobj_hpath}/ch2/voltage oldval 0
hsetprop ${scobj_hpath}/ch2/voltage klass "parameter"
hsetprop ${scobj_hpath}/ch2/voltage sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/ch2/voltage type "part"
hsetprop ${scobj_hpath}/ch2/voltage nxalias "${name}_ch2_voltage"
@ -664,7 +698,8 @@ proc ::scobj::nhq_200::mkDriver { sct_controller name } {
::scobj::nhq_200::sics_log 9 "[environment_simulation] => No poll/write for nhq_200"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} debug_threshold 1
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_ch1_v_sp ${scobj_hpath}/ch1/v_sp ${scobj_hpath}/ch1/voltage ${sct_controller}
ansto_makesctdrive ${name}_ch2_v_sp ${scobj_hpath}/ch2/v_sp ${scobj_hpath}/ch2/voltage ${sct_controller}

View File

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

View File

@ -210,6 +210,7 @@ proc ::scobj::omron_hldc::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/distance mutable true
hsetprop ${scobj_hpath}/distance nxsave true
hsetprop ${scobj_hpath}/distance oldval 0.0
hsetprop ${scobj_hpath}/distance klass "parameter"
hsetprop ${scobj_hpath}/distance sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/distance type "part"
hsetprop ${scobj_hpath}/distance nxalias "${name}_distance"
@ -219,13 +220,18 @@ proc ::scobj::omron_hldc::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/id read_id ${ns}::read_id ${scobj_hpath}
hsetprop ${scobj_hpath}/id control true
hsetprop ${scobj_hpath}/id data true
hsetprop ${scobj_hpath}/id mutable false
hsetprop ${scobj_hpath}/id mutable true
hsetprop ${scobj_hpath}/id nxsave true
hsetprop ${scobj_hpath}/id oldval UNKNOWN
hsetprop ${scobj_hpath}/id klass "parameter"
hsetprop ${scobj_hpath}/id sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/id type "part"
hsetprop ${scobj_hpath}/id nxalias "${name}_id"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
${sct_controller} poll ${scobj_hpath}/distance 1
${sct_controller} poll ${scobj_hpath}/id 10
@ -233,6 +239,7 @@ proc ::scobj::omron_hldc::mkDriver { sct_controller name } {
::scobj::omron_hldc::sics_log 9 "[environment_simulation] => No poll/write for omron_hldc"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code goes here
} catch_message ]

View File

@ -39,6 +39,7 @@ proc ::scobj::protekmm::mkDriver { sct_controller name id datype } {
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
MakeProtek $name $sct_controller $id $datype

View File

@ -39,6 +39,7 @@ proc ::scobj::eurotherm_m2000::mkDriver { sct_controller name id datype dev_id t
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
mk_sct_eurotherm_et2000 sct_controller environment $name $dev_id $tol $id $datype

View File

@ -6,7 +6,6 @@ driver julabo_lh45_gen = {
vendor = julabo; device = lh45; protocol = std;
class = environment;
simulation_group = environment_simulation
debug_threshold = 1;
add_args = '{id 1} {ctrl_sensor "bath"} {tol 5.0}';
make_args = 'id ctrl_sensor tol';
protocol_args = '"\r"';

View File

@ -3,7 +3,7 @@
#
namespace eval ::scobj::julabo_lh45_gen {
set debug_threshold 1
set debug_threshold 5
}
proc ::scobj::julabo_lh45_gen::debug_log {tc_root debug_level debug_string} {
@ -381,9 +381,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hsetprop ${scobj_hpath}/heating_power_percent rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/heating_power_percent control true
hsetprop ${scobj_hpath}/heating_power_percent data true
hsetprop ${scobj_hpath}/heating_power_percent mutable false
hsetprop ${scobj_hpath}/heating_power_percent mutable true
hsetprop ${scobj_hpath}/heating_power_percent nxsave true
hsetprop ${scobj_hpath}/heating_power_percent oldval 0.0
hsetprop ${scobj_hpath}/heating_power_percent klass "parameter"
hsetprop ${scobj_hpath}/heating_power_percent sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/heating_power_percent type "part"
hsetprop ${scobj_hpath}/heating_power_percent nxalias "${name}_heating_power_percent"
@ -391,9 +392,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hfactory ${scobj_hpath}/lh45_lasterror plain user text
hsetprop ${scobj_hpath}/lh45_lasterror control true
hsetprop ${scobj_hpath}/lh45_lasterror data true
hsetprop ${scobj_hpath}/lh45_lasterror mutable false
hsetprop ${scobj_hpath}/lh45_lasterror mutable true
hsetprop ${scobj_hpath}/lh45_lasterror nxsave true
hsetprop ${scobj_hpath}/lh45_lasterror oldval UNKNOWN
hsetprop ${scobj_hpath}/lh45_lasterror klass "parameter"
hsetprop ${scobj_hpath}/lh45_lasterror sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/lh45_lasterror type "part"
hsetprop ${scobj_hpath}/lh45_lasterror nxalias "${name}_lh45_lasterror"
@ -403,9 +405,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hsetprop ${scobj_hpath}/lh45_state rdState ${ns}::rdState ${scobj_hpath}
hsetprop ${scobj_hpath}/lh45_state control true
hsetprop ${scobj_hpath}/lh45_state data true
hsetprop ${scobj_hpath}/lh45_state mutable false
hsetprop ${scobj_hpath}/lh45_state mutable true
hsetprop ${scobj_hpath}/lh45_state nxsave true
hsetprop ${scobj_hpath}/lh45_state oldval UNKNOWN
hsetprop ${scobj_hpath}/lh45_state klass "parameter"
hsetprop ${scobj_hpath}/lh45_state sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/lh45_state type "part"
hsetprop ${scobj_hpath}/lh45_state nxalias "${name}_lh45_state"
@ -415,9 +418,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hsetprop ${scobj_hpath}/overtemp_warnlimit rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/overtemp_warnlimit control true
hsetprop ${scobj_hpath}/overtemp_warnlimit data true
hsetprop ${scobj_hpath}/overtemp_warnlimit mutable false
hsetprop ${scobj_hpath}/overtemp_warnlimit mutable true
hsetprop ${scobj_hpath}/overtemp_warnlimit nxsave true
hsetprop ${scobj_hpath}/overtemp_warnlimit oldval 0.0
hsetprop ${scobj_hpath}/overtemp_warnlimit klass "parameter"
hsetprop ${scobj_hpath}/overtemp_warnlimit sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/overtemp_warnlimit type "part"
hsetprop ${scobj_hpath}/overtemp_warnlimit nxalias "${name}_overtemp_warnlimit"
@ -425,9 +429,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hfactory ${scobj_hpath}/remote_ctrl plain spy text
hsetprop ${scobj_hpath}/remote_ctrl control true
hsetprop ${scobj_hpath}/remote_ctrl data true
hsetprop ${scobj_hpath}/remote_ctrl mutable false
hsetprop ${scobj_hpath}/remote_ctrl mutable true
hsetprop ${scobj_hpath}/remote_ctrl nxsave true
hsetprop ${scobj_hpath}/remote_ctrl oldval UNKNOWN
hsetprop ${scobj_hpath}/remote_ctrl klass "parameter"
hsetprop ${scobj_hpath}/remote_ctrl sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/remote_ctrl type "part"
hsetprop ${scobj_hpath}/remote_ctrl nxalias "${name}_remote_ctrl"
@ -445,7 +450,7 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hsetprop ${scobj_hpath}/setpoint driveable sensor/value
hsetprop ${scobj_hpath}/setpoint control true
hsetprop ${scobj_hpath}/setpoint data true
hsetprop ${scobj_hpath}/setpoint mutable false
hsetprop ${scobj_hpath}/setpoint mutable true
hsetprop ${scobj_hpath}/setpoint nxsave true
hsetprop ${scobj_hpath}/setpoint lowerlimit 10
hsetprop ${scobj_hpath}/setpoint upperlimit 90
@ -453,6 +458,7 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hsetprop ${scobj_hpath}/setpoint permlink data_set "T[format "%02d" ${id}]SP01"
hsetprop ${scobj_hpath}/setpoint @description "T[format "%02d" ${id}]SP01"
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 type "drivable"
hsetprop ${scobj_hpath}/setpoint units "C"
@ -463,13 +469,18 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hsetprop ${scobj_hpath}/subtemp_warnlimit rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/subtemp_warnlimit control true
hsetprop ${scobj_hpath}/subtemp_warnlimit data true
hsetprop ${scobj_hpath}/subtemp_warnlimit mutable false
hsetprop ${scobj_hpath}/subtemp_warnlimit mutable true
hsetprop ${scobj_hpath}/subtemp_warnlimit nxsave true
hsetprop ${scobj_hpath}/subtemp_warnlimit oldval 0.0
hsetprop ${scobj_hpath}/subtemp_warnlimit klass "parameter"
hsetprop ${scobj_hpath}/subtemp_warnlimit sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/subtemp_warnlimit type "part"
hsetprop ${scobj_hpath}/subtemp_warnlimit nxalias "${name}_subtemp_warnlimit"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
${sct_controller} poll ${scobj_hpath}/heating_power_percent 1
${sct_controller} poll ${scobj_hpath}/lh45_state 1
@ -482,6 +493,9 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
}
hfactory ${scobj_hpath}/mode plain spy none
hsetprop ${scobj_hpath}/mode data "true"
hsetprop ${scobj_hpath}/mode klass "@none"
hsetprop ${scobj_hpath}/mode type "part"
hfactory ${scobj_hpath}/mode/ext_else_bath plain user int
hsetprop ${scobj_hpath}/mode/ext_else_bath read ${ns}::getValue ${scobj_hpath} rdValue {in_mode_04}
@ -491,9 +505,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hsetprop ${scobj_hpath}/mode/ext_else_bath check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/mode/ext_else_bath control true
hsetprop ${scobj_hpath}/mode/ext_else_bath data true
hsetprop ${scobj_hpath}/mode/ext_else_bath mutable false
hsetprop ${scobj_hpath}/mode/ext_else_bath mutable true
hsetprop ${scobj_hpath}/mode/ext_else_bath nxsave true
hsetprop ${scobj_hpath}/mode/ext_else_bath oldval 0
hsetprop ${scobj_hpath}/mode/ext_else_bath klass "parameter"
hsetprop ${scobj_hpath}/mode/ext_else_bath sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/mode/ext_else_bath type "part"
hsetprop ${scobj_hpath}/mode/ext_else_bath nxalias "${name}_mode_ext_else_bath"
@ -506,9 +521,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hsetprop ${scobj_hpath}/mode/on_else_off check ${ns}::checkrange ${scobj_hpath}
hsetprop ${scobj_hpath}/mode/on_else_off control true
hsetprop ${scobj_hpath}/mode/on_else_off data true
hsetprop ${scobj_hpath}/mode/on_else_off mutable false
hsetprop ${scobj_hpath}/mode/on_else_off mutable true
hsetprop ${scobj_hpath}/mode/on_else_off nxsave true
hsetprop ${scobj_hpath}/mode/on_else_off oldval 0
hsetprop ${scobj_hpath}/mode/on_else_off klass "parameter"
hsetprop ${scobj_hpath}/mode/on_else_off sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/mode/on_else_off type "part"
hsetprop ${scobj_hpath}/mode/on_else_off nxalias "${name}_mode_on_else_off"
@ -523,16 +539,20 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
}
hfactory ${scobj_hpath}/sensor plain spy none
hsetprop ${scobj_hpath}/sensor data "true"
hsetprop ${scobj_hpath}/sensor klass "@none"
hsetprop ${scobj_hpath}/sensor type "part"
hfactory ${scobj_hpath}/sensor/bathtemp plain internal float
hsetprop ${scobj_hpath}/sensor/bathtemp read ${ns}::getValue ${scobj_hpath} rdSensor {in_pv_00}
hsetprop ${scobj_hpath}/sensor/bathtemp rdSensor ${ns}::rdSensor ${scobj_hpath}
hsetprop ${scobj_hpath}/sensor/bathtemp control true
hsetprop ${scobj_hpath}/sensor/bathtemp data true
hsetprop ${scobj_hpath}/sensor/bathtemp mutable false
hsetprop ${scobj_hpath}/sensor/bathtemp mutable true
hsetprop ${scobj_hpath}/sensor/bathtemp nxsave true
hsetprop ${scobj_hpath}/sensor/bathtemp oldval 0.0
hsetprop ${scobj_hpath}/sensor/bathtemp external "0"
hsetprop ${scobj_hpath}/sensor/bathtemp klass "parameter"
hsetprop ${scobj_hpath}/sensor/bathtemp sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/bathtemp type "part"
hsetprop ${scobj_hpath}/sensor/bathtemp units "C"
@ -541,9 +561,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hfactory ${scobj_hpath}/sensor/end_temperature plain internal float
hsetprop ${scobj_hpath}/sensor/end_temperature control true
hsetprop ${scobj_hpath}/sensor/end_temperature data true
hsetprop ${scobj_hpath}/sensor/end_temperature mutable false
hsetprop ${scobj_hpath}/sensor/end_temperature mutable true
hsetprop ${scobj_hpath}/sensor/end_temperature nxsave true
hsetprop ${scobj_hpath}/sensor/end_temperature oldval 0.0
hsetprop ${scobj_hpath}/sensor/end_temperature klass "parameter"
hsetprop ${scobj_hpath}/sensor/end_temperature sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/end_temperature type "part"
hsetprop ${scobj_hpath}/sensor/end_temperature units "C"
@ -554,10 +575,11 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hsetprop ${scobj_hpath}/sensor/external rdSensor ${ns}::rdSensor ${scobj_hpath}
hsetprop ${scobj_hpath}/sensor/external control true
hsetprop ${scobj_hpath}/sensor/external data true
hsetprop ${scobj_hpath}/sensor/external mutable false
hsetprop ${scobj_hpath}/sensor/external mutable true
hsetprop ${scobj_hpath}/sensor/external nxsave true
hsetprop ${scobj_hpath}/sensor/external oldval 0.0
hsetprop ${scobj_hpath}/sensor/external external "1"
hsetprop ${scobj_hpath}/sensor/external klass "parameter"
hsetprop ${scobj_hpath}/sensor/external sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/external type "part"
hsetprop ${scobj_hpath}/sensor/external units "C"
@ -566,9 +588,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hfactory ${scobj_hpath}/sensor/start_temperature plain internal float
hsetprop ${scobj_hpath}/sensor/start_temperature control true
hsetprop ${scobj_hpath}/sensor/start_temperature data true
hsetprop ${scobj_hpath}/sensor/start_temperature mutable false
hsetprop ${scobj_hpath}/sensor/start_temperature mutable true
hsetprop ${scobj_hpath}/sensor/start_temperature nxsave true
hsetprop ${scobj_hpath}/sensor/start_temperature oldval 0.0
hsetprop ${scobj_hpath}/sensor/start_temperature klass "parameter"
hsetprop ${scobj_hpath}/sensor/start_temperature sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/start_temperature type "part"
hsetprop ${scobj_hpath}/sensor/start_temperature units "C"
@ -577,11 +600,12 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
hfactory ${scobj_hpath}/sensor/value plain internal float
hsetprop ${scobj_hpath}/sensor/value control true
hsetprop ${scobj_hpath}/sensor/value data true
hsetprop ${scobj_hpath}/sensor/value mutable false
hsetprop ${scobj_hpath}/sensor/value mutable true
hsetprop ${scobj_hpath}/sensor/value nxsave true
hsetprop ${scobj_hpath}/sensor/value permlink data_set "T[format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/sensor/value @description "T[format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/sensor/value oldval 0.0
hsetprop ${scobj_hpath}/sensor/value klass "parameter"
hsetprop ${scobj_hpath}/sensor/value sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/value type "part"
hsetprop ${scobj_hpath}/sensor/value units "C"
@ -594,7 +618,8 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name id ctrl_sensor tol
::scobj::julabo_lh45_gen::sics_log 9 "[environment_simulation] => No poll/write for julabo_lh45_gen"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} debug_threshold 1
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/sensor/value ${sct_controller}
}

View File

@ -174,7 +174,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/krdg rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/krdg control false
hsetprop ${scobj_hpath}/krdg data false
hsetprop ${scobj_hpath}/krdg mutable false
hsetprop ${scobj_hpath}/krdg mutable true
hsetprop ${scobj_hpath}/krdg nxsave false
hsetprop ${scobj_hpath}/krdg oldval 0,0,0,0,0,0,0,0
hset ${scobj_hpath}/krdg 0,0,0,0,0,0,0,0
@ -182,6 +182,10 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/krdg type "part"
hsetprop ${scobj_hpath}/krdg nxalias "${name}_krdg"
hsetprop ${scobj_hpath} data "false"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
${sct_controller} poll ${scobj_hpath}/krdg 1
} else {
@ -189,6 +193,9 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
}
hfactory ${scobj_hpath}/sensor plain spy none
hsetprop ${scobj_hpath}/sensor data "true"
hsetprop ${scobj_hpath}/sensor klass "@none"
hsetprop ${scobj_hpath}/sensor type "part"
hfactory ${scobj_hpath}/sensor/ch1 plain user float
hsetprop ${scobj_hpath}/sensor/ch1 read ${ns}::getTemp ${scobj_hpath} rdValue {0}
@ -198,6 +205,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/sensor/ch1 mutable true
hsetprop ${scobj_hpath}/sensor/ch1 nxsave true
hsetprop ${scobj_hpath}/sensor/ch1 oldval 0.0
hsetprop ${scobj_hpath}/sensor/ch1 klass "parameter"
hsetprop ${scobj_hpath}/sensor/ch1 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/ch1 type "part"
hsetprop ${scobj_hpath}/sensor/ch1 nxalias "${name}_sensor_ch1"
@ -210,6 +218,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/sensor/ch2 mutable true
hsetprop ${scobj_hpath}/sensor/ch2 nxsave true
hsetprop ${scobj_hpath}/sensor/ch2 oldval 0.0
hsetprop ${scobj_hpath}/sensor/ch2 klass "parameter"
hsetprop ${scobj_hpath}/sensor/ch2 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/ch2 type "part"
hsetprop ${scobj_hpath}/sensor/ch2 nxalias "${name}_sensor_ch2"
@ -222,6 +231,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/sensor/ch3 mutable true
hsetprop ${scobj_hpath}/sensor/ch3 nxsave true
hsetprop ${scobj_hpath}/sensor/ch3 oldval 0.0
hsetprop ${scobj_hpath}/sensor/ch3 klass "parameter"
hsetprop ${scobj_hpath}/sensor/ch3 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/ch3 type "part"
hsetprop ${scobj_hpath}/sensor/ch3 nxalias "${name}_sensor_ch3"
@ -234,6 +244,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/sensor/ch4 mutable true
hsetprop ${scobj_hpath}/sensor/ch4 nxsave true
hsetprop ${scobj_hpath}/sensor/ch4 oldval 0.0
hsetprop ${scobj_hpath}/sensor/ch4 klass "parameter"
hsetprop ${scobj_hpath}/sensor/ch4 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/ch4 type "part"
hsetprop ${scobj_hpath}/sensor/ch4 nxalias "${name}_sensor_ch4"
@ -246,6 +257,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/sensor/ch5 mutable true
hsetprop ${scobj_hpath}/sensor/ch5 nxsave true
hsetprop ${scobj_hpath}/sensor/ch5 oldval 0.0
hsetprop ${scobj_hpath}/sensor/ch5 klass "parameter"
hsetprop ${scobj_hpath}/sensor/ch5 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/ch5 type "part"
hsetprop ${scobj_hpath}/sensor/ch5 nxalias "${name}_sensor_ch5"
@ -258,6 +270,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/sensor/ch6 mutable true
hsetprop ${scobj_hpath}/sensor/ch6 nxsave true
hsetprop ${scobj_hpath}/sensor/ch6 oldval 0.0
hsetprop ${scobj_hpath}/sensor/ch6 klass "parameter"
hsetprop ${scobj_hpath}/sensor/ch6 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/ch6 type "part"
hsetprop ${scobj_hpath}/sensor/ch6 nxalias "${name}_sensor_ch6"
@ -270,6 +283,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/sensor/ch7 mutable true
hsetprop ${scobj_hpath}/sensor/ch7 nxsave true
hsetprop ${scobj_hpath}/sensor/ch7 oldval 0.0
hsetprop ${scobj_hpath}/sensor/ch7 klass "parameter"
hsetprop ${scobj_hpath}/sensor/ch7 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/ch7 type "part"
hsetprop ${scobj_hpath}/sensor/ch7 nxalias "${name}_sensor_ch7"
@ -282,6 +296,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/sensor/ch8 mutable true
hsetprop ${scobj_hpath}/sensor/ch8 nxsave true
hsetprop ${scobj_hpath}/sensor/ch8 oldval 0.0
hsetprop ${scobj_hpath}/sensor/ch8 klass "parameter"
hsetprop ${scobj_hpath}/sensor/ch8 sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/sensor/ch8 type "part"
hsetprop ${scobj_hpath}/sensor/ch8 nxalias "${name}_sensor_ch8"
@ -299,6 +314,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name } {
::scobj::lakeshore_218::sics_log 9 "[environment_simulation] => No poll/write for lakeshore_218"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code goes here
} catch_message ]

View File

@ -4,9 +4,13 @@ driver lakeshore_m370 = {
sobj_priv_type = 'user float'
class = environment
simulation_group = environment_simulation
add_args = 'tol'
make_args = 'tol'
add_args = 'id tol'
make_args = 'id tol'
code mkDriver = {%%
mk_sct_driver $sct_controller environment $name $tol
::scobj::lakeshore_370::mk_sct_driver $sct_controller environment $name $tol
hsetprop ${scobj_hpath}/setpoint permlink data_set T[format "%02d" ${id}]SP01
hsetprop ${scobj_hpath}/setpoint @description T[format "%02d" ${id}]SP01
hsetprop ${scobj_hpath}/Sensor/value permlink data_set T[format "%02d" ${id}]S01
hsetprop ${scobj_hpath}/Sensor/value @description T[format "%02d" ${id}]S01
%%}
}

View File

@ -27,8 +27,8 @@ proc ::scobj::lakeshore_m370::sics_log {debug_level debug_string} {
} catch_message ]
}
proc ::scobj::lakeshore_m370::mkDriver { sct_controller name tol } {
::scobj::lakeshore_m370::sics_log 9 "::scobj::lakeshore_m370::mkDriver ${sct_controller} ${name} ${tol}"
proc ::scobj::lakeshore_m370::mkDriver { sct_controller name id tol } {
::scobj::lakeshore_m370::sics_log 9 "::scobj::lakeshore_m370::mkDriver ${sct_controller} ${name} ${id} ${tol}"
set ns "[namespace current]"
set catch_status [ catch {
@ -39,9 +39,14 @@ proc ::scobj::lakeshore_m370::mkDriver { sct_controller name tol } {
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
mk_sct_driver $sct_controller environment $name $tol
::scobj::lakeshore_370::mk_sct_driver $sct_controller environment $name $tol
hsetprop ${scobj_hpath}/setpoint permlink data_set T[format "%02d" ${id}]SP01
hsetprop ${scobj_hpath}/setpoint @description T[format "%02d" ${id}]SP01
hsetprop ${scobj_hpath}/Sensor/value permlink data_set T[format "%02d" ${id}]S01
hsetprop ${scobj_hpath}/Sensor/value @description T[format "%02d" ${id}]S01
# mkDriver hook code ends
} catch_message ]
handle_exception ${catch_status} ${catch_message}
@ -54,9 +59,9 @@ namespace eval ::scobj::lakeshore_m370 {
namespace export mkDriver
}
proc add_lakeshore_m370 {name IP port tol} {
proc add_lakeshore_m370 {name IP port id tol} {
set catch_status [ catch {
::scobj::lakeshore_m370::sics_log 9 "add_lakeshore_m370 ${name} ${IP} ${port} ${tol}"
::scobj::lakeshore_m370::sics_log 9 "add_lakeshore_m370 ${name} ${IP} ${port} ${id} ${tol}"
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
if {[string equal -nocase "aqadapter" "${IP}"]} {
::scobj::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} aqadapter ${port}"
@ -68,8 +73,8 @@ proc add_lakeshore_m370 {name IP port tol} {
} else {
::scobj::lakeshore_m370::sics_log 9 "[environment_simulation] => No sctcontroller for lakeshore_m370"
}
::scobj::lakeshore_m370::sics_log 1 "::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${tol}"
::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${tol}
::scobj::lakeshore_m370::sics_log 1 "::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${id} ${tol}"
::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${id} ${tol}
} catch_message ]
handle_exception ${catch_status} ${catch_message}
}
@ -129,7 +134,7 @@ proc ::scobj::lakeshore_m370::read_config {} {
}
set arg_list [list]
set missing_list [list]
foreach arg {tol} {
foreach arg {id tol} {
if {[dict exists $u $arg]} {
lappend arg_list "[dict get $u $arg]"
} elseif {[dict exists $v $arg]} {

View File

@ -39,6 +39,7 @@ proc ::scobj::ls336::mkDriver { sct_controller name id datype tol1 tol2 } {
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
::scobj::ls336::mk_sct_lakeshore_336 $sct_controller environment $name $id $datype $tol1 $tol2 0

View File

@ -39,6 +39,7 @@ proc ::scobj::ls340::mkDriver { sct_controller name id datype tol1 tol2 } {
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
::scobj::ls340::mk_sct_lakeshore_340 $sct_controller environment $name $id $datype $tol1 $tol2 0

View File

@ -279,15 +279,19 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/Loop1 plain spy none
hsetprop ${scobj_hpath}/Loop1 data "true"
hsetprop ${scobj_hpath}/Loop1 klass "@none"
hsetprop ${scobj_hpath}/Loop1 type "part"
hfactory ${scobj_hpath}/Loop1/nick plain user text
hsetprop ${scobj_hpath}/Loop1/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:MB1.T1:TEMP:NICK}
hsetprop ${scobj_hpath}/Loop1/nick rdText ${ns}::rdText ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop1/nick control true
hsetprop ${scobj_hpath}/Loop1/nick data true
hsetprop ${scobj_hpath}/Loop1/nick mutable false
hsetprop ${scobj_hpath}/Loop1/nick mutable true
hsetprop ${scobj_hpath}/Loop1/nick nxsave true
hsetprop ${scobj_hpath}/Loop1/nick oldval UNKNOWN
hsetprop ${scobj_hpath}/Loop1/nick klass "parameter"
hsetprop ${scobj_hpath}/Loop1/nick sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/nick type "part"
hsetprop ${scobj_hpath}/Loop1/nick nxalias "${name}_Loop1_nick"
@ -297,9 +301,10 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop1/power rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop1/power control true
hsetprop ${scobj_hpath}/Loop1/power data true
hsetprop ${scobj_hpath}/Loop1/power mutable false
hsetprop ${scobj_hpath}/Loop1/power mutable true
hsetprop ${scobj_hpath}/Loop1/power nxsave true
hsetprop ${scobj_hpath}/Loop1/power oldval 0.0
hsetprop ${scobj_hpath}/Loop1/power klass "parameter"
hsetprop ${scobj_hpath}/Loop1/power sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/power type "part"
hsetprop ${scobj_hpath}/Loop1/power nxalias "${name}_Loop1_power"
@ -309,11 +314,12 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop1/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop1/sensor control true
hsetprop ${scobj_hpath}/Loop1/sensor data true
hsetprop ${scobj_hpath}/Loop1/sensor mutable false
hsetprop ${scobj_hpath}/Loop1/sensor mutable true
hsetprop ${scobj_hpath}/Loop1/sensor nxsave true
hsetprop ${scobj_hpath}/Loop1/sensor permlink data_set "T[format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/Loop1/sensor @description "T[format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/Loop1/sensor oldval 0.0
hsetprop ${scobj_hpath}/Loop1/sensor klass "parameter"
hsetprop ${scobj_hpath}/Loop1/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/sensor type "part"
hsetprop ${scobj_hpath}/Loop1/sensor nxalias "${name}_Loop1_sensor"
@ -331,7 +337,7 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop1/setpoint driveable Loop1/sensor
hsetprop ${scobj_hpath}/Loop1/setpoint control true
hsetprop ${scobj_hpath}/Loop1/setpoint data true
hsetprop ${scobj_hpath}/Loop1/setpoint mutable false
hsetprop ${scobj_hpath}/Loop1/setpoint mutable true
hsetprop ${scobj_hpath}/Loop1/setpoint nxsave true
hsetprop ${scobj_hpath}/Loop1/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Loop1/setpoint upperlimit 333
@ -339,6 +345,7 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop1/setpoint permlink data_set "T[format "%02d" ${id}]SP01"
hsetprop ${scobj_hpath}/Loop1/setpoint @description "T[format "%02d" ${id}]SP01"
hsetprop ${scobj_hpath}/Loop1/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop1/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop1/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/setpoint settle_time "15"
hsetprop ${scobj_hpath}/Loop1/setpoint type "drivable"
@ -355,15 +362,19 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
}
hfactory ${scobj_hpath}/Loop2 plain spy none
hsetprop ${scobj_hpath}/Loop2 data "true"
hsetprop ${scobj_hpath}/Loop2 klass "@none"
hsetprop ${scobj_hpath}/Loop2 type "part"
hfactory ${scobj_hpath}/Loop2/nick plain user text
hsetprop ${scobj_hpath}/Loop2/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB6.T1:TEMP:NICK}
hsetprop ${scobj_hpath}/Loop2/nick rdText ${ns}::rdText ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop2/nick control true
hsetprop ${scobj_hpath}/Loop2/nick data true
hsetprop ${scobj_hpath}/Loop2/nick mutable false
hsetprop ${scobj_hpath}/Loop2/nick mutable true
hsetprop ${scobj_hpath}/Loop2/nick nxsave true
hsetprop ${scobj_hpath}/Loop2/nick oldval UNKNOWN
hsetprop ${scobj_hpath}/Loop2/nick klass "parameter"
hsetprop ${scobj_hpath}/Loop2/nick sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop2/nick type "part"
hsetprop ${scobj_hpath}/Loop2/nick nxalias "${name}_Loop2_nick"
@ -373,9 +384,10 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop2/power rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop2/power control true
hsetprop ${scobj_hpath}/Loop2/power data true
hsetprop ${scobj_hpath}/Loop2/power mutable false
hsetprop ${scobj_hpath}/Loop2/power mutable true
hsetprop ${scobj_hpath}/Loop2/power nxsave true
hsetprop ${scobj_hpath}/Loop2/power oldval 0.0
hsetprop ${scobj_hpath}/Loop2/power klass "parameter"
hsetprop ${scobj_hpath}/Loop2/power sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop2/power type "part"
hsetprop ${scobj_hpath}/Loop2/power nxalias "${name}_Loop2_power"
@ -385,11 +397,12 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop2/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop2/sensor control true
hsetprop ${scobj_hpath}/Loop2/sensor data true
hsetprop ${scobj_hpath}/Loop2/sensor mutable false
hsetprop ${scobj_hpath}/Loop2/sensor mutable true
hsetprop ${scobj_hpath}/Loop2/sensor nxsave true
hsetprop ${scobj_hpath}/Loop2/sensor permlink data_set "T[format "%02d" ${id}]S02"
hsetprop ${scobj_hpath}/Loop2/sensor @description "T[format "%02d" ${id}]S02"
hsetprop ${scobj_hpath}/Loop2/sensor oldval 0.0
hsetprop ${scobj_hpath}/Loop2/sensor klass "parameter"
hsetprop ${scobj_hpath}/Loop2/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop2/sensor type "part"
hsetprop ${scobj_hpath}/Loop2/sensor nxalias "${name}_Loop2_sensor"
@ -407,7 +420,7 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop2/setpoint driveable Loop2/sensor
hsetprop ${scobj_hpath}/Loop2/setpoint control true
hsetprop ${scobj_hpath}/Loop2/setpoint data true
hsetprop ${scobj_hpath}/Loop2/setpoint mutable false
hsetprop ${scobj_hpath}/Loop2/setpoint mutable true
hsetprop ${scobj_hpath}/Loop2/setpoint nxsave true
hsetprop ${scobj_hpath}/Loop2/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Loop2/setpoint upperlimit 333
@ -415,6 +428,7 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop2/setpoint permlink data_set "T[format "%02d" ${id}]SP02"
hsetprop ${scobj_hpath}/Loop2/setpoint @description "T[format "%02d" ${id}]SP02"
hsetprop ${scobj_hpath}/Loop2/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop2/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop2/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop2/setpoint settle_time "15"
hsetprop ${scobj_hpath}/Loop2/setpoint type "drivable"
@ -431,15 +445,19 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
}
hfactory ${scobj_hpath}/Loop3 plain spy none
hsetprop ${scobj_hpath}/Loop3 data "true"
hsetprop ${scobj_hpath}/Loop3 klass "@none"
hsetprop ${scobj_hpath}/Loop3 type "part"
hfactory ${scobj_hpath}/Loop3/nick plain user text
hsetprop ${scobj_hpath}/Loop3/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB7.T1:TEMP:NICK}
hsetprop ${scobj_hpath}/Loop3/nick rdText ${ns}::rdText ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop3/nick control true
hsetprop ${scobj_hpath}/Loop3/nick data true
hsetprop ${scobj_hpath}/Loop3/nick mutable false
hsetprop ${scobj_hpath}/Loop3/nick mutable true
hsetprop ${scobj_hpath}/Loop3/nick nxsave true
hsetprop ${scobj_hpath}/Loop3/nick oldval UNKNOWN
hsetprop ${scobj_hpath}/Loop3/nick klass "parameter"
hsetprop ${scobj_hpath}/Loop3/nick sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop3/nick type "part"
hsetprop ${scobj_hpath}/Loop3/nick nxalias "${name}_Loop3_nick"
@ -449,9 +467,10 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop3/power rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop3/power control true
hsetprop ${scobj_hpath}/Loop3/power data true
hsetprop ${scobj_hpath}/Loop3/power mutable false
hsetprop ${scobj_hpath}/Loop3/power mutable true
hsetprop ${scobj_hpath}/Loop3/power nxsave true
hsetprop ${scobj_hpath}/Loop3/power oldval 0.0
hsetprop ${scobj_hpath}/Loop3/power klass "parameter"
hsetprop ${scobj_hpath}/Loop3/power sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop3/power type "part"
hsetprop ${scobj_hpath}/Loop3/power nxalias "${name}_Loop3_power"
@ -461,11 +480,12 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop3/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop3/sensor control true
hsetprop ${scobj_hpath}/Loop3/sensor data true
hsetprop ${scobj_hpath}/Loop3/sensor mutable false
hsetprop ${scobj_hpath}/Loop3/sensor mutable true
hsetprop ${scobj_hpath}/Loop3/sensor nxsave true
hsetprop ${scobj_hpath}/Loop3/sensor permlink data_set "T[format "%02d" ${id}]S03"
hsetprop ${scobj_hpath}/Loop3/sensor @description "T[format "%02d" ${id}]S03"
hsetprop ${scobj_hpath}/Loop3/sensor oldval 0.0
hsetprop ${scobj_hpath}/Loop3/sensor klass "parameter"
hsetprop ${scobj_hpath}/Loop3/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop3/sensor type "part"
hsetprop ${scobj_hpath}/Loop3/sensor nxalias "${name}_Loop3_sensor"
@ -483,7 +503,7 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop3/setpoint driveable Loop3/sensor
hsetprop ${scobj_hpath}/Loop3/setpoint control true
hsetprop ${scobj_hpath}/Loop3/setpoint data true
hsetprop ${scobj_hpath}/Loop3/setpoint mutable false
hsetprop ${scobj_hpath}/Loop3/setpoint mutable true
hsetprop ${scobj_hpath}/Loop3/setpoint nxsave true
hsetprop ${scobj_hpath}/Loop3/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Loop3/setpoint upperlimit 333
@ -491,6 +511,7 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop3/setpoint permlink data_set "T[format "%02d" ${id}]SP03"
hsetprop ${scobj_hpath}/Loop3/setpoint @description "T[format "%02d" ${id}]SP03"
hsetprop ${scobj_hpath}/Loop3/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop3/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop3/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop3/setpoint settle_time "15"
hsetprop ${scobj_hpath}/Loop3/setpoint type "drivable"
@ -506,6 +527,7 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name id tol } {
::scobj::mercury_base::sics_log 9 "[environment_simulation] => No poll/write for mercury_base"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_Loop1_setpoint ${scobj_hpath}/Loop1/setpoint ${scobj_hpath}/Loop1/sensor ${sct_controller}

View File

@ -150,17 +150,21 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name id } {
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/Level plain spy none
hsetprop ${scobj_hpath}/Level data "true"
hsetprop ${scobj_hpath}/Level klass "@none"
hsetprop ${scobj_hpath}/Level type "part"
hfactory ${scobj_hpath}/Level/Helium plain user float
hsetprop ${scobj_hpath}/Level/Helium read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:HEL:LEV}
hsetprop ${scobj_hpath}/Level/Helium rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Level/Helium control true
hsetprop ${scobj_hpath}/Level/Helium data true
hsetprop ${scobj_hpath}/Level/Helium mutable false
hsetprop ${scobj_hpath}/Level/Helium mutable true
hsetprop ${scobj_hpath}/Level/Helium nxsave true
hsetprop ${scobj_hpath}/Level/Helium permlink data_set "L[format "%02d" ${id}]S02"
hsetprop ${scobj_hpath}/Level/Helium @description "L[format "%02d" ${id}]S02"
hsetprop ${scobj_hpath}/Level/Helium oldval 0.0
hsetprop ${scobj_hpath}/Level/Helium klass "parameter"
hsetprop ${scobj_hpath}/Level/Helium sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Level/Helium type "part"
hsetprop ${scobj_hpath}/Level/Helium nxalias "${name}_Level_Helium"
@ -170,11 +174,12 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name id } {
hsetprop ${scobj_hpath}/Level/Nitrogen rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Level/Nitrogen control true
hsetprop ${scobj_hpath}/Level/Nitrogen data true
hsetprop ${scobj_hpath}/Level/Nitrogen mutable false
hsetprop ${scobj_hpath}/Level/Nitrogen mutable true
hsetprop ${scobj_hpath}/Level/Nitrogen nxsave true
hsetprop ${scobj_hpath}/Level/Nitrogen permlink data_set "L[format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/Level/Nitrogen @description "L[format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/Level/Nitrogen oldval 0.0
hsetprop ${scobj_hpath}/Level/Nitrogen klass "parameter"
hsetprop ${scobj_hpath}/Level/Nitrogen sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Level/Nitrogen type "part"
hsetprop ${scobj_hpath}/Level/Nitrogen nxalias "${name}_Level_Nitrogen"
@ -186,6 +191,7 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name id } {
::scobj::mercury_level::sics_log 9 "[environment_simulation] => No poll/write for mercury_level"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code goes here
} catch_message ]

View File

@ -285,15 +285,19 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name id tol } {
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/Loop8 plain spy none
hsetprop ${scobj_hpath}/Loop8 data "true"
hsetprop ${scobj_hpath}/Loop8 klass "@none"
hsetprop ${scobj_hpath}/Loop8 type "part"
hfactory ${scobj_hpath}/Loop8/nick plain user text
hsetprop ${scobj_hpath}/Loop8/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB8.P1:PRES:NICK}
hsetprop ${scobj_hpath}/Loop8/nick rdText ${ns}::rdText ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop8/nick control true
hsetprop ${scobj_hpath}/Loop8/nick data true
hsetprop ${scobj_hpath}/Loop8/nick mutable false
hsetprop ${scobj_hpath}/Loop8/nick mutable true
hsetprop ${scobj_hpath}/Loop8/nick nxsave true
hsetprop ${scobj_hpath}/Loop8/nick oldval UNKNOWN
hsetprop ${scobj_hpath}/Loop8/nick klass "parameter"
hsetprop ${scobj_hpath}/Loop8/nick sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop8/nick type "part"
hsetprop ${scobj_hpath}/Loop8/nick nxalias "${name}_Loop8_nick"
@ -303,12 +307,13 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop8/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop8/sensor control true
hsetprop ${scobj_hpath}/Loop8/sensor data true
hsetprop ${scobj_hpath}/Loop8/sensor mutable false
hsetprop ${scobj_hpath}/Loop8/sensor mutable true
hsetprop ${scobj_hpath}/Loop8/sensor nxsave true
hsetprop ${scobj_hpath}/Loop8/sensor units mB
hsetprop ${scobj_hpath}/Loop8/sensor permlink data_set "P[format "%02d" ${id}]S08"
hsetprop ${scobj_hpath}/Loop8/sensor @description "P[format "%02d" ${id}]S08"
hsetprop ${scobj_hpath}/Loop8/sensor oldval 0.0
hsetprop ${scobj_hpath}/Loop8/sensor klass "parameter"
hsetprop ${scobj_hpath}/Loop8/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop8/sensor type "part"
hsetprop ${scobj_hpath}/Loop8/sensor nxalias "${name}_Loop8_sensor"
@ -326,7 +331,7 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop8/setpoint driveable Loop8/sensor
hsetprop ${scobj_hpath}/Loop8/setpoint control true
hsetprop ${scobj_hpath}/Loop8/setpoint data true
hsetprop ${scobj_hpath}/Loop8/setpoint mutable false
hsetprop ${scobj_hpath}/Loop8/setpoint mutable true
hsetprop ${scobj_hpath}/Loop8/setpoint nxsave true
hsetprop ${scobj_hpath}/Loop8/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Loop8/setpoint upperlimit 333
@ -335,6 +340,7 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop8/setpoint permlink data_set "P[format "%02d" ${id}]SP08"
hsetprop ${scobj_hpath}/Loop8/setpoint @description "P[format "%02d" ${id}]SP08"
hsetprop ${scobj_hpath}/Loop8/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop8/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop8/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop8/setpoint settle_time "15"
hsetprop ${scobj_hpath}/Loop8/setpoint type "drivable"
@ -349,6 +355,7 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name id tol } {
::scobj::mercury_pres::sics_log 9 "[environment_simulation] => No poll/write for mercury_pres"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_Loop8_setpoint ${scobj_hpath}/Loop8/setpoint ${scobj_hpath}/Loop8/sensor ${sct_controller}

View File

@ -313,17 +313,21 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/Level plain spy none
hsetprop ${scobj_hpath}/Level data "true"
hsetprop ${scobj_hpath}/Level klass "@none"
hsetprop ${scobj_hpath}/Level type "part"
hfactory ${scobj_hpath}/Level/Helium plain user float
hsetprop ${scobj_hpath}/Level/Helium read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:HEL:LEV}
hsetprop ${scobj_hpath}/Level/Helium rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Level/Helium control true
hsetprop ${scobj_hpath}/Level/Helium data true
hsetprop ${scobj_hpath}/Level/Helium mutable false
hsetprop ${scobj_hpath}/Level/Helium mutable true
hsetprop ${scobj_hpath}/Level/Helium nxsave true
hsetprop ${scobj_hpath}/Level/Helium permlink data_set "[string index ${permlink} 0][format "%02d" ${id}]S06"
hsetprop ${scobj_hpath}/Level/Helium @description "[string index ${permlink} 0][format "%02d" ${id}]S06"
hsetprop ${scobj_hpath}/Level/Helium oldval 0.0
hsetprop ${scobj_hpath}/Level/Helium klass "parameter"
hsetprop ${scobj_hpath}/Level/Helium sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Level/Helium type "part"
hsetprop ${scobj_hpath}/Level/Helium nxalias "${name}_Level_Helium"
@ -333,11 +337,12 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Level/Nitrogen rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Level/Nitrogen control true
hsetprop ${scobj_hpath}/Level/Nitrogen data true
hsetprop ${scobj_hpath}/Level/Nitrogen mutable false
hsetprop ${scobj_hpath}/Level/Nitrogen mutable true
hsetprop ${scobj_hpath}/Level/Nitrogen nxsave true
hsetprop ${scobj_hpath}/Level/Nitrogen permlink data_set "[string index ${permlink} 0][format "%02d" ${id}]S05"
hsetprop ${scobj_hpath}/Level/Nitrogen @description "[string index ${permlink} 0][format "%02d" ${id}]S05"
hsetprop ${scobj_hpath}/Level/Nitrogen oldval 0.0
hsetprop ${scobj_hpath}/Level/Nitrogen klass "parameter"
hsetprop ${scobj_hpath}/Level/Nitrogen sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Level/Nitrogen type "part"
hsetprop ${scobj_hpath}/Level/Nitrogen nxalias "${name}_Level_Nitrogen"
@ -350,15 +355,19 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
}
hfactory ${scobj_hpath}/Loop1 plain spy none
hsetprop ${scobj_hpath}/Loop1 data "true"
hsetprop ${scobj_hpath}/Loop1 klass "@none"
hsetprop ${scobj_hpath}/Loop1 type "part"
hfactory ${scobj_hpath}/Loop1/nick plain user text
hsetprop ${scobj_hpath}/Loop1/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:MB1.T1:TEMP:NICK}
hsetprop ${scobj_hpath}/Loop1/nick rdText ${ns}::rdText ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop1/nick control true
hsetprop ${scobj_hpath}/Loop1/nick data true
hsetprop ${scobj_hpath}/Loop1/nick mutable false
hsetprop ${scobj_hpath}/Loop1/nick mutable true
hsetprop ${scobj_hpath}/Loop1/nick nxsave true
hsetprop ${scobj_hpath}/Loop1/nick oldval UNKNOWN
hsetprop ${scobj_hpath}/Loop1/nick klass "parameter"
hsetprop ${scobj_hpath}/Loop1/nick sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/nick type "part"
hsetprop ${scobj_hpath}/Loop1/nick nxalias "${name}_Loop1_nick"
@ -368,9 +377,10 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop1/power rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop1/power control true
hsetprop ${scobj_hpath}/Loop1/power data true
hsetprop ${scobj_hpath}/Loop1/power mutable false
hsetprop ${scobj_hpath}/Loop1/power mutable true
hsetprop ${scobj_hpath}/Loop1/power nxsave true
hsetprop ${scobj_hpath}/Loop1/power oldval 0.0
hsetprop ${scobj_hpath}/Loop1/power klass "parameter"
hsetprop ${scobj_hpath}/Loop1/power sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/power type "part"
hsetprop ${scobj_hpath}/Loop1/power nxalias "${name}_Loop1_power"
@ -380,11 +390,12 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop1/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop1/sensor control true
hsetprop ${scobj_hpath}/Loop1/sensor data true
hsetprop ${scobj_hpath}/Loop1/sensor mutable false
hsetprop ${scobj_hpath}/Loop1/sensor mutable true
hsetprop ${scobj_hpath}/Loop1/sensor nxsave true
hsetprop ${scobj_hpath}/Loop1/sensor permlink data_set "[string index ${permlink} 1][format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/Loop1/sensor @description "[string index ${permlink} 1][format "%02d" ${id}]S01"
hsetprop ${scobj_hpath}/Loop1/sensor oldval 0.0
hsetprop ${scobj_hpath}/Loop1/sensor klass "parameter"
hsetprop ${scobj_hpath}/Loop1/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/sensor type "part"
hsetprop ${scobj_hpath}/Loop1/sensor nxalias "${name}_Loop1_sensor"
@ -402,7 +413,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop1/setpoint driveable Loop1/sensor
hsetprop ${scobj_hpath}/Loop1/setpoint control true
hsetprop ${scobj_hpath}/Loop1/setpoint data true
hsetprop ${scobj_hpath}/Loop1/setpoint mutable false
hsetprop ${scobj_hpath}/Loop1/setpoint mutable true
hsetprop ${scobj_hpath}/Loop1/setpoint nxsave true
hsetprop ${scobj_hpath}/Loop1/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Loop1/setpoint upperlimit 333
@ -410,6 +421,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop1/setpoint permlink data_set "[string index ${permlink} 1][format "%02d" ${id}]SP01"
hsetprop ${scobj_hpath}/Loop1/setpoint @description "[string index ${permlink} 1][format "%02d" ${id}]SP01"
hsetprop ${scobj_hpath}/Loop1/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop1/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop1/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop1/setpoint settle_time "15"
hsetprop ${scobj_hpath}/Loop1/setpoint type "drivable"
@ -426,15 +438,19 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
}
hfactory ${scobj_hpath}/Loop2 plain spy none
hsetprop ${scobj_hpath}/Loop2 data "true"
hsetprop ${scobj_hpath}/Loop2 klass "@none"
hsetprop ${scobj_hpath}/Loop2 type "part"
hfactory ${scobj_hpath}/Loop2/nick plain user text
hsetprop ${scobj_hpath}/Loop2/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB6.T1:TEMP:NICK}
hsetprop ${scobj_hpath}/Loop2/nick rdText ${ns}::rdText ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop2/nick control true
hsetprop ${scobj_hpath}/Loop2/nick data true
hsetprop ${scobj_hpath}/Loop2/nick mutable false
hsetprop ${scobj_hpath}/Loop2/nick mutable true
hsetprop ${scobj_hpath}/Loop2/nick nxsave true
hsetprop ${scobj_hpath}/Loop2/nick oldval UNKNOWN
hsetprop ${scobj_hpath}/Loop2/nick klass "parameter"
hsetprop ${scobj_hpath}/Loop2/nick sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop2/nick type "part"
hsetprop ${scobj_hpath}/Loop2/nick nxalias "${name}_Loop2_nick"
@ -444,9 +460,10 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop2/power rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop2/power control true
hsetprop ${scobj_hpath}/Loop2/power data true
hsetprop ${scobj_hpath}/Loop2/power mutable false
hsetprop ${scobj_hpath}/Loop2/power mutable true
hsetprop ${scobj_hpath}/Loop2/power nxsave true
hsetprop ${scobj_hpath}/Loop2/power oldval 0.0
hsetprop ${scobj_hpath}/Loop2/power klass "parameter"
hsetprop ${scobj_hpath}/Loop2/power sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop2/power type "part"
hsetprop ${scobj_hpath}/Loop2/power nxalias "${name}_Loop2_power"
@ -456,11 +473,12 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop2/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop2/sensor control true
hsetprop ${scobj_hpath}/Loop2/sensor data true
hsetprop ${scobj_hpath}/Loop2/sensor mutable false
hsetprop ${scobj_hpath}/Loop2/sensor mutable true
hsetprop ${scobj_hpath}/Loop2/sensor nxsave true
hsetprop ${scobj_hpath}/Loop2/sensor permlink data_set "T[format "%02d" ${id}]S02"
hsetprop ${scobj_hpath}/Loop2/sensor @description "T[format "%02d" ${id}]S02"
hsetprop ${scobj_hpath}/Loop2/sensor oldval 0.0
hsetprop ${scobj_hpath}/Loop2/sensor klass "parameter"
hsetprop ${scobj_hpath}/Loop2/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop2/sensor type "part"
hsetprop ${scobj_hpath}/Loop2/sensor nxalias "${name}_Loop2_sensor"
@ -478,7 +496,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop2/setpoint driveable Loop2/sensor
hsetprop ${scobj_hpath}/Loop2/setpoint control true
hsetprop ${scobj_hpath}/Loop2/setpoint data true
hsetprop ${scobj_hpath}/Loop2/setpoint mutable false
hsetprop ${scobj_hpath}/Loop2/setpoint mutable true
hsetprop ${scobj_hpath}/Loop2/setpoint nxsave true
hsetprop ${scobj_hpath}/Loop2/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Loop2/setpoint upperlimit 333
@ -486,6 +504,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop2/setpoint permlink data_set "T[format "%02d" ${id}]SP02"
hsetprop ${scobj_hpath}/Loop2/setpoint @description "T[format "%02d" ${id}]SP02"
hsetprop ${scobj_hpath}/Loop2/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop2/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop2/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop2/setpoint settle_time "15"
hsetprop ${scobj_hpath}/Loop2/setpoint type "drivable"
@ -502,15 +521,19 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
}
hfactory ${scobj_hpath}/Loop3 plain spy none
hsetprop ${scobj_hpath}/Loop3 data "true"
hsetprop ${scobj_hpath}/Loop3 klass "@none"
hsetprop ${scobj_hpath}/Loop3 type "part"
hfactory ${scobj_hpath}/Loop3/nick plain user text
hsetprop ${scobj_hpath}/Loop3/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB7.T1:TEMP:NICK}
hsetprop ${scobj_hpath}/Loop3/nick rdText ${ns}::rdText ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop3/nick control true
hsetprop ${scobj_hpath}/Loop3/nick data true
hsetprop ${scobj_hpath}/Loop3/nick mutable false
hsetprop ${scobj_hpath}/Loop3/nick mutable true
hsetprop ${scobj_hpath}/Loop3/nick nxsave true
hsetprop ${scobj_hpath}/Loop3/nick oldval UNKNOWN
hsetprop ${scobj_hpath}/Loop3/nick klass "parameter"
hsetprop ${scobj_hpath}/Loop3/nick sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop3/nick type "part"
hsetprop ${scobj_hpath}/Loop3/nick nxalias "${name}_Loop3_nick"
@ -520,9 +543,10 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop3/power rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop3/power control true
hsetprop ${scobj_hpath}/Loop3/power data true
hsetprop ${scobj_hpath}/Loop3/power mutable false
hsetprop ${scobj_hpath}/Loop3/power mutable true
hsetprop ${scobj_hpath}/Loop3/power nxsave true
hsetprop ${scobj_hpath}/Loop3/power oldval 0.0
hsetprop ${scobj_hpath}/Loop3/power klass "parameter"
hsetprop ${scobj_hpath}/Loop3/power sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop3/power type "part"
hsetprop ${scobj_hpath}/Loop3/power nxalias "${name}_Loop3_power"
@ -532,11 +556,12 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop3/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop3/sensor control true
hsetprop ${scobj_hpath}/Loop3/sensor data true
hsetprop ${scobj_hpath}/Loop3/sensor mutable false
hsetprop ${scobj_hpath}/Loop3/sensor mutable true
hsetprop ${scobj_hpath}/Loop3/sensor nxsave true
hsetprop ${scobj_hpath}/Loop3/sensor permlink data_set "T[format "%02d" ${id}]S03"
hsetprop ${scobj_hpath}/Loop3/sensor @description "T[format "%02d" ${id}]S03"
hsetprop ${scobj_hpath}/Loop3/sensor oldval 0.0
hsetprop ${scobj_hpath}/Loop3/sensor klass "parameter"
hsetprop ${scobj_hpath}/Loop3/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop3/sensor type "part"
hsetprop ${scobj_hpath}/Loop3/sensor nxalias "${name}_Loop3_sensor"
@ -554,7 +579,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop3/setpoint driveable Loop3/sensor
hsetprop ${scobj_hpath}/Loop3/setpoint control true
hsetprop ${scobj_hpath}/Loop3/setpoint data true
hsetprop ${scobj_hpath}/Loop3/setpoint mutable false
hsetprop ${scobj_hpath}/Loop3/setpoint mutable true
hsetprop ${scobj_hpath}/Loop3/setpoint nxsave true
hsetprop ${scobj_hpath}/Loop3/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Loop3/setpoint upperlimit 333
@ -562,6 +587,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop3/setpoint permlink data_set "T[format "%02d" ${id}]SP03"
hsetprop ${scobj_hpath}/Loop3/setpoint @description "T[format "%02d" ${id}]SP03"
hsetprop ${scobj_hpath}/Loop3/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop3/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop3/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop3/setpoint settle_time "15"
hsetprop ${scobj_hpath}/Loop3/setpoint type "drivable"
@ -578,15 +604,19 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
}
hfactory ${scobj_hpath}/Loop4 plain spy none
hsetprop ${scobj_hpath}/Loop4 data "true"
hsetprop ${scobj_hpath}/Loop4 klass "@none"
hsetprop ${scobj_hpath}/Loop4 type "part"
hfactory ${scobj_hpath}/Loop4/nick plain user text
hsetprop ${scobj_hpath}/Loop4/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB8.T1:TEMP:NICK}
hsetprop ${scobj_hpath}/Loop4/nick rdText ${ns}::rdText ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop4/nick control true
hsetprop ${scobj_hpath}/Loop4/nick data true
hsetprop ${scobj_hpath}/Loop4/nick mutable false
hsetprop ${scobj_hpath}/Loop4/nick mutable true
hsetprop ${scobj_hpath}/Loop4/nick nxsave true
hsetprop ${scobj_hpath}/Loop4/nick oldval UNKNOWN
hsetprop ${scobj_hpath}/Loop4/nick klass "parameter"
hsetprop ${scobj_hpath}/Loop4/nick sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop4/nick type "part"
hsetprop ${scobj_hpath}/Loop4/nick nxalias "${name}_Loop4_nick"
@ -596,9 +626,10 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop4/power rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop4/power control true
hsetprop ${scobj_hpath}/Loop4/power data true
hsetprop ${scobj_hpath}/Loop4/power mutable false
hsetprop ${scobj_hpath}/Loop4/power mutable true
hsetprop ${scobj_hpath}/Loop4/power nxsave true
hsetprop ${scobj_hpath}/Loop4/power oldval 0.0
hsetprop ${scobj_hpath}/Loop4/power klass "parameter"
hsetprop ${scobj_hpath}/Loop4/power sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop4/power type "part"
hsetprop ${scobj_hpath}/Loop4/power nxalias "${name}_Loop4_power"
@ -608,11 +639,12 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop4/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop4/sensor control true
hsetprop ${scobj_hpath}/Loop4/sensor data true
hsetprop ${scobj_hpath}/Loop4/sensor mutable false
hsetprop ${scobj_hpath}/Loop4/sensor mutable true
hsetprop ${scobj_hpath}/Loop4/sensor nxsave true
hsetprop ${scobj_hpath}/Loop4/sensor permlink data_set "T[format "%02d" ${id}]S04"
hsetprop ${scobj_hpath}/Loop4/sensor @description "T[format "%02d" ${id}]S04"
hsetprop ${scobj_hpath}/Loop4/sensor oldval 0.0
hsetprop ${scobj_hpath}/Loop4/sensor klass "parameter"
hsetprop ${scobj_hpath}/Loop4/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop4/sensor type "part"
hsetprop ${scobj_hpath}/Loop4/sensor nxalias "${name}_Loop4_sensor"
@ -630,7 +662,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop4/setpoint driveable Loop4/sensor
hsetprop ${scobj_hpath}/Loop4/setpoint control true
hsetprop ${scobj_hpath}/Loop4/setpoint data true
hsetprop ${scobj_hpath}/Loop4/setpoint mutable false
hsetprop ${scobj_hpath}/Loop4/setpoint mutable true
hsetprop ${scobj_hpath}/Loop4/setpoint nxsave true
hsetprop ${scobj_hpath}/Loop4/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Loop4/setpoint upperlimit 333
@ -638,6 +670,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Loop4/setpoint permlink data_set "T[format "%02d" ${id}]SP04"
hsetprop ${scobj_hpath}/Loop4/setpoint @description "T[format "%02d" ${id}]SP04"
hsetprop ${scobj_hpath}/Loop4/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop4/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop4/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop4/setpoint settle_time "15"
hsetprop ${scobj_hpath}/Loop4/setpoint type "drivable"
@ -654,17 +687,21 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
}
hfactory ${scobj_hpath}/Valve plain spy none
hsetprop ${scobj_hpath}/Valve data "true"
hsetprop ${scobj_hpath}/Valve klass "@none"
hsetprop ${scobj_hpath}/Valve type "part"
hfactory ${scobj_hpath}/Valve/sensor plain user float
hsetprop ${scobj_hpath}/Valve/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN}
hsetprop ${scobj_hpath}/Valve/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Valve/sensor control true
hsetprop ${scobj_hpath}/Valve/sensor data true
hsetprop ${scobj_hpath}/Valve/sensor mutable false
hsetprop ${scobj_hpath}/Valve/sensor mutable true
hsetprop ${scobj_hpath}/Valve/sensor nxsave true
hsetprop ${scobj_hpath}/Valve/sensor permlink data_set "G[format "%02d" ${id}]S07"
hsetprop ${scobj_hpath}/Valve/sensor @description "G[format "%02d" ${id}]S07"
hsetprop ${scobj_hpath}/Valve/sensor oldval 0.0
hsetprop ${scobj_hpath}/Valve/sensor klass "parameter"
hsetprop ${scobj_hpath}/Valve/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Valve/sensor type "part"
hsetprop ${scobj_hpath}/Valve/sensor nxalias "${name}_Valve_sensor"
@ -680,7 +717,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Valve/setpoint driveable Valve/sensor
hsetprop ${scobj_hpath}/Valve/setpoint control true
hsetprop ${scobj_hpath}/Valve/setpoint data true
hsetprop ${scobj_hpath}/Valve/setpoint mutable false
hsetprop ${scobj_hpath}/Valve/setpoint mutable true
hsetprop ${scobj_hpath}/Valve/setpoint nxsave true
hsetprop ${scobj_hpath}/Valve/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Valve/setpoint upperlimit 100
@ -688,6 +725,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
hsetprop ${scobj_hpath}/Valve/setpoint permlink data_set "G[format "%02d" ${id}]SP07"
hsetprop ${scobj_hpath}/Valve/setpoint @description "G[format "%02d" ${id}]SP07"
hsetprop ${scobj_hpath}/Valve/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Valve/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Valve/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Valve/setpoint settle_time "30"
hsetprop ${scobj_hpath}/Valve/setpoint type "drivable"
@ -700,6 +738,7 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name id permlink tol valve
::scobj::mercury_scpi::sics_log 9 "[environment_simulation] => No poll/write for mercury_scpi"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_Loop1_setpoint ${scobj_hpath}/Loop1/setpoint ${scobj_hpath}/Loop1/sensor ${sct_controller}

View File

@ -279,15 +279,19 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name id tol } {
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/Loop4 plain spy none
hsetprop ${scobj_hpath}/Loop4 data "true"
hsetprop ${scobj_hpath}/Loop4 klass "@none"
hsetprop ${scobj_hpath}/Loop4 type "part"
hfactory ${scobj_hpath}/Loop4/nick plain user text
hsetprop ${scobj_hpath}/Loop4/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB8.T1:TEMP:NICK}
hsetprop ${scobj_hpath}/Loop4/nick rdText ${ns}::rdText ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop4/nick control true
hsetprop ${scobj_hpath}/Loop4/nick data true
hsetprop ${scobj_hpath}/Loop4/nick mutable false
hsetprop ${scobj_hpath}/Loop4/nick mutable true
hsetprop ${scobj_hpath}/Loop4/nick nxsave true
hsetprop ${scobj_hpath}/Loop4/nick oldval UNKNOWN
hsetprop ${scobj_hpath}/Loop4/nick klass "parameter"
hsetprop ${scobj_hpath}/Loop4/nick sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop4/nick type "part"
hsetprop ${scobj_hpath}/Loop4/nick nxalias "${name}_Loop4_nick"
@ -297,9 +301,10 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop4/power rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop4/power control true
hsetprop ${scobj_hpath}/Loop4/power data true
hsetprop ${scobj_hpath}/Loop4/power mutable false
hsetprop ${scobj_hpath}/Loop4/power mutable true
hsetprop ${scobj_hpath}/Loop4/power nxsave true
hsetprop ${scobj_hpath}/Loop4/power oldval 0.0
hsetprop ${scobj_hpath}/Loop4/power klass "parameter"
hsetprop ${scobj_hpath}/Loop4/power sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop4/power type "part"
hsetprop ${scobj_hpath}/Loop4/power nxalias "${name}_Loop4_power"
@ -309,11 +314,12 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop4/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Loop4/sensor control true
hsetprop ${scobj_hpath}/Loop4/sensor data true
hsetprop ${scobj_hpath}/Loop4/sensor mutable false
hsetprop ${scobj_hpath}/Loop4/sensor mutable true
hsetprop ${scobj_hpath}/Loop4/sensor nxsave true
hsetprop ${scobj_hpath}/Loop4/sensor permlink data_set "T[format "%02d" ${id}]S04"
hsetprop ${scobj_hpath}/Loop4/sensor @description "T[format "%02d" ${id}]S04"
hsetprop ${scobj_hpath}/Loop4/sensor oldval 0.0
hsetprop ${scobj_hpath}/Loop4/sensor klass "parameter"
hsetprop ${scobj_hpath}/Loop4/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop4/sensor type "part"
hsetprop ${scobj_hpath}/Loop4/sensor nxalias "${name}_Loop4_sensor"
@ -331,7 +337,7 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop4/setpoint driveable Loop4/sensor
hsetprop ${scobj_hpath}/Loop4/setpoint control true
hsetprop ${scobj_hpath}/Loop4/setpoint data true
hsetprop ${scobj_hpath}/Loop4/setpoint mutable false
hsetprop ${scobj_hpath}/Loop4/setpoint mutable true
hsetprop ${scobj_hpath}/Loop4/setpoint nxsave true
hsetprop ${scobj_hpath}/Loop4/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Loop4/setpoint upperlimit 333
@ -339,6 +345,7 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name id tol } {
hsetprop ${scobj_hpath}/Loop4/setpoint permlink data_set "T[format "%02d" ${id}]SP04"
hsetprop ${scobj_hpath}/Loop4/setpoint @description "T[format "%02d" ${id}]SP04"
hsetprop ${scobj_hpath}/Loop4/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Loop4/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Loop4/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Loop4/setpoint settle_time "15"
hsetprop ${scobj_hpath}/Loop4/setpoint type "drivable"
@ -354,6 +361,7 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name id tol } {
::scobj::mercury_temp::sics_log 9 "[environment_simulation] => No poll/write for mercury_temp"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_Loop4_setpoint ${scobj_hpath}/Loop4/setpoint ${scobj_hpath}/Loop4/sensor ${sct_controller}

View File

@ -257,17 +257,21 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name id valve_tol } {
set scobj_hpath /sics/${name}
hfactory ${scobj_hpath}/Valve plain spy none
hsetprop ${scobj_hpath}/Valve data "true"
hsetprop ${scobj_hpath}/Valve klass "@none"
hsetprop ${scobj_hpath}/Valve type "part"
hfactory ${scobj_hpath}/Valve/sensor plain user float
hsetprop ${scobj_hpath}/Valve/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN}
hsetprop ${scobj_hpath}/Valve/sensor rdValue ${ns}::rdValue ${scobj_hpath}
hsetprop ${scobj_hpath}/Valve/sensor control true
hsetprop ${scobj_hpath}/Valve/sensor data true
hsetprop ${scobj_hpath}/Valve/sensor mutable false
hsetprop ${scobj_hpath}/Valve/sensor mutable true
hsetprop ${scobj_hpath}/Valve/sensor nxsave true
hsetprop ${scobj_hpath}/Valve/sensor permlink data_set "G[format "%02d" ${id}]S07"
hsetprop ${scobj_hpath}/Valve/sensor @description "G[format "%02d" ${id}]S07"
hsetprop ${scobj_hpath}/Valve/sensor oldval 0.0
hsetprop ${scobj_hpath}/Valve/sensor klass "parameter"
hsetprop ${scobj_hpath}/Valve/sensor sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Valve/sensor type "part"
hsetprop ${scobj_hpath}/Valve/sensor nxalias "${name}_Valve_sensor"
@ -283,7 +287,7 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name id valve_tol } {
hsetprop ${scobj_hpath}/Valve/setpoint driveable Valve/sensor
hsetprop ${scobj_hpath}/Valve/setpoint control true
hsetprop ${scobj_hpath}/Valve/setpoint data true
hsetprop ${scobj_hpath}/Valve/setpoint mutable false
hsetprop ${scobj_hpath}/Valve/setpoint mutable true
hsetprop ${scobj_hpath}/Valve/setpoint nxsave true
hsetprop ${scobj_hpath}/Valve/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/Valve/setpoint upperlimit 100
@ -291,6 +295,7 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name id valve_tol } {
hsetprop ${scobj_hpath}/Valve/setpoint permlink data_set "G[format "%02d" ${id}]SP07"
hsetprop ${scobj_hpath}/Valve/setpoint @description "G[format "%02d" ${id}]SP07"
hsetprop ${scobj_hpath}/Valve/setpoint oldval 0.0
hsetprop ${scobj_hpath}/Valve/setpoint klass "parameter"
hsetprop ${scobj_hpath}/Valve/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/Valve/setpoint settle_time "30"
hsetprop ${scobj_hpath}/Valve/setpoint type "drivable"
@ -303,6 +308,7 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name id valve_tol } {
::scobj::mercury_valve::sics_log 9 "[environment_simulation] => No poll/write for mercury_valve"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_Valve_setpoint ${scobj_hpath}/Valve/setpoint ${scobj_hpath}/Valve/sensor ${sct_controller}

View File

@ -39,6 +39,7 @@ proc ::scobj::nprvasm2::mkDriver { sct_controller name tol } {
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
mk_sct_newport_rva sct_${name} environment $name $tol

View File

@ -387,25 +387,34 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name } {
hfactory ${scobj_hpath}/status plain user int
hsetprop ${scobj_hpath}/status control true
hsetprop ${scobj_hpath}/status data true
hsetprop ${scobj_hpath}/status mutable false
hsetprop ${scobj_hpath}/status mutable true
hsetprop ${scobj_hpath}/status nxsave true
hsetprop ${scobj_hpath}/status oldval 0
hsetprop ${scobj_hpath}/status klass "parameter"
hsetprop ${scobj_hpath}/status sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/status type "part"
hsetprop ${scobj_hpath}/status nxalias "${name}_status"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
hfactory ${scobj_hpath}/pressure plain spy none
hsetprop ${scobj_hpath}/pressure data "true"
hsetprop ${scobj_hpath}/pressure klass "@none"
hsetprop ${scobj_hpath}/pressure type "part"
hfactory ${scobj_hpath}/pressure/sensor plain user float
hsetprop ${scobj_hpath}/pressure/sensor read ${ns}::sendPR1 ${scobj_hpath} readPR1 {PR1}
hsetprop ${scobj_hpath}/pressure/sensor readPR1 ${ns}::readPR1 ${scobj_hpath}
hsetprop ${scobj_hpath}/pressure/sensor control true
hsetprop ${scobj_hpath}/pressure/sensor data true
hsetprop ${scobj_hpath}/pressure/sensor mutable false
hsetprop ${scobj_hpath}/pressure/sensor mutable true
hsetprop ${scobj_hpath}/pressure/sensor nxsave true
hsetprop ${scobj_hpath}/pressure/sensor permlink data_set "P${permlink_device_number}S01"
hsetprop ${scobj_hpath}/pressure/sensor @description "P${permlink_device_number}S01"
hsetprop ${scobj_hpath}/pressure/sensor oldval 0.0
hsetprop ${scobj_hpath}/pressure/sensor klass "parameter"
hsetprop ${scobj_hpath}/pressure/sensor pid_control "/sample/tc9/Valve/Setpoint"
hsetprop ${scobj_hpath}/pressure/sensor pid_deriv "0"
hsetprop ${scobj_hpath}/pressure/sensor pid_dvalue "0.0"
@ -430,7 +439,7 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/pressure/setpoint driveable pressure/sensor
hsetprop ${scobj_hpath}/pressure/setpoint control true
hsetprop ${scobj_hpath}/pressure/setpoint data true
hsetprop ${scobj_hpath}/pressure/setpoint mutable false
hsetprop ${scobj_hpath}/pressure/setpoint mutable true
hsetprop ${scobj_hpath}/pressure/setpoint nxsave true
hsetprop ${scobj_hpath}/pressure/setpoint lowerlimit 0
hsetprop ${scobj_hpath}/pressure/setpoint upperlimit 1000
@ -438,6 +447,7 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/pressure/setpoint permlink data_set "P${permlink_device_number}SP01"
hsetprop ${scobj_hpath}/pressure/setpoint @description "P${permlink_device_number}SP01"
hsetprop ${scobj_hpath}/pressure/setpoint oldval 0.0
hsetprop ${scobj_hpath}/pressure/setpoint klass "parameter"
hsetprop ${scobj_hpath}/pressure/setpoint sdsinfo "::nexus::scobj::sdsinfo"
hsetprop ${scobj_hpath}/pressure/setpoint settle_time "90"
hsetprop ${scobj_hpath}/pressure/setpoint type "drivable"
@ -450,6 +460,7 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name } {
::scobj::pfeiffer_hg::sics_log 9 "[environment_simulation] => No poll/write for pfeiffer_hg"
}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
ansto_makesctdrive ${name}_pressure_setpoint ${scobj_hpath}/pressure/setpoint ${scobj_hpath}/pressure/sensor ${sct_controller}

View File

@ -1536,7 +1536,9 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
}
if {$pollEnabled == 1} {
# clientput "enabling polling for $nodeName"
$sct_controller poll $nodeName
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
$sct_controller poll $nodeName
}
}
hsetprop $nodeName $rdFunc ${ns}::$rdFunc $scobj_hpath $rdCmd $idx
if {$writable == 1} {
@ -1544,7 +1546,9 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
hsetprop $nodeName writestatus UNKNOWN
hsetprop $nodeName noResponse ${ns}::noResponse
if {$pollEnabled == 1} {
$sct_controller write $nodeName
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
$sct_controller write $nodeName
}
}
}
switch -exact $dataType {

View File

@ -1712,7 +1712,9 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
}
if {$pollEnabled == 1} {
# clientput "enabling polling for $nodeName"
$sct_controller poll $nodeName
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
$sct_controller poll $nodeName
}
}
hsetprop $nodeName $rdFunc ${ns}::$rdFunc $idx
if {$writable == 1} {
@ -1720,7 +1722,9 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
hsetprop $nodeName writestatus UNKNOWN
hsetprop $nodeName noResponse ${ns}::noResponse
if {$pollEnabled == 1} {
$sct_controller write $nodeName
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
$sct_controller write $nodeName
}
}
}
switch -exact $dataType {

View File

@ -734,8 +734,10 @@ namespace eval ::scobj::[set vendor]_[set device] {
if { $readable >= 0 && $readable <= 300 } {
set poll_period [expr {int($readable)}]
}
debug_log 1 "Registering node $nodeName for poll at $poll_period seconds"
$sct_controller poll $nodeName $poll_period
if {[SplitReply [environment_simulation]]=="false"} {
debug_log 1 "Registering node $nodeName for poll at $poll_period seconds"
$sct_controller poll $nodeName $poll_period
}
}
if {$writable == 1} {
# the node is writable so set it up to invoke a callback when written
@ -752,8 +754,10 @@ namespace eval ::scobj::[set vendor]_[set device] {
hsetprop $nodeName write ${ns}::$func_name $scobj_hpath $next_state $wrCmd
hsetprop $nodeName $next_state ${ns}::$next_state $scobj_hpath
hsetprop $nodeName writestatus UNKNOWN
debug_log 1 "Registering node $nodeName for write callback"
$sct_controller write $nodeName
if {[SplitReply [environment_simulation]]=="false"} {
debug_log 1 "Registering node $nodeName for write callback"
$sct_controller write $nodeName
}
}
# Initialise the previous value to test against
switch -exact $dataType {

View File

@ -546,12 +546,4 @@ namespace import ::scobj::itc500::*
#add_itc500 itc500 137.157.201.213 502 5
#add_itc500 itc500 localhost 30509 5
if { [ info exists ::config_dict ] && [ dict get $::config_dict mercury_itc500 enabled ] } {
clientput "ADD MERCURY ITC500 MODE"
set IP [dict get $::config_dict mercury_itc500 ip]
set PORT [dict get $::config_dict mercury_itc500 port]
set NAME [dict get $::config_dict mercury_itc500 name]
set TOL [dict get $::config_dict mercury_itc500 tol]
set ADDR [dict get $::config_dict mercury_itc500 addr]
add_itc500 $NAME $IP $PORT $TOL $ADDR
}

View File

@ -39,6 +39,7 @@ proc ::scobj::watlow_mpm::mkDriver { sct_controller name id datype dev_id tol }
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
mk_sct_watlow_pm $sct_controller environment $name $dev_id $tol $id $datype

View File

@ -39,6 +39,7 @@ proc ::scobj::watlow_mrm::mkDriver { sct_controller name id datype dev_id tol }
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
mk_sct_watlow_rm $sct_controller environment $name $dev_id $tol $id $datype

View File

@ -39,6 +39,7 @@ proc ::scobj::watlow_mst4::mkDriver { sct_controller name id datype dev_id tol }
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
mk_sct_watlow_st $sct_controller environment $name $dev_id $tol $id $datype

View File

@ -39,6 +39,7 @@ proc ::scobj::west4100::mkDriver { sct_controller name IP dev_id } {
set scobj_hpath /sics/${name}
hsetprop ${scobj_hpath} klass environment
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
::environment::temperature::mkwest400 $name $IP $dev_id

View File

@ -1,7 +1,6 @@
set magmot "som"
Motor $magmot $motor_driver_type [params \
asyncqueue mc2\
axis D\
asyncqueue $magmot_aq\
axis $magmot_axis\
units degrees\
hardlowerlim -1440\
hardupperlim 1440\

View File

@ -266,7 +266,7 @@ proc ::scobj::reactor_status::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath}/status rdAll ${ns}::rdAll ${scobj_hpath}
hsetprop ${scobj_hpath}/status control false
hsetprop ${scobj_hpath}/status data false
hsetprop ${scobj_hpath}/status mutable false
hsetprop ${scobj_hpath}/status mutable true
hsetprop ${scobj_hpath}/status nxsave true
hsetprop ${scobj_hpath}/status oldval UNKNOWN
hsetprop ${scobj_hpath}/status sdsinfo "::nexus::scobj::sdsinfo"
@ -297,6 +297,8 @@ proc ::scobj::reactor_status::mkDriver { sct_controller name } {
hsetprop ${scobj_hpath} control "true"
hsetprop ${scobj_hpath} data "true"
hsetprop ${scobj_hpath} klass "@none"
hsetprop ${scobj_hpath} type "part"
if {[string equal -nocase [SplitReply [opal_simulation]] "false"]} {
${sct_controller} poll ${scobj_hpath}/status 30
@ -304,6 +306,7 @@ proc ::scobj::reactor_status::mkDriver { sct_controller name } {
::scobj::reactor_status::sics_log 9 "[opal_simulation] => No poll/write for reactor_status"
}
hsetprop ${scobj_hpath} klass NXsource
hsetprop ${scobj_hpath} data true
hsetprop ${scobj_hpath} debug_threshold 5
# mkDriver hook code starts
# mkDriver hook code ends

View File

@ -24,54 +24,18 @@ Instrument bare_dingo
Instrument lock
#START SERVER CONFIGURATION SECTION
source util/dmc2280/dmc2280_util.tcl
source sics_ports.tcl
source server_config.tcl
set sicsroot ../
source util/utility.tcl
ServerOption LogFileBaseName $sicsroot/log/serverlog
###### installprotocolhandler
ServerOption statusfile $sicsroot/log/status.tcl
ServerOption RedirectFile $sicsroot/log/stdout
ServerOption LogFileDir $sicsroot/log
ServerOption QuieckPort [get_portnum $quieckport ]
ServerOption ServerPort [get_portnum $serverport ]
ServerOption InterruptPort [get_portnum $interruptport ]
ServerOption TelWord sicslogin
ServerOption TelnetPort [get_portnum $telnetport ]
ServerOption ReadUserPasswdTimeout 600000
ServerOption AcceptTimeOut 10
ServerOption ReadTimeOut 1000
SicsUser manager ansto 1
SicsUser user sydney 2
SicsUser spy 007 3
Motor dummy_motor asim [params \
asyncqueue mc1\
host mc1-dingo\
port pmc1-dingo\
axis A\
units mm\
hardlowerlim -500\
hardupperlim 500\
maxSpeed 1\
maxAccel 5\
maxDecel 5\
stepsPerX [expr 25000.0/5.0]\
absEnc 1\
absEncHome 0\
cntsPerX [expr 8192.0/5.0]]
dummy_motor part instrument
dummy_motor long_name dummy_motor
dummy_motor softlowerlim -500
dummy_motor softupperlim 500
dummy_motor home 0
MakeDrive
#END SERVER CONFIGURATION SECTION
########################################
# INSTRUMENT SPECIFIC CONFIGURATION
fileeval $cfPath(source)/source.tcl
fileeval $cfPath(plc)/plc.tcl
fileeval $cfPath(motors)/motor_configuration.tcl
#MakeAsyncQueue cmserver CAMERA localhost 63300
MakeAsyncQueue cmserver CAMERA [dict get $::CAMERA_HOSTPORT HOST] [dict get $::CAMERA_HOSTPORT PORT]
#MakeAsyncQueue cmserver CAMERA 137.157.204.193 33000
@ -81,6 +45,7 @@ MakeAsyncQueue cmserver CAMERA [dict get $::CAMERA_HOSTPORT HOST] [dict get $::C
MakeCounter cm1 anstocamera cmserver
MakeScanCommand iscan cm1 dingo.hdd recover.bin
foreach {n v} {
debug 0
clock 1
bin 1
size 2048

View File

@ -1,5 +1,9 @@
config/source/reactor_status_sct.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/source/source.tcl
config/anticollider/anticollider_common.tcl
config/plc/plc_common_1.tcl
@ -16,5 +20,8 @@ config/scan/scan_common_1.hdd
config/scan/scan_common_1.tcl
config/nexus/nxscripts_common_1.tcl
config/commands/commands_common.tcl
config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/motors/magnet_configuration.tcl

View File

@ -0,0 +1,14 @@
*************************** DINGO Data File *******************************
Title = !!VAR(Title)!!
User = !!VAR(User)!!
File Creation Startdate: !!DATE!!
****************************************************************************
Dummy dummy_motor = !!DRIV(dummy_motor)!!
----------------------------------------------------------------------------
Zero dummy_motor = !!ZERO(dummy_motor)!!
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Scan Zero:
!!SCANZERO!!
**************************** DATA ******************************************

View File

@ -1,154 +1,29 @@
source $cfPath(scan)/scan_common_1.tcl
proc ::scan::pre_hmm_scan_prepare {} {}
namespace eval ::scan { }
proc scan_file { fname {description ""} } {
set file_cmd "set file,path=D:\Data,basename=${fname},startnumber=1,imageformat=tif,experimentdetail=${description}"
cmserver send $file_cmd
}
publish scan_file user
proc ::scan::cm_count {sobj uobj point mode preset} {
# send "clear meta" command to the camera server
clientput "sending clear meta"
set cmd "clear meta\r\n"
cm1 send $cmd
# send motor position
cm1_cmd clearmeta
foreach m "[sicslist type motor]" {
if {$m == "motor" || $m == "dummy_motor"} {
# skipit
} else {
set cmd "set camera, "
append cmd "[$m]"
append cmd "\r\n"
cm1 send $cmd
if {$m != "dummy_motor"} {
cm1_cmd motor $m
}
}
cm1 count $preset
}
proc ::scan::cm_scan_prepare {sobj uobj} {
variable save_filetype
variable check_instrument_ready
variable force_scan
# [::plc::inst_ready]
if {$force_scan || $check_instrument_ready} {
set force_scan false
if [catch {
::scan::check_scanvar $sobj $uobj
::scan::pre_hmm_scan_prepare
}] {
return -code error "ISCAN ABORTED: $::errorInfo"
}
# send "shutter auto" command over
shutter auto
# send "focusflight off" command over
focuslight off
# send "clear meta" command to the camera server
clientput "sending clear meta"
set cmd "clear meta\r\n"
cm1 send $cmd
# send motor position
foreach m "[sicslist type motor]" {
if {$m == "motor" || $m == "dummy_motor"} {
# skipit
} else {
set cmd "set camera, "
append cmd "[$m]"
append cmd "\r\n"
cm1 send $cmd
}
}
if [catch {
#TODO Parameterise varindex in some way
set varindex 0;
set numpoints [SplitReply [$sobj np]]
set vlist [split [$sobj getvarpar $varindex] = ]
set scanstart [lindex $vlist 1]
set scanstep [lindex $vlist 2]
#::scan::camscan_cmd -set NP $numpoints
#::scan::camscan_cmd -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]];
#::scan::camscan_cmd -set scan_start $scanstart
#::scan::camscan_cmd -set scan_increment $scanstep
set scanvar_pts [SplitReply [$sobj getvardata $varindex]]
#::scan::camscan_cmd -set feedback status BUSY
clientput "run_mode camscan"
run_mode "camscan"
#::nexus::newfile BEAM_MONITOR $save_filetype
stdscan prepare $sobj $uobj;
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
}] {
run_mode "normal"
return -code error $::errorInfo
}
} else {
return -code error "ISCAN ABORTED: Instrument not ready"
}
}
proc ::scan::cm_scan_collect {sobj uobj point} {
set vlist [split [$sobj getvarpar 0] = ];
set w(NP) $point
set sv [string trim [lindex [split [lindex $vlist 0] . ] 1]]
set header [format "%-4.4s %-9.9s %-14s %-7.7s" NP $sv Counts Time]
set varval [SplitReply [$sv]]
set counts [SplitReply [::histogram_memory::total_counts]]
set time [SplitReply [::histogram_memory::time]]
set data [format "%-4d %-9.3f %-14d %-7.2f" $point $varval $counts $time]
clientput $header
clientput $data
for {set bmn 1} {$bmn <= $::counter::isc_numchannels} {incr bmn} {
set bmon bm$bmn
clientput "Monitor $bmn [SplitReply [$bmon getcounts]]"
}
}
publish ::scan::cm_count user
publish ::scan::cm_scan_prepare user
publish ::scan::cm_scan_collect user
proc ::scan::isc_initialize {} {
#::scan::ic_initialize
if [ catch {
variable ic_runscanpar
variable ic_hmm_datatype
set ic_hmm_datatype HISTOGRAM_XYT
MakeScanCommand camscan cm1 $::cfPath(scan)/scan_common_1.hdd recover.bin
camscan configure script
#camscan function writeheader ::scan::donothing
#camscan function writepoint ::scan:cm_writepoint
camscan function count ::scan::cm_count
#camscan function collect ::scan::cm_scan_collect
camscan function prepare ::scan::cm_scan_prepare
#camscan function finish ::scan::cm_scan_finish
# TODO Use ic_runscanpar to create the ::scan::runscan command and
# to validate the "runscan" proc parameters.
array set ic_runscanpar [subst {
scanvar text=drivable
start float
stop float
numpoints int=0,inf
mode text=[join [concat [list time unlimited period count frame] $::counter::isc_beam_monitor_list ] , ]
preset float=0,inf
datatype text=[join [array names ::nexus::histmem_filetype_spec] , ]
savetype text=save,nosave
force boolean
}]
#scriptcallback connect hmscan SCANEND ::scan::hmscanend_event
#scriptcallback connect bmonscan SCANEND ::scan::bmonscanend_event
scriptcallback connect camscan SCANEND ::scan::cmscanend_event
} message ] {
if {$::errorCode=="NONE"} {return $message}
return -code error $message
}
MakeAsyncQueue cmserver CAMERA [dict get $::CAMERA_HOSTPORT HOST] [dict get $::CAMERA_HOSTPORT PORT]
MakeCounter cm1 anstocamera cmserver
foreach {n v} {
debug 0
clock 1
bin 1
size 2048
@ -158,12 +33,16 @@ proc ::scan::isc_initialize {} {
ystart 1
xend 2048
yend 2048
exposure 0.777
temperature -50
exposure 60
temperature -80
threshold 800
shutteropentime 100
shutterclosetime 200
} {
cm1 setpar $n 0 $v
}
MakeScanCommand camscan cm1 $::cfPath(scan)/dingo.hdd recover.bin
camscan configure script
camscan function count ::scan::cm_count
}

View File

@ -1,8 +1,8 @@
# Author: Jing Chen (jgn@ansto.gov.au)
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Required by server_config.tcl
VarMake Instrument Text Internal
Instrument dingo
Instrument bare_dingo
Instrument lock
#START SERVER CONFIGURATION SECTION
@ -14,46 +14,12 @@ MakeDrive
########################################
# INSTRUMENT SPECIFIC CONFIGURATION
source $cfPath(hipadaba)/hipadaba_configuration.tcl
fileeval $cfPath(source)/source.tcl
fileeval $cfPath(motors)/motor_configuration.tcl
#fileeval $cfPath(motors)/positmotor_configuration.tcl
#fileeval $cfPath(motors)/extraconfig.tcl
fileeval $cfPath(plc)/plc.tcl
fileeval $cfPath(counter)/counter.tcl
fileeval $cfPath(hmm)/hmm_configuration.tcl
fileeval $cfPath(nexus)/nxscripts.tcl
fileeval $cfPath(motors)/motor_configuration.tcl
fileeval $cfPath(scan)/scan.tcl
fileeval $cfPath(commands)/commands.tcl
fileeval $cfPath(commands)/pulser.tcl
fileeval $cfPath(commands)/hvcommands.tcl
fileeval $cfPath(anticollider)/anticollider.tcl
source gumxml.tcl
#::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
#::anticollider::protect_detector "true"
# fix all motors
if {1} {
set motorlist "[sicslist type motor]"
puts $motorlist
foreach m $motorlist {
if {$m == "motor" || $m == "dummy_motor"} {
# skipit
} else {
$m fixed 1
}
}
}
server_init
exe batchpath ../batch
exe syspath ../batch
clientput "serverport [get_portnum $::serverport]"
###########################################
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
# You can add extra-configuration code in ../extraconfig.tcl

View File

@ -5,6 +5,10 @@ config/plc/plc_common_1.tcl
config/counter/counter_common_1.tcl
config/hipadaba/hipadaba_configuration_common.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/hipadaba/common_instrument_dictionary.tcl
config/hipadaba/instdict_specification.tcl
config/hmm/hmm_configuration_common_1.tcl
@ -19,4 +23,4 @@ config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/motors/sct_aerotech_soloist.tcl
config/motors/magnet_configuration.tcl

View File

@ -143,7 +143,10 @@ switch $axis_config {
3 {
# Rename the sample stage som to somss because
# som now controls the magnet sample stick
set sample_stage_rotate "somss"
set sample_stage_rotate "som"
set magmot "msom"
set magmot_aq "mc2"
set magmot_axis "D"
fileeval $cfPath(motors)/magnet_configuration.tcl
}
}

View File

@ -33,24 +33,27 @@ fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl
fileeval $cfPath(environment)/temperature/eurotherm_m2000_sct.tcl
fileeval $cfPath(environment)/sct_keithley_2700.tcl
fileeval $cfPath(environment)/keithley_m2700_sct.tcl
fileeval $cfPath(environment)/lakeshore_218_sct.tcl
fileeval $cfPath(environment)/temperature/lakeshore_218_sct.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl
fileeval $cfPath(environment)/temperature/ls336_sct.tcl
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)/lakeshore_m370_sct.tcl
fileeval $cfPath(environment)/temperature/lakeshore_m370_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_base_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_level_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_pres_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_scpi_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_temp_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_valve_sct.tcl
fileeval $cfPath(environment)/sct_protek_common.tcl
fileeval $cfPath(environment)/protekmm_sct.tcl
fileeval $cfPath(environment)/temperature/sct_julabo_lh45.tcl
fileeval $cfPath(environment)/temperature/julabo_lh45_gen_sct.tcl
fileeval $cfPath(environment)/temperature/sct_qlink.tcl
fileeval $cfPath(environment)/temperature/west400.tcl
fileeval $cfPath(environment)/temperature/west4100_sct.tcl
fileeval $cfPath(environment)/temperature/sct_oxford_mercury.tcl
fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl
fileeval $cfPath(environment)/he3/sct_he3.tcl
fileeval $cfPath(environment)/he3/sct_hmp_power.tcl
fileeval $cfPath(environment)/magneticField/sct_green_magnet.tcl
fileeval $cfPath(hmm)/hmm_configuration.tcl
fileeval $cfPath(nexus)/nxscripts.tcl

View File

@ -5,6 +5,10 @@ config/plc/plc_common_1.tcl
config/counter/counter_common_1.tcl
config/hipadaba/hipadaba_configuration_common.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/hipadaba/common_instrument_dictionary.tcl
config/hipadaba/instdict_specification.tcl
config/hmm/hmm_configuration_common_1.tcl
@ -20,3 +24,4 @@ config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/motors/magnet_configuration.tcl

View File

@ -95,9 +95,53 @@ set slit2HGroup second/horizontal
# hnotify messages to a reasonable level
set move_count 10
fileeval $cfPath(motors)/tilt_configuration.tcl
#fileeval $cfPath(motors)/small_omega.tcl
#fileeval $cfPath(motors)/euler_configuration.tcl
##########################################
# Set axis_config as follows to use different axis configurations
# 0: tilt stage configuration
# 1: eulerian cradle
# 2: small omega
# 3: Oxford magnet sample stick
set axis_config 0
if { [ info exists ::config_dict ] } {
if { [ dict exists $::config_dict sample_stage implementation ] } {
set implementation [ dict get $::config_dict sample_stage implementation ]
if {$implementation == "normal_sample_stage"} {
set axis_config 0
} elseif {$implementation == "eularian_cradle"} {
set axis_config 1
} elseif {$implementation == "small_omega"} {
set axis_config 2
} elseif {$implementation == "12tmagnet_sample_insert"} {
set axis_config 3
} else {
set axis_config 0
}
}
}
switch $axis_config {
0 {
set sample_stage_rotate "som"
fileeval $cfPath(motors)/tilt_configuration.tcl
}
1 {
set sample_stage_rotate "som"
fileeval $cfPath(motors)/euler_configuration.tcl
}
2 {
set sample_stage_rotate "som"
fileeval $cfPath(motors)/small_omega_config.tcl
}
3 {
set sample_stage_rotate "som"
set magmot "msom"
set magmot_aq "mc2"
set magmot_axis "D"
fileeval $cfPath(motors)/magnet_configuration.tcl
}
}
############################
# Motor Controller 1
# Motor Controller 1
@ -359,7 +403,7 @@ scr long_name secondary_collimator_rotation
############################
# Sample Omega, rotate
Motor som $motor_driver_type [params \
Motor $sample_stage_rotate $motor_driver_type [params \
asyncqueue mc2\
axis E\
units degrees\
@ -372,12 +416,12 @@ Motor som $motor_driver_type [params \
absEnc 1\
absEncHome $som_Home\
cntsPerX 4096]
setHomeandRange -motor som -home 0 -lowrange 169 -uprange 167
som speed 1
som movecount $move_count
som precision 0.01
som part sample
som long_name rotate
setHomeandRange -motor $sample_stage_rotate -home 0 -lowrange 169 -uprange 167
$sample_stage_rotate speed 1
$sample_stage_rotate movecount $move_count
$sample_stage_rotate precision 0.01
$sample_stage_rotate part sample
$sample_stage_rotate long_name rotate
# Sample two-theta, detector rotate
Motor stth $motor_driver_type [params \

View File

@ -0,0 +1,91 @@
# This must be loaded by motor_configuration.tcl
set sphi_Home 7937974
set schi_Home 7585956
set sy_Home 7557524
set sx_Home 7557304
# Sample Tilt 1, upper, phi
Motor sphi $motor_driver_type [params \
asyncqueue mc2\
axis A\
units degrees\
hardlowerlim -360\
hardupperlim 360\
maxSpeed 3\
maxAccel 2\
maxDecel 2\
stepsPerX 25000\
absEnc 0\
absEncHome $sphi_Home\
cntsPerX -8192]
setHomeandRange -motor sphi -home 0 -lowrange -360 -uprange 360
sphi speed 2
sphi movecount $move_count
sphi precision 0.02
sphi part sample
sphi long_name phi
# Sample Tilt 2, lower, chi
Motor schi $motor_driver_type [params \
asyncqueue mc2\
axis B\
units degrees\
hardlowerlim 75\
hardupperlim 105\
maxSpeed 1\
maxAccel 1\
maxDecel 1\
stepsPerX 25000\
absEnc 1\
absEncHome $schi_Home\
cntsPerX 8192]
setHomeandRange -motor schi -home 90 -lowrange 15 -uprange 15
schi speed 1
schi movecount $move_count
schi precision 0.01
schi part sample
schi long_name chi
# Sample Trans 1, upper, y
Motor sy $motor_driver_type [params \
asyncqueue mc2\
axis C\
units mm\
hardlowerlim -20\
hardupperlim 20\
maxSpeed 1\
maxAccel 1\
maxDecel 1\
stepsPerX 25000\
absEnc 1\
absEncHome $sy_Home\
cntsPerX 8192]
setHomeandRange -motor sy -home 0 -lowrange 20 -uprange 20
sy speed 1
sy movecount $move_count
sy precision 0.01
sy part sample
sy long_name translate_y
# Sample Trans2, lower, x
Motor sx $motor_driver_type [params \
asyncqueue mc2\
axis D\
units mm\
hardlowerlim -20\
hardupperlim 20\
maxSpeed 1\
maxAccel 1\
maxDecel 1\
stepsPerX -25000\
absEnc 1\
absEncHome $sx_Home\
cntsPerX -8192]
setHomeandRange -motor sx -home 0 -lowrange 20 -uprange 20
sx speed 1
sx movecount $move_count
sx precision 0.01
sx part sample
sx long_name translate_x

View File

@ -1,171 +1,295 @@
[12tmagnet]
desc = "12 Tesla Oxford Magnet"
driver = "12tmagnet"
[12tmagnet_setup]
cascade = B1:12tmagnet_oxford,sample_stage:12tmagnet_sample_insert,T1:mercury_scpi_01
enabled = False
group = environment:magnet
id = 27
[CF1]
cascade = T1:CF1_ls340,sample_stage:normal_sample_stage
enabled = False
[CF8]
cascade = T1:ls336_01,T2:ls340_11,sample_stage:normal_sample_stage
enabled = False
[Default]
cascade = sample_stage:normal_sample_stage
enabled = True
[B1]
datype = B
enabled = False
id = 1
implementation = none
name = magnet1
optype = magnetic_field
[Function_Generator]
datype = V
enabled = False
id = 1
implementation = none
name = pulser
optype = function_generator
[I1]
datype = I
enabled = False
id = 1
implementation = none
name = curr1
optype = multimeter
[I2]
datype = I
enabled = False
id = 2
implementation = none
name = curr2
optype = multimeter
[T1]
datype = T
enabled = False
id = 1
implementation = none
name = tc1
optype = temperature
[T2]
datype = T
enabled = False
id = 2
implementation = none
name = tc2
optype = temperature
[T3]
datype = T
enabled = False
id = 3
implementation = none
name = tc3
optype = temperature
[T4]
datype = T
enabled = False
id = 4
implementation = none
name = tc4
optype = temperature
[T5]
datype = T
enabled = False
id = 5
implementation = none
name = tc5
optype = temperature
[T6]
datype = T
enabled = False
id = 6
implementation = none
name = tc6
optype = temperature
[V1]
datype = V
enabled = False
id = 1
implementation = none
name = volts1
optype = multimeter
[V2]
datype = V
enabled = False
id = 2
implementation = none
name = volts2
optype = multimeter
[sample_stage]
enabled = Always
implementation = normal_sample_stage
name = sample_stage
optype = motion_axis
[12tmagnet_oxford]
desc = "12 Tesla Oxford Magnet"
driver = "oxford_labview"
imptype = magnetic_field
ip = 10.157.205.3
name = magnetic
port = 55001
type = B
[12tmagnet_sample_insert]
desc = "REVIEW THIS -> som will be redefined as the sample insert rotation. Sample stage will be renamed to somss"
enabled = False
group = motors
desc = "som will be redefined as the magnet sample insert rotation. Sample stage will be renamed to somss"
imptype = motion_axis
[12tmagnet_setup]
cascade = 12tmagnet,12tmagnet_sample_insert,mercury_scpi
enabled = False
group = 0setup
[ls336_1]
desc = "tc1: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False
group = environment:temperature
id = 1
ip = 10.157.205.28
name = tc1
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
type = T
[ls336_11]
desc = "tc11: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False
group = environment:temperature
id = 11
ip = 10.157.205.27
name = tc11
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
type = T
[ls336_12]
desc = "tc12: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False
group = environment:temperature
id = 12
ip = 10.157.205.31
name = tc12
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
type = T
[ls336_2]
desc = "tc2: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False
group = environment:temperature
id = 2
ip = 10.157.205.29
name = tc2
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
type = T
[ls336_4]
desc = "tc4: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False
group = environment:temperature
id = 4
ip = 10.157.205.30
name = tc4
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
type = T
[ls336_5]
desc = "tc5: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False
group = environment:temperature
id = 5
ip = 137.157.201.21
name = tc5
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
type = T
[ls336_6]
desc = "tc6: Lakeshore 336 temperature controller"
driver = "ls336"
enabled = False
group = environment:temperature
id = 6
ip = 137.157.201.21
name = tc6
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
type = T
[ls340_1]
desc = "tc13: Lakeshore 340 temperature controller"
[CF1_ls340]
desc = "cf1: Bottom loading cryofurnace"
driver = "ls340"
enabled = False
group = environment:temperature
id = 13
ip = ca5-echidna
name = tc13
imptype = temperature
ip = 10.157.205.43
port = 4001
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
type = T
[ls340_2]
desc = "tc14: Lakeshore 340 temperature controller"
[agilent_33220A]
asyncqueue = sct
desc = "Function Generator"
driver = agilent_33220A
imptype = function_generator
ip = 10.157.205.16
port = 5025
[eularian_cradle]
desc = "Load the Eulerian cradle configuration"
imptype = motion_axis
[ls336_01]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.28
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_02]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.29
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_04]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.30
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_05]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 137.157.201.21
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_06]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 137.157.201.21
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_11]
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.27
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_12]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.31
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls340_01]
asyncqueue = sct
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
enabled = False
group = environment:temperature
id = 14
ip = ca5-echidna
name = tc14
imptype = temperature
ip = 137.157.201.86
port = 4001
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls340_02]
asyncqueue = sct
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 137.157.201.86
port = 4002
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
type = T
[mercury_scpi]
desc = "tc25: Oxford Mercury temperature controller in Mercury mode"
[ls340_11]
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 137.157.201.86
port = 4001
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[mercury_scpi_01]
desc = "Oxford Mercury temperature controller in Mercury mode"
driver = "mercury_scpi"
enabled = False
group = environment:temperature
id = 25
imptype = temperature
ip = 10.157.205.5
name = tc25
offifon = mercury_itc500
permlink = LT
port = 7020
terminator = \r
tol = 2.0
type = T
terminator = \r\n
tol = 1.0
valve_tol = 2
[mercury_scpi_02]
desc = "Oxford Mercury temperature controller in Mercury mode"
driver = "mercury_scpi"
imptype = temperature
ip = 10.157.205.47
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
[normal_sample_stage]
desc = "This is the default sample stage configuration with xy translation and phi and chi tilt stages"
imptype = motion_axis
[protek_01]
asyncqueue = sct
desc = "Protek Multimeter"
driver = "protekmm"
imptype = multimeter
ip = 10.157.205.36
port = 4001
[protek_02]
asyncqueue = sct
desc = "Protek Multimeter"
driver = "protekmm"
imptype = multimeter
ip = 10.157.205.37
port = 4001
[small_omega]
desc = "Load the small omega configuration"
imptype = motion_axis
[west4100]
desc = "tc26: Blue furnace temperature controller"
desc = "Blue furnace temperature controller"
dev_id = 1
driver = "west4100"
enabled = False
group = environment:temperature
id = 26
imptype = temperature
ip = 10.157.205.19
name = tc26
type = T

View File

@ -1,5 +1,9 @@
config/source/reactor_status_sct.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/source/source.tcl
config/anticollider/anticollider_common.tcl
config/plc/plc_common_1.tcl
@ -15,5 +19,8 @@ config/scan/scan_common_1.hdd
config/scan/scan_common_1.tcl
config/nexus/nxscripts_common_1.tcl
config/commands/commands_common.tcl
config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/motors/magnet_configuration.tcl

View File

@ -1,5 +1,9 @@
config/source/reactor_status_sct.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/source/source.tcl
config/anticollider/anticollider_common.tcl
config/plc/plc_common_1.tcl
@ -15,5 +19,8 @@ config/scan/scan_common_1.hdd
config/scan/scan_common_1.tcl
config/nexus/nxscripts_common_1.tcl
config/commands/commands_common.tcl
config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/motors/magnet_configuration.tcl

View File

@ -4,6 +4,10 @@ config/plc/plc_common_1.tcl
config/counter/counter_common_1.tcl
config/hipadaba/hipadaba_configuration_common.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/hipadaba/common_instrument_dictionary.tcl
config/hipadaba/instdict_specification.tcl
config/hmm/hmm_configuration_common_1.tcl
@ -13,5 +17,8 @@ config/scan/scan_common_1.hdd
config/scan/scan_common_1.tcl
config/nexus/nxscripts_common_1.tcl
config/commands/commands_common.tcl
config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/motors/magnet_configuration.tcl

View File

@ -15,6 +15,13 @@ config/scan/scan_common_1.hdd
config/scan/scan_common_1.tcl
config/nexus/nxscripts_common_1.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/commands/commands_common.tcl
config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/motors/magnet_configuration.tcl

View File

@ -67,6 +67,40 @@ set gv1_Shut 33221600
# hnotify messages to a reasonable level
set move_count 100
# CHOOSE HERE for sample stage configuration
##########################################
# Set axis_config as follows to use different axis configurations
# 0: normal stage configuration
# 1: Oxford magnet sample stick
set axis_config 0
if { [ info exists ::config_dict ] } {
if { [ dict exists $::config_dict sample_stage implementation ] } {
set implementation [ dict get $::config_dict sample_stage implementation ]
if {$implementation == "normal_sample_stage"} {
set axis_config 0
} elseif {$implementation == "12tmagnet_sample_insert"} {
set axis_config 1
} else {
set axis_config 0
}
}
}
switch $axis_config {
0 {
set use_normal_config "true"
}
1 {
set magmot "mscor"
set magmot_aq "mc2"
set magmot_axis "F"
set use_normal_config "false"
fileeval $cfPath(motors)/magnet_configuration.tcl
}
}
############################
# Motor Controller 1
# Motor Controller 1
@ -381,29 +415,31 @@ gom softlowerlim -15
gom softupperlim 15
gom home 0
if {$use_normal_config == "true"} {
# mc2: Sample rotation correction - 10 deg rotation
set scorStepRate [expr { 25000.0 * 100.0 / 360.0 }]
set scorStepRate [expr { 25000.0 * 100.0 / 360.0 }]
Motor scor $motor_driver_type [params \
asyncqueue mc2\
host mc2-pelican\
port pmc2-pelican\
axis F\
units degrees\
hardlowerlim 0\
hardupperlim 360\
maxSpeed [expr 25000.0/$scorStepRate]\
maxAccel [expr 25000.0/$scorStepRate]\
maxDecel [expr 25000.0/$scorStepRate]\
stepsPerX $scorStepRate\
absEnc 1\
absEncHome $scor_Home\
cntsPerX -[expr { 8192.0 * 100.0 / 360.0 }]]
scor part sample
scor long_name scor
scor softlowerlim 0
scor softupperlim 360
scor home 180
Motor scor $motor_driver_type [params \
asyncqueue mc2\
host mc2-pelican\
port pmc2-pelican\
axis F\
units degrees\
hardlowerlim 0\
hardupperlim 360\
maxSpeed [expr 25000.0/$scorStepRate]\
maxAccel [expr 25000.0/$scorStepRate]\
maxDecel [expr 25000.0/$scorStepRate]\
stepsPerX $scorStepRate\
absEnc 1\
absEncHome $scor_Home\
cntsPerX -[expr { 8192.0 * 100.0 / 360.0 }]]
scor part sample
scor long_name scor
scor softlowerlim 0
scor softupperlim 360
scor home 180
}
############################
# Motor Controller 3

View File

@ -28,14 +28,43 @@ fileeval $cfPath(motors)/positmotor_configuration.tcl
fileeval $cfPath(plc)/plc.tcl
fileeval $cfPath(counter)/counter.tcl
#fileeval $cfPath(beamline)/sct_power.tcl
fileeval $cfPath(environment)/agilent_33220A_sct.tcl
fileeval $cfPath(environment)/hiden_xcs_sct.tcl
fileeval $cfPath(environment)/huber_pilot_sct.tcl
fileeval $cfPath(environment)/isotech_ps_sct.tcl
fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl
fileeval $cfPath(environment)/temperature/eurotherm_m2000_sct.tcl
fileeval $cfPath(environment)/sct_keithley_2700.tcl
fileeval $cfPath(environment)/keithley_m2700_sct.tcl
fileeval $cfPath(environment)/temperature/lakeshore_218_sct.tcl
fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl
fileeval $cfPath(environment)/temperature/ls336_sct.tcl
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/mercury_base_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_level_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_pres_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_scpi_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_temp_sct.tcl
fileeval $cfPath(environment)/temperature/mercury_valve_sct.tcl
fileeval $cfPath(environment)/sct_protek_common.tcl
fileeval $cfPath(environment)/protekmm_sct.tcl
fileeval $cfPath(environment)/temperature/julabo_lh45_gen_sct.tcl
fileeval $cfPath(environment)/temperature/sct_qlink.tcl
fileeval $cfPath(environment)/temperature/west400.tcl
fileeval $cfPath(environment)/temperature/west4100_sct.tcl
fileeval $cfPath(environment)/magneticField/sct_oxford_labview.tcl
fileeval $cfPath(environment)/he3/sct_he3.tcl
fileeval $cfPath(environment)/magneticField/sct_green_magnet.tcl
fileeval $cfPath(hmm)/hmm_configuration.tcl
fileeval $cfPath(hmm)/sct_hv.tcl
fileeval $cfPath(nexus)/nxscripts.tcl
fileeval $cfPath(scan)/scan.tcl
fileeval $cfPath(commands)/commands.tcl
fileeval $cfPath(commands)/pulser.tcl
fileeval $cfPath(commands)/hvcommands.tcl
fileeval $cfPath(commands)/monodrive.tcl
fileeval $cfPath(anticollider)/anticollider.tcl
fileeval $cfPath(chopper)/sct_fermichopper.tcl
@ -62,12 +91,16 @@ proc mkrunargs {args} {
proc run {args} {
set runargs [eval "mkrunargs $args"]
eval "sicsrun $runargs"
anstocapture sicsrun {*}$runargs
#NOTE The return prevents seeing the message twice. See SICS-764 and SICS-765
return;
}
proc drive {args} {
set runargs [eval "mkrunargs $args"]
eval "sicsdrive $runargs"
anstocapture sicsdrive {*}$runargs
#NOTE The return prevents seeing the message twice. See SICS-764 and SICS-765
return;
}
publish run user

View File

@ -0,0 +1,287 @@
[12tmagnet_setup]
cascade = B1:12tmagnet_oxford,sample_stage:12tmagnet_sample_insert,T1:mercury_scpi_01
enabled = False
[CF3]
cascade = T1:ls340_pelican,sample_stage:normal_sample_stage
enabled = False
[CF8]
cascade = T1:ls336_01,T2:ls340_11,sample_stage:normal_sample_stage
enabled = False
[Default]
cascade = sample_stage:normal_sample_stage
enabled = True
[OC1]
cascade = T1:OC1_ls340,sample_stage:normal_sample_stage
enabled = False
[B1]
datype = B
enabled = False
id = 1
implementation = none
name = magnet1
optype = magnetic_field
[Function_Generator]
datype = V
enabled = False
id = 1
implementation = none
name = pulser
optype = function_generator
[I1]
datype = I
enabled = False
id = 1
implementation = none
name = curr1
optype = multimeter
[I2]
datype = I
enabled = False
id = 2
implementation = none
name = curr2
optype = multimeter
[T1]
datype = T
enabled = False
id = 1
implementation = none
name = tc1
optype = temperature
[T2]
datype = T
enabled = False
id = 2
implementation = none
name = tc2
optype = temperature
[T3]
datype = T
enabled = False
id = 3
implementation = none
name = tc3
optype = temperature
[T4]
datype = T
enabled = False
id = 4
implementation = none
name = tc4
optype = temperature
[V1]
datype = V
enabled = False
id = 1
implementation = none
name = volts1
optype = multimeter
[V2]
datype = V
enabled = False
id = 2
implementation = none
name = volts2
optype = multimeter
[sample_stage]
enabled = Always
implementation = normal_sample_stage
name = sample_stage
optype = motion_axis
[12tmagnet_oxford]
desc = "12 Tesla Oxford Magnet"
driver = "oxford_labview"
imptype = magnetic_field
ip = 10.157.205.3
port = 55001
[12tmagnet_sample_insert]
desc = "scor will be redefined as the magnet sample insert rotation."
imptype = motion_axis
[OC1_ls340]
asyncqueue = sct
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 10.157.205.41
port = 4001
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[agilent_33220A]
asyncqueue = sct
desc = "Function Generator"
driver = agilent_33220A
imptype = function_generator
ip = 10.157.205.16
port = 5025
[ls336_01]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.28
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_02]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.29
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_04]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.30
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_05]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 137.157.201.21
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_06]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 137.157.201.21
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_11]
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.27
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls336_12]
asyncqueue = sct
desc = "Lakeshore 336 temperature controller"
driver = "ls336"
imptype = temperature
ip = 10.157.205.31
port = 7777
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls340_01]
asyncqueue = sct
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 137.157.201.86
port = 4001
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls340_02]
asyncqueue = sct
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 137.157.201.86
port = 4002
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls340_11]
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 137.157.201.86
port = 4001
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[ls340_pelican]
desc = "Lakeshore 340 temperature controller"
driver = "ls340"
imptype = temperature
ip = 137.157.202.214
port = 4001
terminator = \r\n
tol1 = 1.0
tol2 = 1.0
[mercury_scpi_01]
desc = "Oxford Mercury temperature controller with three temperature loops."
driver = "mercury_base"
imptype = temperature
ip = 10.157.205.5
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
[mercury_scpi_02]
desc = "Oxford Mercury temperature controller with four temperature loops and needle valve control"
driver = "mercury_scpi"
imptype = temperature
ip = 10.157.205.47
permlink = LT
port = 7020
terminator = \r\n
tol = 1.0
valve_tol = 2
[normal_sample_stage]
desc = "This is the default sample stage configuration"
imptype = motion_axis
[protek_01]
asyncqueue = sct
desc = "Protek Multimeter"
driver = "protekmm"
imptype = multimeter
ip = 10.157.205.36
port = 4001
[protek_02]
asyncqueue = sct
desc = "Protek Multimeter"
driver = "protekmm"
imptype = multimeter
ip = 10.157.205.37
port = 4001
[west4100]
desc = "Blue furnace temperature controller"
dev_id = 1
driver = "west4100"
imptype = temperature
ip = 10.157.205.19

View File

@ -18,3 +18,8 @@ config/commands/pulser.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/motors/magnet_configuration.tcl

View File

@ -5,6 +5,10 @@ config/plc/plc_common_1.tcl
config/counter/counter_common_1.tcl
config/hipadaba/hipadaba_configuration_common.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/hipadaba/common_instrument_dictionary.tcl
config/hipadaba/instdict_specification.tcl
config/hmm/hmm_configuration_common_1.tcl
@ -18,3 +22,4 @@ config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/motors/magnet_configuration.tcl

View File

@ -17,6 +17,10 @@ config/commands/commands_common.tcl
config/commands/pulser.tcl
config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/environment/
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/motors/sct_jogmotor_common.tcl
config/motors/magnet_configuration.tcl

View File

@ -269,14 +269,14 @@ proc server_set_sobj_attributes {} {
proc server_init {} {
global AUTOSAVE_STATE
if [ catch { ::source::isc_initialize } msg ] { puts $msg }
if [ catch { ::counter::isc_initialize } msg ] { puts $msg }
if [ catch { ::histogram_memory::isc_initialize } msg ] { puts $msg }
if [ catch { ::scan::isc_initialize } msg ] { puts $msg }
if [ catch { ::anticollider::init } msg ] { puts $msg }
if [ catch { ::commands::isc_initialize } msg ] { puts $msg }
if [ catch { ::nexus::isc_initialize } msg ] { puts $msg }
set catch_status [ catch {
::source::isc_initialize
::counter::isc_initialize
::histogram_memory::isc_initialize
::scan::isc_initialize
::anticollider::init
::commands::isc_initialize
::nexus::isc_initialize
########
# Parameters set above the restore command will be clobbered by
# the values in the status.tcl file

View File

@ -19,4 +19,8 @@ config/commands/hvcommands.tcl
config/motors/sct_positmotor_common.tcl
config/motors/sct_jogmotor_common.tcl
config/environment/
config/motors/sct_aerotech_soloist.tcl
config/environment/he3
config/environment/magneticField
config/environment/pressure
config/environment/temperature
config/motors/magnet_configuration.tcl

View File

@ -0,0 +1,123 @@
#!/usr/bin/env python
# vim: ft=python ts=8 sts=4 sw=4 expandtab autoindent smartindent nocindent
# Classes for device simulation using: First Order Plus Delay Time (FOPDT)
#
# Author: Unknown
# Finder: Douglas Clowes
"""
The class fopdt is a container for one or more fopdt_sink objects.
I am guessing that an fopdt_sink is a FOPDT source such as a heater element
or FOPDT sink such as a heat leak to the environment.
TODO:
* look into the isinstance block in getAbsolute
because there doesn't seem to be a 'current_value' anywhere
"""
from math import exp
class fopdt_sink:
def __init__(self, value, Kp, Tp, Td, absolute=False):
self.value = value
self.absolute = absolute
self.Kp = Kp
self.Tp = Tp
self.Td = Td
self.vmap = dict()
def getAbsolute(self):
if isinstance(self.value, fopdt):
result = self.value.current_value
else:
result = self.value
return result
def getValue(self, tm, current):
result = self.getAbsolute()
# Do the timeshifting implied by Td
t2 = round(tm)
t1 = round(tm - self.Td)
if not t2 in self.vmap:
self.vmap[t2] = result
for key in sorted(self.vmap.keys()):
if key < t1:
del self.vmap[key]
else:
break
if t1 in self.vmap:
result = self.vmap[t1]
else:
result = self.vmap[sorted(self.vmap.keys())[0]]
# TODO should this go before timeshifting?
if not self.absolute:
result = result - current
return result
def getDelta(self, tm, current):
value = self.getValue(tm, current)
return (1 - exp(-1.0/self.Tp)) * self.Kp * value
class fopdt:
def __init__(self, pv):
self.pv = pv
self.sources = []
self.sinks = []
def AddSource(self, source):
self.sources.append(source)
def RemSource(self, source):
if source in self.sources:
self.sources.remove(source)
def AddSink(self, sink):
self.sinks.append(sink)
def RemSink(self, sink):
if sink in self.sinks:
self.sinks.remove(sink)
def iterate(self, tm):
self.source_delta = 0.0
self.sink_delta = 0.0
for sink in self.sources:
self.source_delta = self.source_delta + sink.getDelta(tm, self.pv)
for sink in self.sinks:
self.sink_delta = self.sink_delta + sink.getDelta(tm, self.pv)
self.old_value = self.pv
self.new_value = self.pv + self.source_delta + self.sink_delta
self.pv = self.new_value
if __name__ == "__main__":
dev = fopdt(20)
source = fopdt_sink(20, 2, 13, 10, False)
dev.AddSource(source)
dev.AddSource(source)
dev.AddSource(source)
dev.AddSource(source)
sink = fopdt_sink(20, 1, 30, 1, False)
dev.AddSink(sink)
dev.AddSink(sink)
min = max = dev.pv
fd = open("test.csv", "w")
fd.write("Time,value,source,source_v,sink,sink_v\n")
for i in range(0,300+ 1):
if i == 15:
source.value = 30
elif i == 45:
source.value = 10
dev.iterate(i)
current = dev.pv
if current > max:
max = current
if current < min:
min = current
#print "%3d: %6.3f = %6.3f + %6.3f + %6.3f" % ( i, current, prev, delta_in, delta_out )
line = "%d,%.3f,%.3f,%.3f,%.3f,%.3f" % (i, current, source.value, dev.source_delta, sink.value, dev.sink_delta)
fd.write(line + "\n")
fd.close()
print "Now: %6.3f, Min: %6.3f, Max: %6.3f" % (current, min, max)

View File

@ -583,7 +583,7 @@ def init_context():
ContextStack[ContextIndex]['driveable'] = None
ContextStack[ContextIndex]['control'] = 'true'
ContextStack[ContextIndex]['data'] = 'true'
ContextStack[ContextIndex]['mutable'] = 'false'
ContextStack[ContextIndex]['mutable'] = 'true'
ContextStack[ContextIndex]['nxsave'] = 'true'
ContextStack[ContextIndex]['read_function'] = 'rdValue'
ContextStack[ContextIndex]['write_function'] = 'setValue'
@ -730,8 +730,47 @@ def build_group(MyDriver, p):
if key in ContextStack[ContextIndex]:
ContextStack[ContextIndex][key] = item[key]
pop_context()
adjust_group(MyGroup)
return MyGroup
def adjust_group(MyGroup):
if Verbose:
print 'ante adjust_group', MyGroup
MyData = None
for var in MyGroup['Vars']:
if Verbose:
print "Var:", MyGroup['Vars'][var]
if 'data' in MyGroup['Vars'][var]:
if MyGroup['Vars'][var]['data'] == 'true':
MyData = 'true'
if 'klass' not in MyGroup['Vars'][var]['Property']:
MyGroup['Vars'][var]['Property']['klass'] = 'parameter'
else:
MyData = 'false'
if MyData is None:
for grp in MyGroup['Groups']:
if Verbose:
print "Grp:", MyGroup['Groups'][grp]
adjust_group(MyGroup['Groups'][grp])
if 'data' in MyGroup['Groups'][grp]['GroupProperty']:
if MyGroup['Groups'][grp]['GroupProperty']['data'] == 'true':
MyData = 'true'
else:
MyData = 'false'
break
if MyData is not None:
if 'GroupProperty' not in MyGroup:
MyGroup['GroupProperty'] = {}
if 'data' not in MyGroup['GroupProperty']:
MyGroup['GroupProperty']['data'] = MyData
if MyData:
if 'klass' not in MyGroup['GroupProperty']:
MyGroup['GroupProperty']['klass'] = '@none'
if 'type' not in MyGroup['GroupProperty']:
MyGroup['GroupProperty']['type'] = 'part'
if Verbose:
print 'post adjust_group', MyGroup
def build_driver(MyDriver, TheTree):
if Verbose:
print "TheTree:", TheTree
@ -770,12 +809,19 @@ def dump_driver_vars(vars, indent):
global DriveableFunctionTypes
for item in sorted(vars):
print indent + ' VAR %s = {' % item
for subitem in sorted([i for i in vars[item] if i not in FunctionTypes + DriveableFunctionTypes]):
print indent + ' %s =' % subitem, vars[item][subitem]
Comments = ['name', 'path']
Deferred = ['Property'] + Comments + FunctionTypes + DriveableFunctionTypes
for Comment in sorted(Comments):
if Comment in vars[item]:
print indent + ' # %s = \'%s\'' % (Comment, vars[item][Comment])
for subitem in sorted([i for i in vars[item] if i not in Deferred]):
print indent + ' %s = \'%s\'' % (subitem, vars[item][subitem])
for subitem in sorted([i for i in vars[item] if i in FunctionTypes]):
print indent + ' %s =' % subitem, vars[item][subitem]
print indent + ' %s = \'%s\'' % (subitem, vars[item][subitem])
for subitem in sorted([i for i in vars[item] if i in DriveableFunctionTypes]):
print indent + ' %s =' % subitem, vars[item][subitem]
print indent + ' %s = \'%s\'' % (subitem, vars[item][subitem])
for subitem in sorted([i for i in vars[item]['Property']]):
print indent + ' Property \'%s\' = \'%s\'' % (subitem, vars[item]['Property'][subitem])
print indent + ' }'
def dump_driver_groups(groups, indent):
@ -784,8 +830,16 @@ def dump_driver_groups(groups, indent):
print indent + 'GROUP ' + item + ' = {'
else:
print indent + 'GROUP = {'
for subitem in sorted([x for x in groups[item] if not x in ['Groups', 'Vars']]):
Comments = ['name', 'path']
Deferred = ['Groups', 'Vars', 'GroupProperty'] + Comments
for Comment in sorted(Comments):
if Comment in groups[item]:
print indent + ' # %s = \'%s\'' % (Comment, groups[item][Comment])
for subitem in sorted([x for x in groups[item] if not x in Deferred]):
print indent + ' ', subitem, '=', groups[item][subitem]
if 'GroupProperty' in groups[item]:
for subitem in groups[item]['GroupProperty']:
print indent + ' GroupProperty', subitem, '=', groups[item]['GroupProperty'][subitem]
dump_driver_vars(groups[item]['Vars'], indent)
dump_driver_groups(groups[item]['Groups'], indent + ' ')
print indent + '}'
@ -802,8 +856,13 @@ def dump_driver_funcs(funcs):
def dump_driver(MyDriver):
print 'DRIVER ' + MyDriver['name'] + ' = {'
for item in sorted([x for x in MyDriver if x not in ['Groups', 'Funcs']]):
print ' ' + item + ' =', MyDriver[item]
Comments = ['PathName', 'Permlink']
Deferred = ['Groups', 'Funcs', 'Deferred', 'name'] + Comments
for Comment in sorted(Comments):
if Comment in MyDriver:
print '# %s = \'%s\'' % (Comment, MyDriver[Comment])
for item in sorted([x for x in MyDriver if x not in Deferred]):
print ' ' + item + ' =', '\'%s\'' % MyDriver[item]
#print 'Groups:', MyDriver['Groups']
dump_driver_groups(MyDriver['Groups'], ' ')
#print 'Funcs:', MyDriver['Funcs']
@ -1334,6 +1393,7 @@ def put_mkDriver(MyDriver):
txt += put_group(MyDriver, MyDriver['Groups'][group])
txt += [' hsetprop ${scobj_hpath} klass %s' % MyDriver['class']]
txt += [' hsetprop ${scobj_hpath} data true']
txt += [' hsetprop ${scobj_hpath} debug_threshold %s' % str(MyDriver['debug_threshold'])]
if len(MyDriver['Deferred']) > 0:
txt += [' if {[string equal -nocase [SplitReply [%s]] "false"]} {' % MyDriver['simulation_group']]

View File

@ -0,0 +1,119 @@
#!/usr/bin/env python
# vim: ft=python ts=8 sts=4 sw=4 expandtab autoindent smartindent nocindent
#
# Class for device simulation using: Proportional-Integral-Derivative (PID)
#
# This recipe gives simple implementation of a Discrete
# Proportional-Integral-Derivative (PID) controller.
#
# PID controller gives output value for error between desired reference input and
# measurement feedback to minimize error value.
#
# More information: http://en.wikipedia.org/wiki/PID_controller
#
# cnr437@gmail.com
#
####### Example #########
#
# p=PID(3.0,0.4,1.2)
# p.setPoint(5.0)
# while True:
# pid = p.update(measurement_value)
#
#
"""
TODO:
* Look into making the update time based because the logic seems to assume constant (1 second) time
- Derivator should be dE/dT but is just dE
- Integrator should be sigma(dT*E) but is just sigma(E)
* Look into making the Derivator based on changes in the PV instead of the Error
"""
class PID:
"""
Discrete PID control
"""
def __init__(self, P=2.0, I=0.0, D=1.0, Derivator=0, Integrator=0, Integrator_max=500, Integrator_min=-500):
self.Kp=P
self.Ki=I
self.Kd=D
self.Derivator=Derivator
self.Integrator=Integrator
self.Integrator_max=Integrator_max
self.Integrator_min=Integrator_min
self.set_point=0.0
self.error=0.0
def update(self,current_value):
"""
Calculate PID output value for given reference input and feedback
"""
self.error = self.set_point - current_value
self.P_value = self.Kp * self.error
# TODO: check the sign is correct
self.D_value = self.Kd * (current_value - self.Derivator)
self.Derivator = current_value
self.Integrator = self.Integrator + self.error
if self.Integrator > self.Integrator_max:
self.Integrator = self.Integrator_max
elif self.Integrator < self.Integrator_min:
self.Integrator = self.Integrator_min
self.I_value = self.Integrator * self.Ki
PID = self.P_value + self.I_value + self.D_value
return PID
def setPoint(self,set_point):
"""
Initilize the setpoint of PID
"""
self.set_point = set_point
self.Integrator=0
self.Derivator=0
def setIntegrator(self, Integrator):
self.Integrator = Integrator
def setDerivator(self, Derivator):
self.Derivator = Derivator
def setKp(self,P):
self.Kp=P
def setKi(self,I):
self.Ki=I
def setKd(self,D):
self.Kd=D
def getPoint(self):
return self.set_point
def getError(self):
return self.error
def getIntegrator(self):
return self.Integrator
def getDerivator(self):
return self.Derivator
if __name__ == "__main__":
#p=PID(3.0,0.4,1.2)
#p.setPoint(5.0)
#while True:
# pid = p.update(measurement_value)
p = PID(3.0, 0.4, 1.2)
p.setPoint(20.0)
pv = 20
for i in range(0,61):
print p.update(pv)

View File

@ -23,6 +23,7 @@
#include <tcl.h>
#include <site.h>
#include <SCinter.h>
#include <splitter.h>
#ifdef SICS_VALGRIND
#include <valgrind/memcheck.h>
@ -322,6 +323,33 @@ int testLogCmd(SConnection *pCon, SicsInterp *pInter, void *pData,
return OKOK;
}
/**
* \brief Writes multiline output from a command to a client.
* This is useful for implementing Tcl proc wrappers for commands.
* NOTE: SICS-764, currently this sends output to the client as well as capturing it.
* We should try to improve this in Release 3.2 see SICS-765
*/
int Ansto_Capture(SConnection *pCon, SicsInterp * pSics, void *pData, int argc, char *argv[]) {
char buffer[1024];
char *command, *data;
int status, inMacro;
if (argc < 2) {
SCWrite(pCon, "ERROR: insufficient arguments to capture", eError);
return 0;
}
command = Arg2Tcl(argc - 1, &argv[1], buffer, sizeof buffer);
inMacro = pCon->iMacro;
pCon->iMacro = 0;
status = InterpExecute(pSics, pCon, command);
pCon->iMacro = inMacro;
if (command != buffer)
free(command);
data = ANETgetWBuffer(pCon->sockHandle);
SCWrite(pCon, data, eValue);
return status;
}
void SiteInit(void) {
#define INIT(F) { void F(void); F(); }
/* insert here initialization routines ... */
@ -376,6 +404,7 @@ static void AddCommands(SicsInterp *pInter)
AddCommand(pInter, "sicslist", SicsList, NULL, NULL);
AddCommand(pInter, "FileEvalGlob", MacroFileEvalGlob, NULL, NULL);
AddCommand(pInter, "Valgrind", Ansto_Valgrind, NULL, NULL);
AddCommand(pInter, "anstocapture", Ansto_Capture, NULL, NULL);
/*
* Tcl 8.5 has implemented the clock command in tcl rather then C.