- fixed a anticollider bug
- fixed problems with the synchronization code - fixed some small TASP problems
This commit is contained in:
1
A1931.c
1
A1931.c
@ -20,7 +20,6 @@
|
|||||||
#include "evdriver.i"
|
#include "evdriver.i"
|
||||||
#include "gpibcontroller.h"
|
#include "gpibcontroller.h"
|
||||||
#include "A1931.h"
|
#include "A1931.h"
|
||||||
|
|
||||||
/*========================== private data structure ====================*/
|
/*========================== private data structure ====================*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int sensor; /* the control sensor */
|
int sensor; /* the control sensor */
|
||||||
|
@ -392,7 +392,7 @@ extern char *SkipSpace(char *pPtr);
|
|||||||
}
|
}
|
||||||
if(pCurrent->pName)
|
if(pCurrent->pName)
|
||||||
{
|
{
|
||||||
printf("Deleting %s\n",pCurrent->pName);
|
/* printf("Deleting %s\n",pCurrent->pName); */
|
||||||
free(pCurrent->pName);
|
free(pCurrent->pName);
|
||||||
}
|
}
|
||||||
pTemp = pCurrent->pNext;
|
pTemp = pCurrent->pNext;
|
||||||
|
@ -303,7 +303,7 @@ int AntiColliderAction(SConnection *pCon, SicsInterp *pSics,
|
|||||||
|
|
||||||
if(argc > 1){
|
if(argc > 1){
|
||||||
if(strcmp(argv[1],"clear") == 0){
|
if(strcmp(argv[1],"clear") == 0){
|
||||||
if(!SCMatchRights(pCon,usMugger)){
|
if(!SCMatchRights(pCon,usUser)){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
LLDdelete(self->sequenceList);
|
LLDdelete(self->sequenceList);
|
||||||
|
@ -24,6 +24,7 @@ controllers.
|
|||||||
controller.
|
controller.
|
||||||
<li><a href="#euro">Eurotherm Temperature Controller</a>.
|
<li><a href="#euro">Eurotherm Temperature Controller</a>.
|
||||||
<li><a href="#bruker">Bruker</a> Magnet Controller.
|
<li><a href="#bruker">Bruker</a> Magnet Controller.
|
||||||
|
<li>The Risoe <a href="#a1931">A1931</a> Temperature Controller.
|
||||||
<li>The <a href="#el755">PSI-EL755</a> Magnet Controller.
|
<li>The <a href="#el755">PSI-EL755</a> Magnet Controller.
|
||||||
<li>The <a href="#psidsp">PSI-DSP</a> Magnet Controller, also known as
|
<li>The <a href="#psidsp">PSI-DSP</a> Magnet Controller, also known as
|
||||||
SLS controller.
|
SLS controller.
|
||||||
@ -629,6 +630,35 @@ to be configured manually. For details see the manual coming with the machine.
|
|||||||
environment controller could not be implemented.
|
environment controller could not be implemented.
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
<h3><a name="a1931">The Risoe A1931 Temperature Controller</a></h3>
|
||||||
|
<p>
|
||||||
|
This is a temperature controller of unknown origin (probably built at
|
||||||
|
Risoe) which is coming with the Risoe instruments. This temperature
|
||||||
|
controller is connected to the computer systems through a GPIB bus and
|
||||||
|
controller. A A1931 temperature controller is configured into SICS
|
||||||
|
through the command:
|
||||||
|
<BLOCKQUOTE>
|
||||||
|
evfactory new temperature-name a1931 gpib-controller-name
|
||||||
|
</BLOCKQUOTE>
|
||||||
|
This creates a new command temperature-name. gpib-controller-name is
|
||||||
|
the name of a GPIB controller within SICS. A GPIB controller is
|
||||||
|
configured into SICS with the command MakeGPIB as described in the
|
||||||
|
SICS managers documentation.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A A1931 temperature device understands a couple of additional commands
|
||||||
|
on top of the standard set:
|
||||||
|
<dl>
|
||||||
|
<dt>temperature sensor <it> val</it>
|
||||||
|
<dd>The A1931 can switch control to various sensors. This command
|
||||||
|
allows to query the control sensor (command without parameter) or set
|
||||||
|
the control sensoe (command with parameter).
|
||||||
|
<dt>temperature file filename
|
||||||
|
<dd>The A1931 can be configured through files containing calibration
|
||||||
|
commands. Sich file can be loaded into the A1931 through the file
|
||||||
|
subcommand. The full path of filename must be given.
|
||||||
|
</dl>
|
||||||
|
</p>
|
||||||
<h3><a name="el755">The PSI-EL755 Magnet Controller</a></h3>
|
<h3><a name="el755">The PSI-EL755 Magnet Controller</a></h3>
|
||||||
<p>
|
<p>
|
||||||
This is magnet controller developed by the electronics group at
|
This is magnet controller developed by the electronics group at
|
||||||
@ -691,3 +721,4 @@ other environment device.
|
|||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1137,6 +1137,7 @@ static int checkHMEnd(pHistMem self, char *text){
|
|||||||
if(iRet)
|
if(iRet)
|
||||||
{
|
{
|
||||||
self->iInit = 1;
|
self->iInit = 1;
|
||||||
|
SCSendOK(pCon);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
2
motor.c
2
motor.c
@ -969,6 +969,8 @@ extern MotorDriver *MakePiPiezo(Tcl_Interp *pTcl, char *pArray);
|
|||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
pNew->ParArray[HLOW].iCode = usUser;
|
||||||
|
pNew->ParArray[HUPP].iCode = usUser;
|
||||||
}
|
}
|
||||||
else if (strcmp(argv[2],"pipiezo") == 0)
|
else if (strcmp(argv[2],"pipiezo") == 0)
|
||||||
{
|
{
|
||||||
|
39
simdriv.c
39
simdriv.c
@ -2,10 +2,15 @@
|
|||||||
|
|
||||||
SINQ suffers from a severe lack of hardware. In order to do something
|
SINQ suffers from a severe lack of hardware. In order to do something
|
||||||
inspite of this, there is the Simulated motor for testing software and
|
inspite of this, there is the Simulated motor for testing software and
|
||||||
perhaps later on as a simulation engine for testing baqtch-files.
|
perhaps later on as a simulation engine for testing batch-files.
|
||||||
|
|
||||||
Mark Koennecke, November 1996
|
Mark Koennecke, November 1996
|
||||||
|
|
||||||
|
Prepared for simulation mode by providing for zero failure operation
|
||||||
|
Mark Koennecke, October 2001
|
||||||
|
|
||||||
|
Allowed for changing hardware limits: Mark Koennecke, April 2003
|
||||||
|
|
||||||
Copyright:
|
Copyright:
|
||||||
|
|
||||||
Labor fuer Neutronenstreuung
|
Labor fuer Neutronenstreuung
|
||||||
@ -63,9 +68,7 @@
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
static int GetSimPos(void *self, float *fPos)
|
static int GetSimPos(void *self, float *fPos)
|
||||||
{
|
{
|
||||||
SIMDriv *pDriv;
|
SIMDriv *pDriv;
|
||||||
@ -232,6 +235,26 @@
|
|||||||
return HWBusy;
|
return HWBusy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*-----------------------------------------------------------------------*/
|
||||||
|
static int SimSetPar(void *self, SConnection *pCon, char *name, float newValue)
|
||||||
|
{
|
||||||
|
SIMDriv *pDriv = (SIMDriv *) self;
|
||||||
|
|
||||||
|
assert(self);
|
||||||
|
assert(pCon);
|
||||||
|
|
||||||
|
if(strcmp(name,"hardupperlim") == 0)
|
||||||
|
{
|
||||||
|
pDriv->fUpper = newValue;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(strcmp(name,"hardlowerlim") == 0)
|
||||||
|
{
|
||||||
|
pDriv->fLower = newValue;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
MotorDriver *CreateSIM(SConnection *pCon, int argc, char *argv[])
|
MotorDriver *CreateSIM(SConnection *pCon, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -329,6 +352,7 @@
|
|||||||
pDriv->GetStatus = SimStat;
|
pDriv->GetStatus = SimStat;
|
||||||
pDriv->GetError = SimError;
|
pDriv->GetError = SimError;
|
||||||
pDriv->TryAndFixIt = SimFix;
|
pDriv->TryAndFixIt = SimFix;
|
||||||
|
/* pDriv->SetDriverPar = SimSetPar; */
|
||||||
pDriv->Halt = SimHalt;
|
pDriv->Halt = SimHalt;
|
||||||
pDriv->fSpeed = .01;
|
pDriv->fSpeed = .01;
|
||||||
pDriv->iTime = 0;
|
pDriv->iTime = 0;
|
||||||
@ -357,3 +381,12 @@
|
|||||||
free(pDriv);
|
free(pDriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
/*-----------------------------------------------------------------------
|
/*-----------------------------------------------------------------------
|
||||||
Some file statics which hold the connection parameters
|
Some file statics which hold the connection parameters
|
||||||
------------------------------------------------------------------------*/
|
------------------------------------------------------------------------*/
|
||||||
static char *hostname, *looser, *password;
|
static char *hostname, *looser, *password, *syncFile;
|
||||||
static int port;
|
static int port;
|
||||||
static mkChannel *connection = NULL;
|
static mkChannel *connection = NULL;
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
@ -95,6 +95,8 @@ static void killSync(void *pData)
|
|||||||
free(looser);
|
free(looser);
|
||||||
if(password)
|
if(password)
|
||||||
free(password);
|
free(password);
|
||||||
|
if(syncFile)
|
||||||
|
free(syncFile);
|
||||||
}
|
}
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
int MakeSync(SConnection *pCon, SicsInterp *pSics, void *pData,
|
int MakeSync(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||||
@ -120,6 +122,14 @@ int MakeSync(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
port = atof(argv[2]);
|
port = atof(argv[2]);
|
||||||
looser = strdup(argv[3]);
|
looser = strdup(argv[3]);
|
||||||
password = strdup(argv[4]);
|
password = strdup(argv[4]);
|
||||||
|
if(argc > 5)
|
||||||
|
{
|
||||||
|
syncFile = strdup(argv[5]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
syncFile = NULL;
|
||||||
|
}
|
||||||
pServ->simMode = 1;
|
pServ->simMode = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -164,7 +174,14 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
first tell the remote server to backup
|
first tell the remote server to backup
|
||||||
*/
|
*/
|
||||||
SetStatusFixed(eBatch);
|
SetStatusFixed(eBatch);
|
||||||
strcpy(pBueffel,"transact backup\n");
|
strcpy(pBueffel,"transact backup");
|
||||||
|
if(syncFile != NULL)
|
||||||
|
{
|
||||||
|
strcat(pBueffel," ");
|
||||||
|
strcat(pBueffel,syncFile);
|
||||||
|
}
|
||||||
|
strcat(pBueffel,"\n");
|
||||||
|
|
||||||
test = NETWrite(connection,pBueffel,strlen(pBueffel));
|
test = NETWrite(connection,pBueffel,strlen(pBueffel));
|
||||||
if(test != 1)
|
if(test != 1)
|
||||||
{
|
{
|
||||||
@ -177,11 +194,15 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
wait 10 seconds for correct message
|
wait 60 seconds for correct message
|
||||||
|
*/
|
||||||
|
pServ->simMode = 0; /* bug fix: SicsWait returns right away if this would be
|
||||||
|
left at normal. Reset after loop
|
||||||
*/
|
*/
|
||||||
pBueffel[0] = '\0';
|
pBueffel[0] = '\0';
|
||||||
for(i = 0; i < 10; i++)
|
for(i = 0; i < 60; i++)
|
||||||
{
|
{
|
||||||
|
pRead[0] = '\0';
|
||||||
test = NETRead(connection,pRead,75,20*1000);
|
test = NETRead(connection,pRead,75,20*1000);
|
||||||
if(test < 0)
|
if(test < 0)
|
||||||
{
|
{
|
||||||
@ -192,13 +213,17 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
SCWrite(pCon,
|
SCWrite(pCon,
|
||||||
"Try again in order to reconnect before giving up",eWarning);
|
"Try again in order to reconnect before giving up",eWarning);
|
||||||
ClearFixedStatus(eEager);
|
ClearFixedStatus(eEager);
|
||||||
|
pServ->simMode = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if(test > 0)
|
||||||
{
|
{
|
||||||
strcat(pBueffel,pRead);
|
strcat(pBueffel,pRead);
|
||||||
}
|
}
|
||||||
if(strstr(pBueffel,"TRANSACTIONFINISHED") == NULL)
|
}
|
||||||
|
if(strstr(pBueffel,"TRANSACTIONFINISHED") != NULL)
|
||||||
{
|
{
|
||||||
test = 1;
|
test = 1;
|
||||||
break;
|
break;
|
||||||
@ -209,6 +234,7 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
}
|
}
|
||||||
SicsWait(1);
|
SicsWait(1);
|
||||||
}
|
}
|
||||||
|
pServ->simMode = 1;
|
||||||
if(!test)
|
if(!test)
|
||||||
{
|
{
|
||||||
SCWrite(pCon,"WARNING: sync server may not have exectued backup",
|
SCWrite(pCon,"WARNING: sync server may not have exectued backup",
|
||||||
@ -227,7 +253,15 @@ int Synchronize(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
test = InterpExecute(pSics,internalCon,"restore");
|
if(syncFile != NULL)
|
||||||
|
{
|
||||||
|
sprintf(pBueffel,"restore %s",syncFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy(pBueffel,"restore");
|
||||||
|
}
|
||||||
|
test = InterpExecute(pSics,internalCon,pBueffel);
|
||||||
SCDeleteConnection(internalCon);
|
SCDeleteConnection(internalCon);
|
||||||
ClearFixedStatus(eEager);
|
ClearFixedStatus(eEager);
|
||||||
if(test != 1)
|
if(test != 1)
|
||||||
|
38
tasinit.c
38
tasinit.c
@ -201,6 +201,43 @@ extern char *tasVariableOrder[] = {
|
|||||||
"hconv4",
|
"hconv4",
|
||||||
"polfile",
|
"polfile",
|
||||||
NULL};
|
NULL};
|
||||||
|
/*-------------------------------------------------------------------
|
||||||
|
Normally SICS does not store motor hardware limits into status files as
|
||||||
|
they are read from the motor controller. However, in order to better
|
||||||
|
synchronize simulation and instrument this has to be done for TASP.
|
||||||
|
TasSave does just that: saving hard limits in order for the simulation to
|
||||||
|
be able to read them.
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
static int TasSaveStatus(void *self, char *name, FILE *fd)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
pMotor pMot;
|
||||||
|
float value;
|
||||||
|
SConnection *pCon = NULL;
|
||||||
|
|
||||||
|
pCon = SCCreateDummyConnection(pServ->pSics);
|
||||||
|
if(!pCon)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
while(tasMotorOrder[i] != NULL)
|
||||||
|
{
|
||||||
|
pMot = FindMotor(pServ->pSics,tasMotorOrder[i]);
|
||||||
|
if(pMot)
|
||||||
|
{
|
||||||
|
MotorGetPar(pMot,"hardupperlim",&value);
|
||||||
|
fprintf(fd,"%s hardupperlim %f\n",tasMotorOrder[i], value);
|
||||||
|
MotorGetPar(pMot,"hardlowerlim",&value);
|
||||||
|
fprintf(fd,"%s hardlowerlim %f\n",tasMotorOrder[i], value);
|
||||||
|
MotorGetSoftPosition(pMot,pCon,&value);
|
||||||
|
fprintf(fd,"run %s %f\n",tasMotorOrder[i], value);
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
SCDeleteConnection(pCon);
|
||||||
|
fprintf(fd,"success\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
/*---------------------------------------------------------------------
|
/*---------------------------------------------------------------------
|
||||||
There is a special feauture in MAD where the count mode is determined
|
There is a special feauture in MAD where the count mode is determined
|
||||||
which variable, MN for monitor od TI for time has been set as the last
|
which variable, MN for monitor od TI for time has been set as the last
|
||||||
@ -300,6 +337,7 @@ int TASFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
pNew->iPOL = -1;
|
pNew->iPOL = -1;
|
||||||
|
pNew->pDes->SaveStatus = TasSaveStatus;
|
||||||
|
|
||||||
/* connect to all the variables */
|
/* connect to all the variables */
|
||||||
iPtr = 0; iError = 0;
|
iPtr = 0; iError = 0;
|
||||||
|
Reference in New Issue
Block a user