- ECB motors without encoders, with encoders and with control bits now work

This commit is contained in:
cvs
2003-01-24 15:38:32 +00:00
parent f45c3ebf55
commit e4d4643123
8 changed files with 649 additions and 58 deletions

21
ecb.w
View File

@@ -14,6 +14,11 @@ This module now implements three basic functionalities of the ECB:
\item Write some memory
\end{itemize}
This module also takes care of the encoder assignment for the ECB. The
ECB can have up to three encoders which can be assigned to motors. As
a single motor driver does not know about the assignments of the other
motors, the task of encoder assignement is handled in this module.
WARNING: this module contains code which may be endian dependend!
In order to do this we need the following data structure:
@@ -25,6 +30,8 @@ In order to do this we need the following data structure:
int ecbAddress;
int ecbDeviceID;
int lastError;
int encoder[3];
int encoderDirty;
}ECB;
@}
The fields:
@@ -36,6 +43,10 @@ The fields:
\item[ecbDeviceID] The device ID assigned to the ECB when the ECB has
been attached to.
\item[lastError] The last error which occurred.
\item[encoder] An array holding the motor numbers assigned to the
three encoder.
\item[encoderDirty] is a flag which is set to true if a download of
the encoder assignments is necessary.
\end{description}
A function in the ECB is executed by sending a function number first,
@@ -63,7 +74,13 @@ The function interface then looks like:
void *buffer, int byteCount);
void ecbClear(pECB self);
int fixECBError(pECB self);
void ecbErrorDescription(pECB self, char *buffer, int maxBytes);
void ecbErrorDescription(pECB self, char *buffer,
int maxBytes);
int ecbAssignEncoder(pECB self, int encoder, int motorNumber);
int ecbLoadEncoder(pECB self);
@}
\begin{description}
@@ -79,6 +96,8 @@ ECB's memory space and not the GPIB address.
\item[fixECBError] tries to fix the last ECB error.
\item[ecbErrorDescription] retrieves a text description of the last
ECB problem. Max maxBytes of description are copied into buffer.
\item[assignEncoder] assigns an encoder to a motor number.
\item[loadEncoder] downloads the encoder assignment to the ECB if necessary.
\end{description}