- Extended sicshdbadapter to attach a node to the target of any
drivable. Required a new event in devexec.c - Fixed the phytron driver to handle speed well - Added a protocol driver for the TCP/IP bridge to the SLS magnets SKIPPED: psi/make_gen psi/phytron.c psi/psi.c psi/slsecho.c psi/sps.c
This commit is contained in:
23
devexec.c
23
devexec.c
@ -9,13 +9,13 @@
|
||||
revised for use with tasker: Mark Koennecke, September 1997
|
||||
Locking added: Mark Koennecke, August 2002
|
||||
|
||||
Refactored and instrumentation for instrument staticstics added.
|
||||
Refactored and instrumentation for instrument statistics added.
|
||||
Mark Koennecke, July 2006
|
||||
|
||||
Reworked to use copied connection objects instead of context pushes.
|
||||
Mark Koennecke, January 2009
|
||||
|
||||
Modified to accomodate run levels
|
||||
Modified to accommodate run levels
|
||||
Mark Koennecke, April 2009
|
||||
|
||||
Copyright:
|
||||
@ -278,7 +278,18 @@ void ExeInterest(pExeList self, pDevEntry pDev, char *text)
|
||||
InvokeCallBack(self->pCall, DRIVSTAT, buf);
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
static void InvokeNewTarget(pExeList self, char *name, float target)
|
||||
{
|
||||
NewTarget targetEvent;
|
||||
|
||||
targetEvent.name = strdup(name);
|
||||
targetEvent.target = target;
|
||||
InvokeCallBack(self->pCall, NEWTARGET, &targetEvent);
|
||||
if(targetEvent.name != NULL){
|
||||
free(targetEvent.name);
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
int StartDevice(pExeList self, char *name, pObjectDescriptor pDes,
|
||||
void *pData, SConnection * pCon, int level, float fNew)
|
||||
@ -342,6 +353,9 @@ int StartDevice(pExeList self, char *name, pObjectDescriptor pDes,
|
||||
name, oldVal, fNew);
|
||||
SCWrite(pCon, pBueffel, eValue);
|
||||
}
|
||||
if(iRet == OKOK){
|
||||
InvokeNewTarget(self,name,fNew);
|
||||
}
|
||||
} else if (pCountInt) {
|
||||
iRet = pCountInt->StartCount(pData, pCon);
|
||||
} else { /* this is a programmers error */
|
||||
@ -1322,3 +1336,8 @@ void DevExecInit(void)
|
||||
AddCommand(pServ->pSics, "continue", ContinueAction, NULL, pExe);
|
||||
AddCommand(pServ->pSics, "devexec", DevexecAction, NULL, pExe);
|
||||
}
|
||||
/*---------------------------------------------------------------------*/
|
||||
void *GetExecutorCallback(pExeList self)
|
||||
{
|
||||
return self->pCall;
|
||||
}
|
||||
|
@ -176,6 +176,13 @@
|
||||
|
||||
pExeList GetExecutor(void);
|
||||
void SetExecutor(pExeList pExe);
|
||||
|
||||
/**
|
||||
* This is only used in sicshdbadapter.c
|
||||
* It became a void pointer because of circular dependencies in the
|
||||
* header files.
|
||||
*/
|
||||
void *GetExecutorCallback(pExeList self);
|
||||
/*----------------------- Logging -----------------------------------------*/
|
||||
void DevexecLog(char *op, char *device);
|
||||
#endif
|
||||
|
@ -365,6 +365,13 @@ to the global SICS device executor.
|
||||
\mbox{}\verb@ @\\
|
||||
\mbox{}\verb@ pExeList GetExecutor(void);@\\
|
||||
\mbox{}\verb@ void SetExecutor(pExeList pExe);@\\
|
||||
\mbox{}\verb@ @\\
|
||||
\mbox{}\verb@ /**@\\
|
||||
\mbox{}\verb@ * This is only used in sicshdbadapter.c@\\
|
||||
\mbox{}\verb@ * It became a void pointer because of circular dependencies in the @\\
|
||||
\mbox{}\verb@ * header files.@\\
|
||||
\mbox{}\verb@ */ @\\
|
||||
\mbox{}\verb@ void *GetExecutorCallback(pExeList self);@\\
|
||||
\mbox{}\verb@/*----------------------- Logging -----------------------------------------*/@\\
|
||||
\mbox{}\verb@ void DevexecLog(char *op, char *device); @\\
|
||||
\mbox{}\verb@#endif @\\
|
||||
|
@ -311,6 +311,13 @@ to the global SICS device executor.
|
||||
|
||||
pExeList GetExecutor(void);
|
||||
void SetExecutor(pExeList pExe);
|
||||
|
||||
/**
|
||||
* This is only used in sicshdbadapter.c
|
||||
* It became a void pointer because of circular dependencies in the
|
||||
* header files.
|
||||
*/
|
||||
void *GetExecutorCallback(pExeList self);
|
||||
/*----------------------- Logging -----------------------------------------*/
|
||||
void DevexecLog(char *op, char *device);
|
||||
#endif
|
||||
|
1
event.c
1
event.c
@ -69,6 +69,7 @@ static char *pEvent[] = {
|
||||
"HDBVAL",
|
||||
"STATESTART",
|
||||
"STATEEND",
|
||||
"NEWTARGET",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
16
event.h
16
event.h
@ -1,5 +1,5 @@
|
||||
|
||||
#line 100 "event.w"
|
||||
#line 102 "event.w"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
E V E N T
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
int Text2Event(char *pText);
|
||||
|
||||
#line 113 "event.w"
|
||||
#line 115 "event.w"
|
||||
|
||||
|
||||
|
||||
@ -47,13 +47,19 @@ int Text2Event(char *pText);
|
||||
#define HDBVAL 20
|
||||
#define STSTART 21
|
||||
#define STEND 22
|
||||
#define NEWTARGET 23
|
||||
|
||||
#line 115 "event.w"
|
||||
#line 117 "event.w"
|
||||
|
||||
|
||||
/*----------------- event data structure for the NEWTARGET event ---------*/
|
||||
typedef struct {
|
||||
char *name;
|
||||
float target;
|
||||
} NewTarget, *pNewTarget;
|
||||
/*--------------- Signals for the Signalfunction of each task ------------*/
|
||||
|
||||
#line 82 "event.w"
|
||||
#line 84 "event.w"
|
||||
|
||||
#define SICSINT 300
|
||||
#define SICSBROADCAST 301
|
||||
@ -62,6 +68,6 @@ int Text2Event(char *pText);
|
||||
#define COMLOG 304
|
||||
#define CRONLIST 305
|
||||
|
||||
#line 118 "event.w"
|
||||
#line 125 "event.w"
|
||||
|
||||
#endif
|
||||
|
@ -58,6 +58,7 @@ $\langle$VE {\footnotesize ?}$\rangle\equiv$
|
||||
\mbox{}\verb@#define HDBVAL 20@\\
|
||||
\mbox{}\verb@#define STSTART 21@\\
|
||||
\mbox{}\verb@#define STEND 22@\\
|
||||
\mbox{}\verb@#define NEWTARGET 23@\\
|
||||
\mbox{}\verb@@$\Diamond$
|
||||
\end{list}
|
||||
\vspace{-1ex}
|
||||
@ -96,6 +97,7 @@ operation.
|
||||
\item[POSITION] ANSTO defined code
|
||||
\item[HDBVAL] The Hdb is notified of a value change. The eventData will be
|
||||
the object on which the data changed.
|
||||
\item[NEWTARGET] is invoked when a new target has been set on a drivable.
|
||||
\end{description}
|
||||
|
||||
Furthermore event contains system wide signal codes which are interpreted in
|
||||
@ -157,6 +159,11 @@ data is the string to send.
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@@$\langle$VE {\footnotesize ?}$\rangle$\verb@@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@/*----------------- event data structure for the NEWTARGET event ---------*/@\\
|
||||
\mbox{}\verb@typedef struct {@\\
|
||||
\mbox{}\verb@ char *name;@\\
|
||||
\mbox{}\verb@ float target;@\\
|
||||
\mbox{}\verb@ } NewTarget, *pNewTarget;@\\
|
||||
\mbox{}\verb@/*--------------- Signals for the Signalfunction of each task ------------*/@\\
|
||||
\mbox{}\verb@@$\langle$VSIG {\footnotesize ?}$\rangle$\verb@ @\\
|
||||
\mbox{}\verb@#endif@\\
|
||||
|
7
event.w
7
event.w
@ -41,6 +41,7 @@ if the event code is not known, else the apropriate event code.
|
||||
#define HDBVAL 20
|
||||
#define STSTART 21
|
||||
#define STEND 22
|
||||
#define NEWTARGET 23
|
||||
@}
|
||||
\begin{description}
|
||||
\item[VALUECHANGE] This is a variable changing its value. As event data a pointer to the
|
||||
@ -71,6 +72,7 @@ operation.
|
||||
\item[POSITION] ANSTO defined code
|
||||
\item[HDBVAL] The Hdb is notified of a value change. The eventData will be
|
||||
the object on which the data changed.
|
||||
\item[NEWTARGET] is invoked when a new target has been set on a drivable.
|
||||
\end{description}
|
||||
|
||||
Furthermore event contains system wide signal codes which are interpreted in
|
||||
@ -114,6 +116,11 @@ data is the string to send.
|
||||
|
||||
@<VE@>
|
||||
|
||||
/*----------------- event data structure for the NEWTARGET event ---------*/
|
||||
typedef struct {
|
||||
char *name;
|
||||
float target;
|
||||
} NewTarget, *pNewTarget;
|
||||
/*--------------- Signals for the Signalfunction of each task ------------*/
|
||||
@<VSIG@>
|
||||
#endif
|
||||
|
12
protocol.c
12
protocol.c
@ -22,7 +22,7 @@
|
||||
#define INIT_STR_SIZE 256
|
||||
#define STR_RESIZE_LENGTH 256
|
||||
#define NUMPROS 7
|
||||
#define PROLISTLEN 7
|
||||
#define PROLISTLEN 8
|
||||
typedef struct __Protocol {
|
||||
pObjectDescriptor pDes; /* required as first field */
|
||||
char *name; /* protocol handler name */
|
||||
@ -73,16 +73,6 @@ char *pStatus[] = {
|
||||
|
||||
typedef struct __Protocol *pProtocol;
|
||||
|
||||
/* alternate implementation of protocol list if data hiding in
|
||||
* Protocol struct via CreateProtocol does not work
|
||||
* static char *pPros[] = {
|
||||
* "default",
|
||||
* "outcodes",
|
||||
* "sycamore"
|
||||
* NULL };
|
||||
* static int iNumPros = 3
|
||||
*/
|
||||
|
||||
pProtocol CreateProtocol(void);
|
||||
static int ProtocolOptions(SConnection * pCon, pProtocol pPro);
|
||||
static int ProtocolHelp(SConnection * pCon, Protocol * pPro);
|
||||
|
@ -649,7 +649,87 @@ static hdbCallbackReturn SICSDataCallback(pHdb node, void *userData,
|
||||
|
||||
return hdbContinue;
|
||||
}
|
||||
/*================= targets ============================================*/
|
||||
typedef struct {
|
||||
char *name;
|
||||
pHdb node;
|
||||
}TargetData, *pTargetData ;
|
||||
/*----------------------------------------------------------------------*/
|
||||
static void KillTargetData(void *data)
|
||||
{
|
||||
pTargetData self = (pTargetData) data;
|
||||
if(self == NULL){
|
||||
return;
|
||||
}
|
||||
if(self->name != NULL){
|
||||
free(self->name);
|
||||
}
|
||||
free(self);
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
static int TargetCallback(int iEvent, void *pEventData, void *pUserData)
|
||||
{
|
||||
pTargetData user = NULL;
|
||||
pNewTarget event = NULL;
|
||||
hdbValue v;
|
||||
|
||||
if(iEvent != NEWTARGET){
|
||||
return 0;
|
||||
}
|
||||
|
||||
user = (pTargetData)pUserData;
|
||||
event = (pNewTarget)pEventData;
|
||||
assert(user != NULL && event != NULL);
|
||||
|
||||
if(strcmp(user->name,event->name) == 0){
|
||||
v = MakeHdbFloat((double)event->target);
|
||||
UpdateHipadabaPar(user->node, v, NULL);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
static int AttachTarget(SConnection *pCon, SicsInterp *pSics,
|
||||
char *drivename, char *nodename)
|
||||
{
|
||||
pTargetData tData = NULL;
|
||||
pHdb node = NULL;
|
||||
pIDrivable pDriv = NULL;
|
||||
CommandList *pCom = NULL;
|
||||
float val;
|
||||
|
||||
pDriv = FindDrivable(pSics, drivename);
|
||||
if(pDriv == NULL){
|
||||
SCPrintf(pCon,eError,"ERROR: drivable %s not found", drivename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
node = FindHdbNode(NULL, nodename, pCon);
|
||||
if(node == NULL){
|
||||
SCPrintf(pCon,eError,"ERROR: node %s not found", nodename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
tData = malloc(sizeof(TargetData));
|
||||
if(tData == NULL){
|
||||
SCWrite(pCon,"ERROR: out of memory in AttachTarget", eError);
|
||||
return 0;
|
||||
}
|
||||
tData->name = strdup(drivename);
|
||||
tData->node = node;
|
||||
|
||||
pCom = FindCommand(pSics,drivename);
|
||||
/* This cannot fail as we already located the drivable */
|
||||
GetDrivablePosition(pCom->pData, pCon,&val);
|
||||
UpdateHipadabaPar(node,MakeHdbFloat(val), pCon);
|
||||
|
||||
RegisterCallback((pICallBack)GetExecutorCallback(pServ->pExecutor),
|
||||
NEWTARGET,
|
||||
TargetCallback,
|
||||
tData,
|
||||
KillTargetData);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
}
|
||||
/*============== interpreter function ==================================*/
|
||||
int SICSHdbAdapter(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
int argc, char *argv[])
|
||||
@ -676,6 +756,10 @@ int SICSHdbAdapter(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(strcmp(argv[1],"target") == 0){
|
||||
return AttachTarget(pCon,pSics,argv[2], argv[3]);
|
||||
}
|
||||
|
||||
path = FindHdbNode(NULL, argv[1], pCon);
|
||||
if (path == NULL) {
|
||||
SCWrite(pCon, "ERROR: path to attach object too not found", eError);
|
||||
|
@ -8,6 +8,10 @@
|
||||
# baud and it ought to remember this. The command to change this
|
||||
# 0IC1S9600, the command to read this is 0IC1R.
|
||||
#
|
||||
# So, if this thing does not work on a serial port then the solution is
|
||||
# to set the terminal server to 57600 and try again. And set the baud rate
|
||||
# or leave it.
|
||||
#
|
||||
# There are surely many ways to use the MCC-2. It supports two axes, X and Y.
|
||||
# All examples below are given for X only. This driver uses it in
|
||||
# this way:
|
||||
@ -163,7 +167,7 @@ proc phytron::readspeed {axis} {
|
||||
}
|
||||
#------------------------------------------------------------------------
|
||||
proc phytron::rcvspeed {} {
|
||||
set data [phyton::check]
|
||||
set data [phytron::check]
|
||||
set speed [string range $data 3 end]
|
||||
sct update $speed
|
||||
return idle
|
||||
@ -176,7 +180,7 @@ proc phytron::writespeed {axis} {
|
||||
}
|
||||
#------------------------------------------------------------------------
|
||||
proc phytron::rcvwspeed {axis} {
|
||||
set data [phyton::check]
|
||||
set data [phytron::check]
|
||||
if {[string first NACK $data] >= 0} {
|
||||
error "Invalid command"
|
||||
}
|
||||
@ -238,12 +242,13 @@ proc phytron::make {name axis controller lowlim upperlim} {
|
||||
hsetprop /sics/${name}/status statend phytron::statend $axis
|
||||
$controller poll /sics/${name}/status 60
|
||||
|
||||
hfactory /sics/{$name}/speed plain user float
|
||||
hfactory /sics/${name}/speed plain user float
|
||||
hsetprop /sics/${name}/speed read "phytron::readspeed $axis"
|
||||
hsetprop /sics/${name}/speed rcvspeed "phytron::rcvspeed"
|
||||
hsetprop /sics/${name}/speed write "phytron::writespeed $axis"
|
||||
hsetprop /sics/${name}/speed rcvwspeed "phytron::rcvwspeed $axis"
|
||||
$controller poll /sics/${name}/speed 60
|
||||
$controller write /sics/${name}/speed
|
||||
|
||||
$name makescriptfunc halt "phytron::halt $controller $axis" user
|
||||
|
||||
@ -256,17 +261,16 @@ proc phytron::make {name axis controller lowlim upperlim} {
|
||||
$controller queue /sics/${name}/hardposition progress read
|
||||
$controller queue /sics/${name}/speed progress read
|
||||
}
|
||||
#======================================================================
|
||||
# At MORPHEUS there is a special table where one motor needs a brake.
|
||||
# This requires a digital I/O to be disabled before driving and
|
||||
# enabled after driving. The code below adds this feature to
|
||||
#===============================================================================================
|
||||
# At MORPHEUS there is a special table where one motor needs a brake. This requires a digital I/O
|
||||
# to be disabled before driving and enabled after driving. The code below adds this feature to
|
||||
# a phytron motor
|
||||
#------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------------------------
|
||||
proc phytron::openset {out} {
|
||||
sct send [format "0A%dS" $out]
|
||||
return openans
|
||||
}
|
||||
#------------------------------------------------------------------------
|
||||
#----------------------------------------------------------------------------------------------
|
||||
proc phytron::openans {axis name} {
|
||||
after 100
|
||||
return [phytron::setpos $axis $name]
|
||||
|
291
tcl/slsecho.tcl
Normal file
291
tcl/slsecho.tcl
Normal file
@ -0,0 +1,291 @@
|
||||
#--------------------------------------------------------------
|
||||
# This is a scriptcontext based driver for the SLS magnet
|
||||
# controllers interfaced via the new shiny, silvery TCP/IP
|
||||
# interface box.
|
||||
#
|
||||
# Mark Koennecke, March 2010
|
||||
#---------------------------------------------------------------
|
||||
namespace eval slsecho {}
|
||||
|
||||
|
||||
proc slsecho::sendread {num} {
|
||||
sct send "$num:r:0x9c:0:read"
|
||||
return readreply
|
||||
}
|
||||
#---------------------------------------------------------------
|
||||
proc slsecho::readreply {} {
|
||||
set reply [sct result]
|
||||
set l [split $reply :]
|
||||
# set v [lindex $l 1]
|
||||
# clientput "Received $reply, val = $v"
|
||||
sct update [lindex $l 1]
|
||||
return idle
|
||||
}
|
||||
#--------------------------------------------------------------
|
||||
proc slsecho::sendwrite {num} {
|
||||
set val [sct target]
|
||||
sct send "$num:w:0x90:$val:write"
|
||||
return readreply
|
||||
}
|
||||
#--------------------------------------------------------------
|
||||
proc slsecho::writereply {} {
|
||||
set path [sct]
|
||||
set root [file dirname $path]
|
||||
[sct controller] queue $root/error progress read
|
||||
return idle
|
||||
}
|
||||
#--------------------------------------------------------------
|
||||
proc slsecho::readupper {num} {
|
||||
sct send "$num:r:0x76:0:read"
|
||||
return readreply
|
||||
}
|
||||
#--------------------------------------------------------------
|
||||
proc slsecho::readlower {num} {
|
||||
sct send "$num:r:0x77:0:read"
|
||||
return readreply
|
||||
}
|
||||
#--------------------------------------------------------------
|
||||
proc slsecho::readonoff {num} {
|
||||
sct send "$num:r:0x24:0:none"
|
||||
return onoffreply
|
||||
}
|
||||
#---------------------------------------------------------------
|
||||
proc slsecho::onoffreply {} {
|
||||
set reply [sct result]
|
||||
set l [split $reply :]
|
||||
set val [lindex $l 1]
|
||||
if {$val == 1} {
|
||||
sct update on
|
||||
} else {
|
||||
sct update off
|
||||
}
|
||||
return idle
|
||||
}
|
||||
#---------------------------------------------------------------
|
||||
proc slsecho::writeonoff {num} {
|
||||
set val [sct target]
|
||||
if {[string compare $val on] == 0} {
|
||||
set val 1
|
||||
} elseif {[string compare $val off] == 0} {
|
||||
set val 0
|
||||
} else {
|
||||
clientput "ERROR: Invalid target $val requested, only on/off"
|
||||
return idle
|
||||
}
|
||||
sct send "$num:w:0x3c:$val:none"
|
||||
[sct controller] queue [sct] progress read
|
||||
return writereply
|
||||
}
|
||||
#--------------------------------------------------------------
|
||||
proc slsecho::readerror {num} {
|
||||
sct send "$num:r:0x29:0:none"
|
||||
return errorreply
|
||||
}
|
||||
#--------------------------------------------------------------
|
||||
proc slsecho::errorreply {} {
|
||||
global slsecho::error
|
||||
set reply [sct result]
|
||||
set l [split $reply :]
|
||||
set val [lindex $l 1]
|
||||
set key [format "0x%x" $val]
|
||||
clientput "$key"
|
||||
clientput "$slsecho::error($key)"
|
||||
sct update $slsecho::error($key)
|
||||
return idle
|
||||
}
|
||||
#---------------------------------------------------------------
|
||||
proc slsecho::makeslsecho {name num sct} {
|
||||
makesctdriveobj $name float user SLSEchoMagnet $sct
|
||||
hfactory /sics/${name}/tolerance plain internal float
|
||||
hset /sics/${name}/tolerance .1
|
||||
hfactory /sics/${name}/upperlimit plain internal float
|
||||
hset /sics/${name}/upperlimit 10
|
||||
hfactory /sics/${name}/lowerlimit plain internal float
|
||||
hset /sics/${name}/lowerlimit -10
|
||||
hfactory /sics/${name}/stop plain internal int
|
||||
hset /sics/${name}/stop 0
|
||||
|
||||
hsetprop /sics/${name} checklimits stddrive::stdcheck $name
|
||||
hsetprop /sics/${name} checkstatus stddrive::stdstatus $name
|
||||
hsetprop /sics/${name} halt stddrive::stop $name
|
||||
|
||||
set path /sics/${name}
|
||||
hsetprop $path read slsecho::sendread $num
|
||||
hsetprop $path readreply slsecho::readreply
|
||||
$sct poll $path 10
|
||||
hsetprop $path write slsecho::sendwrite $num
|
||||
hsetprop $path writereply slsecho::writereply
|
||||
$sct write $path
|
||||
|
||||
hsetprop /sics/${name}/upperlimit read slsecho::readupper $num
|
||||
hsetprop /sics/${name}/upperlimit readreply slsecho::readreply
|
||||
$sct poll /sics/${name}/upperlimit 60
|
||||
|
||||
hsetprop /sics/${name}/lowerlimit read slsecho::readlower $num
|
||||
hsetprop /sics/${name}/lowerlimit readreply slsecho::readreply
|
||||
$sct poll /sics/${name}/lowerlimit 60
|
||||
|
||||
hfactory /sics/${name}/onoff plain user text
|
||||
hsetprop /sics/${name}/onoff read slsecho::readonoff $num
|
||||
hsetprop /sics/${name}/onoff onoffreply slsecho::onoffreply
|
||||
$sct poll /sics/${name}/onoff 60
|
||||
hsetprop /sics/${name}/onoff write slsecho::writeonoff $num
|
||||
hsetprop /sics/${name}/onoff writereply slsecho::writereply
|
||||
$sct write /sics/${name}/onoff
|
||||
|
||||
hfactory /sics/${name}/error plain internal text
|
||||
hsetprop /sics/${name}/error read slsecho::readerror $num
|
||||
hsetprop /sics/${name}/error errorreply slsecho::errorreply
|
||||
$sct poll /sics/${name}/error 10
|
||||
|
||||
#----------------- update everything
|
||||
hset /sics/${name}/onoff on
|
||||
$sct queue /sics/${name} progress read
|
||||
$sct queue /sics/${name}/upperlimit progress read
|
||||
$sct queue /sics/${name}/lowerlimit progress read
|
||||
$sct queue /sics/${name}/onoff progress read
|
||||
$sct queue /sics/${name}/error progress read
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------------------------
|
||||
# error codes
|
||||
#-------------------------------------------------------------------------------------------------
|
||||
set slsecho::error(0x0) "NO"
|
||||
set slsecho::error(0x1) "DEVICE_STATE_ERROR"
|
||||
set slsecho::error(0x2) "DEVICE_SUPERVISOR_DISABLED"
|
||||
set slsecho::error(0x3) "COMMAND_ABORT"
|
||||
set slsecho::error(0x4) "DATA_NOT_STORED"
|
||||
set slsecho::error(0x5) "ERROR_ERASING_FLASH"
|
||||
set slsecho::error(0x6) "COMMUNICATION_BREAK"
|
||||
set slsecho::error(0x7) "INTERNAL_COMMUNICATION_ERROR"
|
||||
set slsecho::error(0x8) "MASTER_CARD_ERROR"
|
||||
set slsecho::error(0x9) "INTERNAL_BUFFER_FULL"
|
||||
set slsecho::error(0xa) "WRONG_SECTOR"
|
||||
set slsecho::error(0xb) "DATA_NOT_COPIED"
|
||||
set slsecho::error(0xc) "WRONG_DOWNLOAD_PARAMETERS"
|
||||
set slsecho::error(0xd) "DEVICE_PARAMETRIZATION_ERROR"
|
||||
set slsecho::error(0x10) "TIMEOUT_DC_LINK_VOLTAGE"
|
||||
set slsecho::error(0x11) "TIMEOUT_AUXILIARY_RELAY_ON"
|
||||
set slsecho::error(0x12) "TIMEOUT_AUXILIARY_RELAY_OFF"
|
||||
set slsecho::error(0x13) "TIMEOUT_MAIN_RELAY_ON"
|
||||
set slsecho::error(0x14) "TIMEOUT_MAIN_RELAY_OFF"
|
||||
set slsecho::error(0x15) "TIMEOUT_DATA_DOWNLOAD"
|
||||
set slsecho::error(0x20) "INTERLOCK"
|
||||
set slsecho::error(0x21) "MASTER_SWITCH"
|
||||
set slsecho::error(0x22) "MAGNET_INTERLOCK"
|
||||
set slsecho::error(0x23) "TEMPERATURE_TRANSFORMER"
|
||||
set slsecho::error(0x24) "TEMPERATURE_RECTIFIER"
|
||||
set slsecho::error(0x25) "TEMPERATURE_CONVERTER"
|
||||
set slsecho::error(0x26) "CURRENT_TRANSDUCER"
|
||||
set slsecho::error(0x27) "TEMPERATURE_POLARITY_SWITCH"
|
||||
set slsecho::error(0x28) "POWER_SEMICONDUCTOR"
|
||||
set slsecho::error(0x29) "MAIN_RELAY"
|
||||
set slsecho::error(0x2a) "AD_CONVERTER_CARD"
|
||||
set slsecho::error(0x2b) "POLARITY_SWITCH"
|
||||
set slsecho::error(0x2c) "AUXILIARY_RELAY"
|
||||
set slsecho::error(0x2d) "MASTER_SWITCH_T1"
|
||||
set slsecho::error(0x2e) "MASTER_SWITCH_T2"
|
||||
set slsecho::error(0x2f) "TEMPERATURE_MAGNET"
|
||||
set slsecho::error(0x30) "WATER_MAGNET"
|
||||
set slsecho::error(0x31) "WATER_RACK"
|
||||
set slsecho::error(0x40) "LOAD_CURRENT_TOO_HIGH"
|
||||
set slsecho::error(0x41) "DC_LINK_VOLTAGE_TOO_LOW"
|
||||
set slsecho::error(0x42) "DC_LINK_VOLTAGE_TOO_HIGH"
|
||||
set slsecho::error(0x43) "LOAD_VOLTAGE_TOO_HIGH"
|
||||
set slsecho::error(0x44) "LOAD_CURRENT_RIPPLE_TOO_HIGH"
|
||||
set slsecho::error(0x45) "DC_LINK_ISOLATION_NOT_OK"
|
||||
set slsecho::error(0x46) "LOAD_ISOLATION_NOT_OK"
|
||||
set slsecho::error(0x47) "LOAD_IMPEDANCE_OUT_OF_RANGE"
|
||||
set slsecho::error(0x48) "SHUT_OFF_CURRENT_TOO_HIGH"
|
||||
set slsecho::error(0x49) "LOAD_DC_CURRENT_TOO_HIGH"
|
||||
set slsecho::error(0x4a) "CURRENT_I1A1_TOO_HIGH"
|
||||
set slsecho::error(0x4b) "CURRENT_I1B1_TOO_HIGH"
|
||||
set slsecho::error(0x4c) "CURRENT_I1A2_TOO_HIGH"
|
||||
set slsecho::error(0x4d) "CURRENT_I1B2_TOO_HIGH"
|
||||
set slsecho::error(0x4e) "CURRENT_I2A1_TOO_HIGH"
|
||||
set slsecho::error(0x4f) "CURRENT_I2B1_TOO_HIGH"
|
||||
set slsecho::error(0x50) "CURRENT_I2A2_TOO_HIGH"
|
||||
set slsecho::error(0x51) "CURRENT_I2B2_TOO_HIGH"
|
||||
set slsecho::error(0x52) "CURRENT_I3P_TOO_HIGH"
|
||||
set slsecho::error(0x53) "CURRENT_I3N_TOO_HIGH"
|
||||
set slsecho::error(0x54) "CURRENT_IE_TOO_HIGH"
|
||||
set slsecho::error(0x55) "VOLTAGE_U1A_TOO_LOW"
|
||||
set slsecho::error(0x56) "VOLTAGE_U1B_TOO_LOW"
|
||||
set slsecho::error(0x57) "DIFF_CURRENT_I1A1_I1A2_TOO_HIGH"
|
||||
set slsecho::error(0x58) "DIFF_CURRENT_I1B1_I1B2_TOO_HIGH"
|
||||
set slsecho::error(0x59) "DIFF_CURRENT_I2A1_I2A2_TOO_HIGH"
|
||||
set slsecho::error(0x5a) "DIFF_CURRENT_I2B1_I2B2_TOO_HIGH"
|
||||
set slsecho::error(0x5b) "DIFF_CURRENT_I3P_I3N_TOO_HIGH"
|
||||
set slsecho::error(0x5c) "CURRENT_I1A_TOO_HIGH"
|
||||
set slsecho::error(0x5d) "CURRENT_I1B_TOO_HIGH"
|
||||
set slsecho::error(0x5e) "CURRENT_I3A1_TOO_HIGH"
|
||||
set slsecho::error(0x5f) "CURRENT_I3B1_TOO_HIGH"
|
||||
set slsecho::error(0x60) "CURRENT_I3A2_TOO_HIGH"
|
||||
set slsecho::error(0x61) "CURRENT_I3B2_TOO_HIGH"
|
||||
set slsecho::error(0x62) "CURRENT_I4_TOO_HIGH"
|
||||
set slsecho::error(0x63) "CURRENT_I5_TOO_HIGH"
|
||||
set slsecho::error(0x64) "DIFF_CURRENT_I3A1_I3A2_TOO_HIGH"
|
||||
set slsecho::error(0x65) "DIFF_CURRENT_I3B1_I3B2_TOO_HIGH"
|
||||
set slsecho::error(0x66) "DIFF_CURRENT_I4_I5_TOO_HIGH"
|
||||
set slsecho::error(0x67) "VOLTAGE_U3A_TOO_LOW"
|
||||
set slsecho::error(0x68) "VOLTAGE_U3B_TOO_LOW"
|
||||
set slsecho::error(0x69) "VOLTAGE_U1_TOO_LOW"
|
||||
set slsecho::error(0x6a) "VOLTAGE_U3A_TOO_HIGH"
|
||||
set slsecho::error(0x6b) "VOLTAGE_U3B_TOO_HIGH"
|
||||
set slsecho::error(0x6c) "SPEED_ERROR_TOO_HIGH"
|
||||
set slsecho::error(0x70) "MAIN_RELAY_A"
|
||||
set slsecho::error(0x71) "MAIN_RELAY_B"
|
||||
set slsecho::error(0x72) "POWER_SWITCH_A"
|
||||
set slsecho::error(0x73) "POWER_SWITCH_B"
|
||||
set slsecho::error(0x74) "MONITOR_TRAFO_A"
|
||||
set slsecho::error(0x75) "MONITOR_TRAFO_B"
|
||||
set slsecho::error(0x76) "TEMPERATURE_RECTIFIER_A"
|
||||
set slsecho::error(0x77) "TEMPERATURE_RECTIFIER_B"
|
||||
set slsecho::error(0x78) "TEMPERATURE_CONVERTER_A"
|
||||
set slsecho::error(0x79) "TEMPERATURE_CONVERTER_B"
|
||||
set slsecho::error(0x7a) "TEMPERATURE_CONVERTER_A1"
|
||||
set slsecho::error(0x7b) "TEMPERATURE_CONVERTER_B1"
|
||||
set slsecho::error(0x7c) "TEMPERATURE_CONVERTER_A2"
|
||||
set slsecho::error(0x7d) "TEMPERATURE_CONVERTER_B2"
|
||||
set slsecho::error(0x7e) "TEMPERATURE_TRANSFORMER_A"
|
||||
set slsecho::error(0x7f) "TEMPERATURE_TRANSFORMER_B"
|
||||
set slsecho::error(0x80) "WATER_RECTIFIER_A"
|
||||
set slsecho::error(0x81) "WATER_RECTIFIER_B"
|
||||
set slsecho::error(0x82) "WATER_CONVERTER_A"
|
||||
set slsecho::error(0x83) "WATER_CONVERTER_B"
|
||||
set slsecho::error(0x84) "WATER_CONVERTER_A1"
|
||||
set slsecho::error(0x85) "WATER_CONVERTER_B1"
|
||||
set slsecho::error(0x86) "WATER_CONVERTER_A2"
|
||||
set slsecho::error(0x87) "WATER_CONVERTER_B2"
|
||||
set slsecho::error(0x88) "WATER_TRANSFORMER_A"
|
||||
set slsecho::error(0x89) "WATER_TRANSFORMER_B"
|
||||
set slsecho::error(0x8a) "DOOR_A"
|
||||
set slsecho::error(0x8b) "DOOR_B"
|
||||
set slsecho::error(0x8c) "DOOR_C"
|
||||
set slsecho::error(0x8d) "POWER_SEMICONDUCTOR_CONVERTER_A"
|
||||
set slsecho::error(0x8e) "POWER_SEMICONDUCTOR_CONVERTER_B"
|
||||
set slsecho::error(0x8f) "POWER_SEMICONDUCTOR_CONVERTER_A1"
|
||||
set slsecho::error(0x90) "POWER_SEMICONDUCTOR_CONVERTER_B1"
|
||||
set slsecho::error(0x91) "POWER_SEMICONDUCTOR_CONVERTER_A2"
|
||||
set slsecho::error(0x92) "POWER_SEMICONDUCTOR_CONVERTER_B2"
|
||||
set slsecho::error(0x93) "CURRENT_TRANSDUCER_I3P"
|
||||
set slsecho::error(0x94) "CURRENT_TRANSDUCER_I3N"
|
||||
set slsecho::error(0x95) "MAGNET_INTERLOCK_1"
|
||||
set slsecho::error(0x96) "MAGNET_INTERLOCK_2"
|
||||
set slsecho::error(0x97) "VENTILATOR"
|
||||
set slsecho::error(0x98) "EMERGENCY_SWITCH"
|
||||
set slsecho::error(0x99) "CAPACITOR_DISCHARGE_A_ON"
|
||||
set slsecho::error(0x9a) "CAPACITOR_DISCHARGE_B_ON"
|
||||
set slsecho::error(0x9b) "CURRENT_TRANSDUCER_I4"
|
||||
set slsecho::error(0x9c) "CURRENT_TRANSDUCER_I5"
|
||||
set slsecho::error(0xb0) "TIMEOUT_DC_LINK_VOLTAGE_PART_A"
|
||||
set slsecho::error(0xb1) "TIMEOUT_DC_LINK_VOLTAGE_PART_B"
|
||||
set slsecho::error(0xb2) "TIMEOUT_AUXILIARY_RELAY_A_ON"
|
||||
set slsecho::error(0xb3) "TIMEOUT_AUXILIARY_RELAY_B_ON"
|
||||
set slsecho::error(0xb4) "TIMEOUT_AUXILIARY_RELAY_A_OFF"
|
||||
set slsecho::error(0xb5) "TIMEOUT_AUXILIARY_RELAY_B_OFF"
|
||||
set slsecho::error(0xb6) "TIMEOUT_MAIN_RELAY_A_ON"
|
||||
set slsecho::error(0xb7) "TIMEOUT_MAIN_RELAY_B_ON"
|
||||
set slsecho::error(0xb8) "TIMEOUT_MAIN_RELAY_A_OFF"
|
||||
set slsecho::error(0xb9) "TIMEOUT_MAIN_RELAY_B_OFF"
|
||||
|
@ -3,9 +3,10 @@
|
||||
#
|
||||
# Started: Dr. Mark Koennecke, July 2006
|
||||
#---------------------------------------------------------------------------
|
||||
set home $env(HOME)/src/workspace/sics/test
|
||||
#----------------------------------------------------------------------------
|
||||
# O P T I O N S
|
||||
|
||||
# --------------- Initialize Tcl internals --------------------------------
|
||||
# --------------- ----------------------------------------------------------
|
||||
|
||||
# first all the server options are set
|
||||
|
||||
@ -190,7 +191,7 @@ sa endconfig
|
||||
#-----------------------------------------------------------------------
|
||||
# Hipadaba
|
||||
#----------------------------------------------------------------------
|
||||
InstallHdb
|
||||
source ../tcl/hdbutil.tcl
|
||||
hmake /instrument spy none
|
||||
hmake /instrument/sample spy none
|
||||
hattach /instrument/sample a3 omega
|
||||
@ -199,6 +200,10 @@ hmake /instrument/detector spy none
|
||||
hattach /instrument/detector hm data
|
||||
hattach /instrument lotte title
|
||||
|
||||
hfactory /target plain spy none
|
||||
hfactory /target/ta3 plain internal float
|
||||
hattach target a3 /target/ta3
|
||||
|
||||
restore
|
||||
|
||||
#-------------------------------------------------
|
||||
@ -641,10 +646,10 @@ set simhm 1
|
||||
simi init
|
||||
#}
|
||||
|
||||
set phytron 1
|
||||
set phytron 0
|
||||
if {$phytron == 1} {
|
||||
#makesctcontroller phyto phytron psts234:3002 5
|
||||
makesctcontroller phyto phytron morpheus-ts:3011 5
|
||||
makesctcontroller phyto phytron morpheus-ts:3013
|
||||
#makesctcontroller phyto phytron localhost:8080 5
|
||||
phyto debug 0
|
||||
|
||||
@ -700,3 +705,8 @@ proc testerr {input} {
|
||||
|
||||
makesctcontroller echo testprot testprot.dat
|
||||
|
||||
source ../tcl/stddrive.tcl
|
||||
source ../tcl/slsecho.tcl
|
||||
makesctcontroller slssct slsecho 129.129.195.50:5001
|
||||
slsecho::makeslsecho ma1 0 slssct
|
||||
|
||||
|
Reference in New Issue
Block a user