- small improvements in drivers
This commit is contained in:
31
lsc370driv.c
31
lsc370driv.c
@ -33,6 +33,7 @@ Markus Zolliker, July 2006
|
||||
#define PID_FLAG 1
|
||||
#define RDGRNG_FLAG 2
|
||||
#define HTRRNG_FLAG 3
|
||||
#define MAX_CHAN 3
|
||||
|
||||
typedef struct {
|
||||
EaseDriv d;
|
||||
@ -44,12 +45,15 @@ typedef struct {
|
||||
float integ;
|
||||
float deriv;
|
||||
float resist; /* Ohm */
|
||||
float temp[MAX_CHAN];
|
||||
int channel[MAX_CHAN];
|
||||
int ighHeater; /* IGH heater range (-1 if output is direct) */
|
||||
int htrRange;
|
||||
int currentEx;
|
||||
int voltageEx;
|
||||
int range;
|
||||
int autoRange;
|
||||
int index;
|
||||
} Lsc370;
|
||||
|
||||
static ParClass lsc370Class = { "LSC370", sizeof(Lsc370) };
|
||||
@ -85,6 +89,8 @@ static void Lsc370ParDef(void *object) {
|
||||
EaseBase *eab = object;
|
||||
float power, maxPower;
|
||||
int iRng;
|
||||
int i;
|
||||
|
||||
static char *heaterList[]={"off",
|
||||
"30uA", "100uA", "300uA",
|
||||
"1mA", "3mA", "10mA", "30mA", "100mA", NULL };
|
||||
@ -104,8 +110,11 @@ static void Lsc370ParDef(void *object) {
|
||||
"2MegaOhm", "6MegaOhm", "20MegaOhm", "60MegaOhm", NULL };
|
||||
static char *offOn[]={"off", "on", NULL};
|
||||
|
||||
static char *tNames[]={"tsample", "tstill", "tmix"};
|
||||
static char *cNames[]={"csample", "cstill", "cmix"};
|
||||
|
||||
ParName(""); ParTail("K");
|
||||
ParFloat(&drv->t, PAR_NAN);
|
||||
ParFloat(&drv->temp[0], PAR_NAN);
|
||||
|
||||
ParName("set"); ParTail("K");
|
||||
ParFloat(&drv->set, PAR_NAN);
|
||||
@ -113,6 +122,15 @@ static void Lsc370ParDef(void *object) {
|
||||
ParName("htr"); ParTail("%");
|
||||
ParFloat(&drv->htr, PAR_NAN);
|
||||
|
||||
for (i = 0; i < MAX_CHAN; i++) {
|
||||
if (drv->channel[i] > 0 && i > 0) {
|
||||
ParName(tNames[i]); ParTail("K");
|
||||
ParFloat(&drv->temp[i], PAR_NAN);
|
||||
}
|
||||
ParName(cNames[i]); ParAccess(usUser);
|
||||
ParInt(&drv->channel[i], 0);
|
||||
}
|
||||
|
||||
ParName("res"); ParTail("Ohm");
|
||||
ParFloat(&drv->res, PAR_NAN);
|
||||
|
||||
@ -217,14 +235,21 @@ static long Lsc370Read(long pc, void *object) {
|
||||
EaseBase *eab = object;
|
||||
int mode, exi, rng, autoR, eoff;
|
||||
float x, y, z;
|
||||
char buf[16];
|
||||
|
||||
switch (pc) { default: /* FSM BEGIN *******************************/
|
||||
EaseWrite(eab, "RDGK?1");
|
||||
drv->index = 0;
|
||||
chanLoop:
|
||||
snprintf(buf, sizeof buf, "RDGK?%d", drv->channel[drv->index]);
|
||||
EaseWrite(eab, buf);
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
|
||||
if (1 == sscanf(eab->ans, "%f", &x)) {
|
||||
drv->t = x;
|
||||
drv->temp[drv->index] = x;
|
||||
}
|
||||
drv->index++;
|
||||
if (drv->index < MAX_CHAN) goto chanLoop;
|
||||
|
||||
EaseWrite(eab, "RDGR?1");
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
if (1 == sscanf(eab->ans, "%f", &x)) {
|
||||
|
Reference in New Issue
Block a user