- changed OxiGet
- various bug fixes and improvements
This commit is contained in:
14
ipsdriv.c
14
ipsdriv.c
@ -208,6 +208,7 @@ static void IpsStatus(Ips *drv) {
|
||||
drv->heaterFault = 1;
|
||||
return;
|
||||
}
|
||||
drv->heaterFault = 0;
|
||||
if (ans[8] == '1') {
|
||||
swi = 1;
|
||||
} else {
|
||||
@ -242,14 +243,14 @@ static long IpsRead(long pc, void *object) {
|
||||
rd:
|
||||
EaseWrite(eab, "R7"); /* read current (in Tesla) */
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
drv->current = OxiGet(eab, 3, NULL);
|
||||
drv->current = OxiGet(eab, 3, NULL, drv->current);
|
||||
if (drv->perswitch) {
|
||||
IpsSetField(drv, drv->current);
|
||||
goto quit;
|
||||
}
|
||||
EaseWrite(eab, "R18"); /* read persistant field (in Tesla) */
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
IpsSetField(drv, OxiGet(eab, 3, NULL));
|
||||
IpsSetField(drv, OxiGet(eab, 3, NULL, drv->persfield));
|
||||
|
||||
quit:
|
||||
ParLog(drv);
|
||||
@ -334,7 +335,7 @@ static long IpsChangeField(long pc, void *object) {
|
||||
IpsStatus(drv); /* just check for errors */
|
||||
EaseWrite(eab, "R7"); /* read current (in Tesla) */
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
drv->current = OxiGet(eab, 3, NULL);
|
||||
drv->current = OxiGet(eab, 3, NULL, drv->current);
|
||||
ParLog(drv);
|
||||
if (fabs(drv->current - drv->lastfield) > 1e-5) goto stab1;
|
||||
|
||||
@ -375,7 +376,6 @@ static long IpsChangeField(long pc, void *object) {
|
||||
eab->errCode = EASE_FAULT;
|
||||
goto off_finish;
|
||||
}
|
||||
drv->heaterFault = 0;
|
||||
}
|
||||
if (time(NULL) < drv->swtim + 30) goto start_ramp; /* wait */
|
||||
OxiSet(eab, "T", drv->ramp, 3);
|
||||
@ -391,13 +391,13 @@ static long IpsChangeField(long pc, void *object) {
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
EaseWrite(eab, "R7"); /* read "current" in Tesla */
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
IpsSetField(drv, OxiGet(eab, 3, NULL)); /* set drv->current and callback */
|
||||
IpsSetField(drv, OxiGet(eab, 3, NULL, drv->current)); /* set drv->current and callback */
|
||||
EaseWrite(eab, "X");
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
IpsStatus(drv); /* just check for errors */
|
||||
EaseWrite(eab, "R9"); /* read back ramp rate (may be sweep limited) */
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
ramp=OxiGet(eab, 3, NULL);
|
||||
ramp=OxiGet(eab, 3, NULL, drv->ramp);
|
||||
step=ramp/20; /* step = ramp * 3sec */
|
||||
if (step < 0.001) step=0.001;
|
||||
if (drv->d.targetValue > drv->current + step) {
|
||||
@ -442,7 +442,7 @@ static long IpsChangeField(long pc, void *object) {
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
EaseWrite(eab, "R18"); /* read persistent field in Tesla */
|
||||
return __LINE__; case __LINE__: /**********************************/
|
||||
fld = OxiGet(eab, 3, NULL);
|
||||
fld = OxiGet(eab, 3, NULL, drv->current);
|
||||
if (fld != drv->lastfield) {
|
||||
IpsSetField(drv, fld); /* set drv->current and callback */
|
||||
drv->lastfield = fld;
|
||||
|
Reference in New Issue
Block a user