- Fixed a confusing error message with the SANS-2 velocity selector
- Added a parameter DEC to the motor driver which determines the number of decimals on the fucking display screen and made this work too
This commit is contained in:
11
dornier2.c
11
dornier2.c
@ -70,6 +70,12 @@ typedef struct __VelSelDriv *pVelSelDriv;
|
|||||||
has yet been read. Solves a starting
|
has yet been read. Solves a starting
|
||||||
problem
|
problem
|
||||||
*/
|
*/
|
||||||
|
int firstStatus; /* at times the nvs does not send
|
||||||
|
the reply to the first status
|
||||||
|
request after starting. This flag
|
||||||
|
helps to suppress an error message
|
||||||
|
which may be confusing to loosers
|
||||||
|
*/
|
||||||
} Dornier, *pDornier;
|
} Dornier, *pDornier;
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
static int requestDornierStatus(pDornier pDorn){
|
static int requestDornierStatus(pDornier pDorn){
|
||||||
@ -271,6 +277,7 @@ static int takeControl(pDornier pDorn){
|
|||||||
iRet = transactRS232(pDorn->controller,pCommand,strlen(pCommand),
|
iRet = transactRS232(pDorn->controller,pCommand,strlen(pCommand),
|
||||||
pAnswer,49);
|
pAnswer,49);
|
||||||
setRS232ReplyTerminator(pDorn->controller,"\n");
|
setRS232ReplyTerminator(pDorn->controller,"\n");
|
||||||
|
pDorn->firstStatus = 1;
|
||||||
if(iRet != 1)
|
if(iRet != 1)
|
||||||
{
|
{
|
||||||
if(iRet != INCOMPLETE){
|
if(iRet != INCOMPLETE){
|
||||||
@ -389,6 +396,10 @@ static int evaluateStatus(pVelSelDriv self, int *iCode){
|
|||||||
pDorn->statusMode = STATSEND;
|
pDorn->statusMode = STATSEND;
|
||||||
status = readAndInterpretStatus(pDorn,&sStatus);
|
status = readAndInterpretStatus(pDorn,&sStatus);
|
||||||
if(!status){
|
if(!status){
|
||||||
|
if(pDorn->firstStatus == 1){
|
||||||
|
pDorn->firstStatus = 0;
|
||||||
|
return VSACCEL;
|
||||||
|
}
|
||||||
return VELOFAIL;
|
return VELOFAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,8 +68,9 @@ Parameter indexes in ObPar array and meanings
|
|||||||
#define DEG2STEP 14 /* conversion factor from degree to encoder digits */
|
#define DEG2STEP 14 /* conversion factor from degree to encoder digits */
|
||||||
#define BACKLASH 15 /* motor backlash */
|
#define BACKLASH 15 /* motor backlash */
|
||||||
#define PORT 17 /* ECB port when multiplexed */
|
#define PORT 17 /* ECB port when multiplexed */
|
||||||
|
#define DEC 18 /* Decimals in display */
|
||||||
|
|
||||||
#define MAXPAR 19 /* 1 extra for the sentinel, do not forget to initialize! */
|
#define MAXPAR 20 /* 1 extra for the sentinel, do not forget to initialize! */
|
||||||
|
|
||||||
/*------------------------------ ECB defines -------------------------*/
|
/*------------------------------ ECB defines -------------------------*/
|
||||||
#define MAX_ENCODER 40
|
#define MAX_ENCODER 40
|
||||||
@ -483,6 +484,7 @@ static int loadGearing(pECBMotDriv self){
|
|||||||
Ecb_pack data;
|
Ecb_pack data;
|
||||||
Z80_reg in, out;
|
Z80_reg in, out;
|
||||||
|
|
||||||
|
dec = (int)ObVal(self->driverPar,DEC);
|
||||||
in.c = self->ecbIndex;
|
in.c = self->ecbIndex;
|
||||||
dgear = (double) ObVal(self->driverPar,STEPS2DEG);;
|
dgear = (double) ObVal(self->driverPar,STEPS2DEG);;
|
||||||
|
|
||||||
@ -1232,6 +1234,7 @@ static void initializeParameters(pECBMotDriv self){
|
|||||||
ObParInit(self->driverPar,DEG2STEP,"step2dig",0,usMugger);
|
ObParInit(self->driverPar,DEG2STEP,"step2dig",0,usMugger);
|
||||||
ObParInit(self->driverPar,BACKLASH,"backlash",0,usMugger);
|
ObParInit(self->driverPar,BACKLASH,"backlash",0,usMugger);
|
||||||
ObParInit(self->driverPar,PORT,"port",0,usMugger);
|
ObParInit(self->driverPar,PORT,"port",0,usMugger);
|
||||||
|
ObParInit(self->driverPar,DEC,"dec",1,usMugger);
|
||||||
ObParInit(self->driverPar,MAXPAR-1,"tueet",-100,-100); /* sentinel! */
|
ObParInit(self->driverPar,MAXPAR-1,"tueet",-100,-100); /* sentinel! */
|
||||||
}
|
}
|
||||||
/*=======================================================================*/
|
/*=======================================================================*/
|
||||||
|
Reference in New Issue
Block a user