- Added separate drivable motors for four circle H, K, L
- Added a listen mode to commandlog in order to support the batchEditor - Some small fixes to exe* for BatchEditor
This commit is contained in:
67
hkl.w
67
hkl.w
@ -8,6 +8,9 @@ provided by Jean Allibon, ILL with the MAD four circle diffractometer
|
||||
control program in ANSI-C. For theory, see the contribution by
|
||||
W.C. Hamilton in the International Tables for Crystallography, 1974 edition.
|
||||
|
||||
There is a sister object to HKL which uses HKL to implement virtual motors for
|
||||
H, K, and L. See below for the description
|
||||
|
||||
The object uses the following object data structure:
|
||||
@d hkldat @{
|
||||
typedef struct __HKL {
|
||||
@ -28,6 +31,8 @@ The object uses the following object data structure:
|
||||
pSelVar pMono;
|
||||
long lID;
|
||||
float scanTolerance;
|
||||
float targetHKL[3];
|
||||
int targetDirty;
|
||||
} HKL;
|
||||
@}
|
||||
|
||||
@ -52,7 +57,10 @@ checking.
|
||||
This is detector tilt.
|
||||
\item[pMono] The selector variable doing the wavelength.
|
||||
\item[scanTolerance] The hkl module refuses to position a reflection if it is
|
||||
to close to omega limits for scanning. This is the tolerance to use.
|
||||
to close to omega limits for scanning. This is the tolerance to use.
|
||||
\item[targetHKL] The target HKL values to support the H, K, L virtual motors
|
||||
\item[targetDirty] A flag which is set when the virtual motors have to recalculate the
|
||||
settings and to drive.
|
||||
\end{description}
|
||||
|
||||
The wavelength is a bit tricky. As it would be to time consuming to read two
|
||||
@ -85,6 +93,7 @@ module:
|
||||
int GetLambda(pHKL self, float *fVal);
|
||||
int GetCurrentHKL(pHKL self, float fVal[3]);
|
||||
int GetCurrentPosition(pHKL self, SConnection *pCon, float fPosition[4]);
|
||||
int GetHKLFromAngles(pHKL self, SConnection *pCon, float fVal[3]);
|
||||
|
||||
int CalculateSettings(pHKL self, float fHKL[3], float fPsi, int iHamil,
|
||||
float fSet[4],SConnection *pCon);
|
||||
@ -141,6 +150,7 @@ pointer to the connection object doing the command for error messages and
|
||||
everything. The error returns are the same as with CalculateSettings
|
||||
well. With the addition of HKJMOTFAIL, which means that a motor failed to
|
||||
drive properly.
|
||||
\item[GetHKLFromAngles] calculates the current HKL from Angles.
|
||||
\item[DriveSettings] drives to the the settings given in fSet.
|
||||
\item[HKLAction] is the interpreter wrapper function for the HKL object.
|
||||
\end{description}
|
||||
@ -178,3 +188,58 @@ drive properly.
|
||||
@<hklint@>
|
||||
#endif
|
||||
@}
|
||||
|
||||
\subsubsection{The Crystallographic Virtual Motor Object}
|
||||
This module implements virtual motors H, K and L on top of the HKL object. It was choosen to implement this
|
||||
in a separate module because the hkl module is already big and complex enough. The problem is how to
|
||||
keep track of the necessary settings for HKL because the motors are interrelated. This is solved in the
|
||||
following scheme:
|
||||
\begin{itemize}
|
||||
\item Starting any of the motors H, K or L results in new values to be set in the HKL internal data
|
||||
structure and a dirty flag to be set.
|
||||
\item On a call to the drivable interfaces status function the dirty flag is checked and, if
|
||||
appropriate, the motor positions are recalculated and the motors started.
|
||||
\item H, K and L values are recalculated from motors on each read.
|
||||
\end{itemize}
|
||||
For each virtual motor an internal data structure is required:
|
||||
@d hklmotdat @{
|
||||
typedef struct __HKLMOT {
|
||||
pObjectDescriptor pDes;
|
||||
pHKL pHkl;
|
||||
pIDrivable pDriv;
|
||||
int index;
|
||||
}HKLMot, *pHKLMot;
|
||||
@}
|
||||
The fields are:\begin{description}
|
||||
\item[pDes] The required object descriptor.
|
||||
\item[pHkl] The HKL object to use for calculations.
|
||||
\item[pDriv] The drivable interface.
|
||||
\item[index] The index of the motors target in the targetHKL array in the HKL structure.
|
||||
\end{description}
|
||||
The target HKL and the dirty flag is in the main HKL data structure.
|
||||
|
||||
There is no external interface to this, all the functionality is hidden in the drivable interface
|
||||
functions. The interpreter interface is minimal: only a value request is supported. There is
|
||||
however a factory function in order to install the HKL motors into the interpreter.
|
||||
|
||||
@o hklmot.h @{
|
||||
/*------------------------------------------------------------------------------------------------------
|
||||
Virtual motor interface to reciprocal space coordinates H, K and L for a four circle diffractometer.
|
||||
Requires a HKL object for calculations.
|
||||
|
||||
copyright: see file COPYRIGHT
|
||||
|
||||
Mark Koennecke, February 2005
|
||||
--------------------------------------------------------------------------------------------------------*/
|
||||
#ifndef SICSHKLMOT
|
||||
#define SICSHKLMOT
|
||||
/*====================== data structure ==============================================================*/
|
||||
@<hklmotdat@>
|
||||
/*======================= interpreter interface ======================================================*/
|
||||
int HKLMotAction(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]);
|
||||
int HKLMotInstall(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@}
|
||||
|
Reference in New Issue
Block a user