- marked amilevel lsc370driv lscsupprt as obsoloete and removed from make_gen
- enhancements in ease, fsm, ipsdriv ighdriv
This commit is contained in:
@ -4,6 +4,8 @@ amilevel.c
|
|||||||
Driver for the AMI 135/136 level meter
|
Driver for the AMI 135/136 level meter
|
||||||
|
|
||||||
Markus Zolliker, May 2007
|
Markus Zolliker, May 2007
|
||||||
|
|
||||||
|
OBSOLETE, replaced by scriptcontext driver, May 2016
|
||||||
----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
8
ease.c
8
ease.c
@ -120,6 +120,7 @@ void EaseWrite(EaseBase * eab, char *cmd)
|
|||||||
int l;
|
int l;
|
||||||
|
|
||||||
if (eab->errCode) {
|
if (eab->errCode) {
|
||||||
|
FsmStop(eab->task, eab->idle);
|
||||||
eab->state = EASE_abort;
|
eab->state = EASE_abort;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -396,6 +397,9 @@ static long EaseIdle(long pc, void *object)
|
|||||||
switch (pc) {
|
switch (pc) {
|
||||||
default: /* FSM BEGIN ****************************** */
|
default: /* FSM BEGIN ****************************** */
|
||||||
EasePchk(eab);
|
EasePchk(eab);
|
||||||
|
if (eab->state == EASE_abort) {
|
||||||
|
eab->state = EASE_idle;
|
||||||
|
}
|
||||||
|
|
||||||
idle:
|
idle:
|
||||||
if (!EaseCheckDoit(eab))
|
if (!EaseCheckDoit(eab))
|
||||||
@ -408,10 +412,8 @@ static long EaseIdle(long pc, void *object)
|
|||||||
case __LINE__: /**********************************/
|
case __LINE__: /**********************************/
|
||||||
|
|
||||||
eab->startOk = 1;
|
eab->startOk = 1;
|
||||||
if (eab->state == EASE_abort) {
|
|
||||||
eab->state = EASE_idle;
|
|
||||||
}
|
|
||||||
rd:
|
rd:
|
||||||
|
/* rd: */
|
||||||
/*
|
/*
|
||||||
if (eab->state == EASE_lost) {
|
if (eab->state == EASE_lost) {
|
||||||
snprintf(eab->msg, sizeof eab->msg, "no response from %s",
|
snprintf(eab->msg, sizeof eab->msg, "no response from %s",
|
||||||
|
6
fsm.c
6
fsm.c
@ -155,7 +155,11 @@ int FsmStop(Fsm * task, FsmFunc func)
|
|||||||
}
|
}
|
||||||
if (i == task->sp) { /* not found on stack */
|
if (i == task->sp) { /* not found on stack */
|
||||||
if (func != task->func)
|
if (func != task->func)
|
||||||
return 0; /* is also not running function */
|
return 0; /* is also not running function */\
|
||||||
|
/*
|
||||||
|
task->sp = 0;
|
||||||
|
task->func = task->stack[0].func; */ /* pretty unsure about this */
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
task->sp = i; /* unwind stack to level i */
|
task->sp = i; /* unwind stack to level i */
|
||||||
}
|
}
|
||||||
|
116
ighdriv.c
116
ighdriv.c
@ -43,8 +43,8 @@ Markus Zolliker, May 2005
|
|||||||
|
|
||||||
static char *valves[] =
|
static char *valves[] =
|
||||||
{ "V9", "V8", "V7", "V11A", "V13A", "V13B", "V11B", "V12B",
|
{ "V9", "V8", "V7", "V11A", "V13A", "V13B", "V11B", "V12B",
|
||||||
" He4", "V1", "V5", "V4", "V3", "V14", "V10", "V2",
|
"He4", "V1", "V5", "V4", "V3", "V14", "V10", "V2",
|
||||||
" V2A", " V1A", "V5A", " V4A", " V3A", " Roots", " Aux", "He3",
|
"V2A", "V1A", "V5A", "V4A", "V3A", "Roots", "Aux", "He3",
|
||||||
NULL
|
NULL
|
||||||
}; /* valves beginning with blank are not shown in list */
|
}; /* valves beginning with blank are not shown in list */
|
||||||
typedef enum { V9, V8, V7, V11A, V13A, V13B, V11B, V12B,
|
typedef enum { V9, V8, V7, V11A, V13A, V13B, V11B, V12B,
|
||||||
@ -81,6 +81,14 @@ typedef struct {
|
|||||||
int s; /* moving valve state */
|
int s; /* moving valve state */
|
||||||
int remote;
|
int remote;
|
||||||
long hrSync;
|
long hrSync;
|
||||||
|
float closedelay; /* if > 0: next valve command is a pulsed opening */
|
||||||
|
int closevalve; /* number of valve to be closed */
|
||||||
|
double opentime; /* time when valve was opened */
|
||||||
|
/* extensions (ext_watchdog Arduino) */
|
||||||
|
int extVersion; /* 0 for no extension, else extension version */
|
||||||
|
int pumpoff; /* pump signal after overpressure switch */
|
||||||
|
float upperN2; /* LN2 trap sensor */
|
||||||
|
float lowerN2;
|
||||||
} Igh;
|
} Igh;
|
||||||
|
|
||||||
static ParClass ighClass = { "IGH", sizeof(Igh) };
|
static ParClass ighClass = { "IGH", sizeof(Igh) };
|
||||||
@ -276,6 +284,30 @@ static void IghParDef(void *object)
|
|||||||
ParPrintf(NULL, eValue, "open valves:%s", vList);
|
ParPrintf(NULL, eValue, "open valves:%s", vList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ParName("closedelay");
|
||||||
|
ParAccess(usUser);
|
||||||
|
ParSave(1);
|
||||||
|
ParFloat(&drv->closedelay, 0);
|
||||||
|
|
||||||
|
ParName("extVersion");
|
||||||
|
ParAccess(usUser);
|
||||||
|
ParSave(1);
|
||||||
|
ParInt(&drv->extVersion, PAR_LNAN);
|
||||||
|
|
||||||
|
ParName("pumpoff");
|
||||||
|
if (drv->extVersion != 0) ParTail("");
|
||||||
|
ParInt(&drv->pumpoff, PAR_LNAN);
|
||||||
|
|
||||||
|
ParName("upperN2");
|
||||||
|
ParFmt("%.1f");
|
||||||
|
if (drv->extVersion != 0) ParTail("K");
|
||||||
|
ParFloat(&drv->upperN2, PAR_NAN);
|
||||||
|
|
||||||
|
ParName("lowerN2");
|
||||||
|
ParFmt("%.1f");
|
||||||
|
if (drv->extVersion != 0) ParTail("K");
|
||||||
|
ParFloat(&drv->lowerN2, PAR_NAN);
|
||||||
|
|
||||||
EaseBasePar(drv);
|
EaseBasePar(drv);
|
||||||
EaseSendPar(drv);
|
EaseSendPar(drv);
|
||||||
if (eab->syntax != OLDIGH) {
|
if (eab->syntax != OLDIGH) {
|
||||||
@ -295,6 +327,13 @@ void IghStatus(Igh * drv)
|
|||||||
|
|
||||||
if (drv->d.b.state != EASE_read)
|
if (drv->d.b.state != EASE_read)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (drv->opentime > 0 &&
|
||||||
|
DoubleTime() > drv->opentime + (double)drv->closedelay - 1) {
|
||||||
|
/* force a call to IghSet */
|
||||||
|
drv->d.b.todo = drv->d.b.doit;
|
||||||
|
}
|
||||||
|
|
||||||
ans = drv->d.b.ans;
|
ans = drv->d.b.ans;
|
||||||
code = &drv->d.b.errCode;
|
code = &drv->d.b.errCode;
|
||||||
if (ans[0] != 'X' ||
|
if (ans[0] != 'X' ||
|
||||||
@ -349,8 +388,10 @@ static long IghRead(long pc, void *object)
|
|||||||
EaseBase *eab = object;
|
EaseBase *eab = object;
|
||||||
char *p;
|
char *p;
|
||||||
int l;
|
int l;
|
||||||
|
int switched_off;
|
||||||
time_t now;
|
time_t now;
|
||||||
float delta;
|
float delta;
|
||||||
|
int up10, lo10;
|
||||||
|
|
||||||
switch (pc) {
|
switch (pc) {
|
||||||
default: /* FSM BEGIN ****************************** */
|
default: /* FSM BEGIN ****************************** */
|
||||||
@ -560,6 +601,47 @@ static long IghRead(long pc, void *object)
|
|||||||
case __LINE__: /**********************************/
|
case __LINE__: /**********************************/
|
||||||
drv->press[P2] = OxiGet(eab, 1, NULL, drv->press[P2]);
|
drv->press[P2] = OxiGet(eab, 1, NULL, drv->press[P2]);
|
||||||
|
|
||||||
|
if (EaseCheckDoit(eab) || drv->extVersion == 0)
|
||||||
|
goto quit;
|
||||||
|
|
||||||
|
EaseWrite(eab, "{r}");
|
||||||
|
return __LINE__;
|
||||||
|
case __LINE__: /**********************************/
|
||||||
|
/* analyze */
|
||||||
|
if (3 == sscanf(drv->d.b.ans, "?{%d,%d,%d}",
|
||||||
|
&l, &up10, &lo10)) {
|
||||||
|
switched_off = (drv->v[HE3] == 1 && l == 1);
|
||||||
|
drv->pumpoff = l;
|
||||||
|
drv->upperN2 = 0.1 * up10;
|
||||||
|
drv->lowerN2 = 0.1 * lo10;
|
||||||
|
} else {
|
||||||
|
drv->pumpoff = PAR_LNAN;
|
||||||
|
drv->upperN2 = PAR_NAN;
|
||||||
|
drv->lowerN2 = PAR_NAN;
|
||||||
|
}
|
||||||
|
if (!switched_off) goto quit;
|
||||||
|
/* veryfy pump control */
|
||||||
|
EaseWrite(eab, "X");
|
||||||
|
return __LINE__;
|
||||||
|
case __LINE__: /**********************************/
|
||||||
|
IghStatus(drv);
|
||||||
|
if (drv->v[HE3] == 0) goto quit; /* switched off intentionally */
|
||||||
|
/* overpressure switch activated: we switch pump control off */
|
||||||
|
EaseWrite(eab, "C3");
|
||||||
|
drv->remote = 2;
|
||||||
|
return __LINE__;
|
||||||
|
case __LINE__: /**********************************/
|
||||||
|
EaseWrite(eab, "P49");
|
||||||
|
return __LINE__;
|
||||||
|
case __LINE__: /**********************************/
|
||||||
|
EaseWrite(eab, "C0");
|
||||||
|
return __LINE__;
|
||||||
|
case __LINE__: /**********************************/
|
||||||
|
drv->remote = 0;
|
||||||
|
ParPrintf(eab, eLogError,
|
||||||
|
"ERROR: overpressure after 3He pump (switched off)");
|
||||||
|
eab->errCode = EASE_FAULT;
|
||||||
|
|
||||||
quit:
|
quit:
|
||||||
ParLog(drv);
|
ParLog(drv);
|
||||||
fsm_quit:return 0;
|
fsm_quit:return 0;
|
||||||
@ -610,6 +692,7 @@ static long IghSet(long pc, void *object)
|
|||||||
int upd;
|
int upd;
|
||||||
int i;
|
int i;
|
||||||
float mp;
|
float mp;
|
||||||
|
double now, deadline;
|
||||||
|
|
||||||
switch (pc) {
|
switch (pc) {
|
||||||
default: /* FSM BEGIN ****************************** */
|
default: /* FSM BEGIN ****************************** */
|
||||||
@ -619,6 +702,12 @@ static long IghSet(long pc, void *object)
|
|||||||
loop:
|
loop:
|
||||||
return __LINE__;
|
return __LINE__;
|
||||||
case __LINE__: /**********************************/
|
case __LINE__: /**********************************/
|
||||||
|
if (drv->opentime > 0) {
|
||||||
|
now = DoubleTime();
|
||||||
|
deadline = drv->opentime + (double)drv->closedelay;
|
||||||
|
if (now > deadline) goto close_valve;
|
||||||
|
if (now > deadline - 1) goto loop;
|
||||||
|
}
|
||||||
upd = EaseNextUpdate(drv);
|
upd = EaseNextUpdate(drv);
|
||||||
if (upd >= VALVE_FLAGS)
|
if (upd >= VALVE_FLAGS)
|
||||||
goto set_valve;
|
goto set_valve;
|
||||||
@ -782,12 +871,34 @@ static long IghSet(long pc, void *object)
|
|||||||
|
|
||||||
set_valve:
|
set_valve:
|
||||||
i = upd - VALVE_FLAGS;
|
i = upd - VALVE_FLAGS;
|
||||||
|
if (drv->closedelay > 0) {
|
||||||
|
if (drv->v[i]) {
|
||||||
|
if (drv->opentime == 0) {
|
||||||
|
drv->opentime = DoubleTime();
|
||||||
|
drv->closevalve = i;
|
||||||
|
}
|
||||||
|
} else if (drv->closevalve == i) {
|
||||||
|
/* early close by command */
|
||||||
|
drv->opentime = 0;
|
||||||
|
drv->closedelay = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
snprintf(buf, sizeof buf, "P%d", i * 2 + 3 - drv->v[i]);
|
snprintf(buf, sizeof buf, "P%d", i * 2 + 3 - drv->v[i]);
|
||||||
EaseWrite(eab, buf);
|
EaseWrite(eab, buf);
|
||||||
return __LINE__;
|
return __LINE__;
|
||||||
case __LINE__: /**********************************/
|
case __LINE__: /**********************************/
|
||||||
goto loop;
|
goto loop;
|
||||||
|
|
||||||
|
close_valve:
|
||||||
|
drv->opentime = 0;
|
||||||
|
drv->closedelay = 0;
|
||||||
|
drv->v[drv->closevalve] = 0;
|
||||||
|
snprintf(buf, sizeof buf, "P%d", drv->closevalve * 2 + 3); /* close cmd */
|
||||||
|
EaseWrite(eab, buf);
|
||||||
|
return __LINE__;
|
||||||
|
case __LINE__: /**********************************/
|
||||||
|
goto loop;
|
||||||
|
|
||||||
set_mot:
|
set_mot:
|
||||||
i = upd - MOT_FLAGS;
|
i = upd - MOT_FLAGS;
|
||||||
if (drv->mv[i] > 99.9) {
|
if (drv->mv[i] > 99.9) {
|
||||||
@ -824,6 +935,7 @@ static int IghInit(SConnection * con, int argc, char *argv[], int dynamic)
|
|||||||
IghSet);
|
IghSet);
|
||||||
if (drv == NULL)
|
if (drv == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
drv->opentime = 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ static void IpsStatus(Ips * drv)
|
|||||||
switch (ans[1]) {
|
switch (ans[1]) {
|
||||||
case '0':
|
case '0':
|
||||||
if (ans[6] > '3') {
|
if (ans[6] > '3') {
|
||||||
errmsg = "ERROR: auto-run-down (low He level)";
|
errmsg = "ERROR: auto-run-down (He level is/was low - press SILENCE on ILM after filling)";
|
||||||
} else {
|
} else {
|
||||||
errmsg = "";
|
errmsg = "";
|
||||||
}
|
}
|
||||||
@ -461,7 +461,7 @@ static long IpsRead(long pc, void *object)
|
|||||||
checktodo:
|
checktodo:
|
||||||
if (eab->msg[0] != '\0') goto quit; /* no action when in error */
|
if (eab->msg[0] != '\0') goto quit; /* no action when in error */
|
||||||
now = time(NULL);
|
now = time(NULL);
|
||||||
if (drv->persmode == 2) { /* persistent mode off */
|
if (drv->persmode >= 2) { /* persistent mode off */
|
||||||
drv->dothis = NOTHING;
|
drv->dothis = NOTHING;
|
||||||
goto nothing;
|
goto nothing;
|
||||||
} else {
|
} else {
|
||||||
|
1
lcdriv.c
1
lcdriv.c
@ -21,7 +21,6 @@ Markus Zolliker, Sept 2004
|
|||||||
#include <emon.h>
|
#include <emon.h>
|
||||||
#include <evcontroller.h>
|
#include <evcontroller.h>
|
||||||
#include <evcontroller.i>
|
#include <evcontroller.i>
|
||||||
#include <servlog.h>
|
|
||||||
#include <sicsvar.h>
|
#include <sicsvar.h>
|
||||||
#include <evdriver.i>
|
#include <evdriver.i>
|
||||||
#include <rs232controller.h>
|
#include <rs232controller.h>
|
||||||
|
@ -4,6 +4,8 @@ lsc370driv.c
|
|||||||
Driver for the LakeShore Model 370 AC Resistance Bridge
|
Driver for the LakeShore Model 370 AC Resistance Bridge
|
||||||
|
|
||||||
Markus Zolliker, July 2006
|
Markus Zolliker, July 2006
|
||||||
|
|
||||||
|
OBSOLETE, scriptcontext driver in use May 2016
|
||||||
----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -6,6 +6,8 @@ Communication routines for LakeShore equipment
|
|||||||
Markus Zolliker, July 2006
|
Markus Zolliker, July 2006
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
OBSOLETE (scriptcontext driver in use) May 2016
|
||||||
|
|
||||||
there is no error return value, eab->errCode is used. On success, eab->errCode
|
there is no error return value, eab->errCode is used. On success, eab->errCode
|
||||||
is not changed, i.e. an existing errCode is not overwritten.
|
is not changed, i.e. an existing errCode is not overwritten.
|
||||||
*/
|
*/
|
||||||
|
5
make_gen
5
make_gen
@ -12,7 +12,7 @@
|
|||||||
OBJ=psi.o buffer.o ruli.o sps.o pimotor.o \
|
OBJ=psi.o buffer.o ruli.o sps.o pimotor.o \
|
||||||
pipiezo.o sanswave.o faverage.o spss7.o\
|
pipiezo.o sanswave.o faverage.o spss7.o\
|
||||||
amorstat.o tasinit.o ptasdrive.o tasutil.o tasscan.o swmotor.o \
|
amorstat.o tasinit.o ptasdrive.o tasutil.o tasscan.o swmotor.o \
|
||||||
polterwrite.o ecb.o frame.o sqlitelog.o mongolog.o sicslogquery.o approxidate.o \
|
polterwrite.o ecb.o frame.o \
|
||||||
el737driv.o sinqhmdriv.o tdchm.o \
|
el737driv.o sinqhmdriv.o tdchm.o \
|
||||||
sanscook.o itc4driv.o itc4.o\
|
sanscook.o itc4driv.o itc4.o\
|
||||||
bruker.o ltc11.o eurodriv.o \
|
bruker.o ltc11.o eurodriv.o \
|
||||||
@ -32,8 +32,7 @@ OBJ=psi.o buffer.o ruli.o sps.o pimotor.o \
|
|||||||
|
|
||||||
MZOBJ=fsm.o sugar.o pardef.o ease.o strobj.o oxinst.o \
|
MZOBJ=fsm.o sugar.o pardef.o ease.o strobj.o oxinst.o \
|
||||||
ipsdriv.o ilmdriv.o itcdriv.o ighdriv.o euro2kdriv.o modbus.o arrobj.o \
|
ipsdriv.o ilmdriv.o itcdriv.o ighdriv.o euro2kdriv.o modbus.o arrobj.o \
|
||||||
lscsupport.o lsc370driv.o linadriv.o haakedriv.o amilevel.o \
|
linadriv.o haakedriv.o seaclientprot.o dumprot.o
|
||||||
seaclientprot.o dumprot.o
|
|
||||||
|
|
||||||
libpsi.a: $(OBJ)
|
libpsi.a: $(OBJ)
|
||||||
rm -f libpsi.a
|
rm -f libpsi.a
|
||||||
|
4
psi.c
4
psi.c
@ -50,12 +50,8 @@ void SiteInit(void)
|
|||||||
INIT(Euro2kStartup);
|
INIT(Euro2kStartup);
|
||||||
INIT(StrObjStartup);
|
INIT(StrObjStartup);
|
||||||
INIT(ArrayObjStartup);
|
INIT(ArrayObjStartup);
|
||||||
INIT(Lsc370Startup);
|
|
||||||
INIT(LinaStartup);
|
INIT(LinaStartup);
|
||||||
INIT(HaakeStartup);
|
INIT(HaakeStartup);
|
||||||
INIT(AmiStartup);
|
|
||||||
INIT(SqliteLogInit);
|
|
||||||
INIT(MongoLogInit);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SICS specific Asynchronous I/O protocols
|
* SICS specific Asynchronous I/O protocols
|
||||||
|
Reference in New Issue
Block a user