lakeshore340_common.tcl
Lakeshore controllers will be connected to the ca5-[instrument] moxa box Default config parameters are now available via a tc_dfltPar array IP and socket number are now mandatory when creating an ls340 object hrpd/.../lakeshore340.tcl Multiple lakeshores can now be added to the hdb tree echidna_configuration.tcl Provide example for configuring two lakeshores SICS-134 reflectometer/../commands.tcl First draft of beam/attenuator command, currently sends POS=xx (this won't work) reflectometer/../motor_configuration.tcl Add bat position feedback via action sans/../motor_configuration.tcl Renamed action parameter (aoid) to "action" server_config.tcl Initialise motor movecount to 500 to reduce number of position updates by a factor of 50 SICS-134 action.c Update the beam/attenuator command feedback variable when POS changes. SICS-134 motor_dmc2280.c Added PLP:BAT:POS status response handler for platypus bat position updates Only send IDLE state position updates if position change is greater than the precision. Rename action parameter (aoid) to "action" r2679 | ffr | 2008-08-19 15:11:55 +1000 (Tue, 19 Aug 2008) | 31 lines
This commit is contained in:
committed by
Douglas Clowes
parent
8090104407
commit
165f1b90a4
@@ -1249,9 +1249,10 @@ static int rspStatus(pDMC2280Driv self, const char* text) {
|
||||
&iStopCode, &iTIzero, &iTIone, &iXQ0);
|
||||
if (iRet != 8)
|
||||
return 0;
|
||||
/* TODO some kind of callback for builtin status would be better */
|
||||
/* TODO Put the following in specialised response handlers */
|
||||
if (self->ao_id[0] != '\0') {
|
||||
AO_istatus(iTIone, "TI1");
|
||||
AO_istatus(iTIone, "QKK:TI1");
|
||||
AO_istatus(iSteps, "PLP:BAT:POS");
|
||||
}
|
||||
if (self->axisLabel >= 'A' && self->axisLabel <= 'D')
|
||||
iIOByte = iTIzero;
|
||||
@@ -1745,7 +1746,9 @@ static void DMCState_Idle(pDMC2280Driv self, pEvtEvent event) {
|
||||
pAsyncTxn pCmd = event->event.msg.cmd;
|
||||
if (self->subState == 1) { /* Status Response */
|
||||
int iRet;
|
||||
long lDelta;
|
||||
long lDelta, lprecision;
|
||||
float fprecision;
|
||||
|
||||
iRet = rspStatus(self, pCmd->inp_buf);
|
||||
if (iRet == 0)
|
||||
break;
|
||||
@@ -1756,11 +1759,16 @@ static void DMCState_Idle(pDMC2280Driv self, pEvtEvent event) {
|
||||
return;
|
||||
}
|
||||
/* if the motor moved, update any observers */
|
||||
if (self->abs_encoder)
|
||||
MotorGetPar(self->pMot, "precision", &fprecision);
|
||||
if (self->abs_encoder) {
|
||||
lDelta = fabs(self->currCounts - self->lastCounts);
|
||||
else
|
||||
lprecision = (long) (fprecision * self->cntsPerX + 0.5);
|
||||
} else {
|
||||
lDelta = fabs(self->currSteps - self->lastSteps);
|
||||
if (lDelta > 10) {
|
||||
lprecision = (long) (fprecision * self->stepsPerX + 0.5);
|
||||
}
|
||||
|
||||
if (lDelta > lprecision) {
|
||||
set_lastMotion(self, self->currSteps, self->currCounts);
|
||||
report_motion(self);
|
||||
}
|
||||
@@ -3660,7 +3668,7 @@ MotorDriver *CreateDMC2280(SConnection *pCon, char *motor, char *params) {
|
||||
}
|
||||
|
||||
pNew->ao_id[0] = '\0';
|
||||
if ((pPtr=getParam(pCon, interp, params, "aoid", _OPTIONAL)) != NULL) {
|
||||
if ((pPtr=getParam(pCon, interp, params, "action", _OPTIONAL)) != NULL) {
|
||||
strncpy(pNew->ao_id, pPtr, sizeof(pNew->ao_id));
|
||||
pNew->ao_id[sizeof(pNew->ao_id) - 1] = '\0';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user