implement tclmot
r3799 | jgn | 2012-11-13 16:39:44 +1100 (Tue, 13 Nov 2012) | 1 line
This commit is contained in:
committed by
Douglas Clowes
parent
f29ba6c6c3
commit
668ffbfc18
61
ansto_tclmotdriv.h
Normal file
61
ansto_tclmotdriv.h
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*---------------------------------------------------------------------------
|
||||||
|
This is a motor driver which is implemented in Tcl. This means
|
||||||
|
this code is only a wrapper which calls Tcl functions to do the
|
||||||
|
actual work.
|
||||||
|
|
||||||
|
copyright: see file COPYRIGHT
|
||||||
|
|
||||||
|
Mark Koennecke, December 2005
|
||||||
|
--------------------------------------------------------------------------*/
|
||||||
|
#ifndef ANSTO_TCLMOTDRIV
|
||||||
|
#define ANSTO_TCLMOTDRIV
|
||||||
|
#include "stringdict.h"
|
||||||
|
|
||||||
|
typedef struct ___TclDriv {
|
||||||
|
/* general motor driver interface
|
||||||
|
fields. REQUIRED!
|
||||||
|
*/
|
||||||
|
float fUpper; /* upper limit */
|
||||||
|
float fLower; /* lower limit */
|
||||||
|
char *name;
|
||||||
|
int (*GetPosition)(void *self,float *fPos);
|
||||||
|
int (*RunTo)(void *self, float fNewVal);
|
||||||
|
int (*GetStatus)(void *self);
|
||||||
|
void (*GetError)(void *self, int *iCode, char *buffer, int iBufLen);
|
||||||
|
int (*TryAndFixIt)(void *self,int iError, float fNew);
|
||||||
|
int (*Halt)(void *self);
|
||||||
|
int (*GetDriverPar)(void *self, char *name,
|
||||||
|
float *value);
|
||||||
|
int (*SetDriverPar)(void *self,SConnection *pCon,
|
||||||
|
char *name, float newValue);
|
||||||
|
void (*ListDriverPar)(void *self, char *motorName,
|
||||||
|
SConnection *pCon);
|
||||||
|
void (*KillPrivate)(void *self);
|
||||||
|
|
||||||
|
/* Tcl specific fields */
|
||||||
|
pStringDict mappings;
|
||||||
|
int errorCode;
|
||||||
|
char tclError[1024];
|
||||||
|
char motName[132];
|
||||||
|
float speed; /**< physical units per second */
|
||||||
|
float accel; /**< physical units per second^2 */
|
||||||
|
float decel; /**< physical units per second^2 */
|
||||||
|
char long_name[256]; /**< long name of motor */
|
||||||
|
char units[256]; /**< physical units for axis */
|
||||||
|
|
||||||
|
} TCLDriv;
|
||||||
|
|
||||||
|
MotorDriver *CreateTclMotDriv(SConnection *pCon, int argc, char *argv[]);
|
||||||
|
|
||||||
|
|
||||||
|
const char *ParaText[] = {"accel",
|
||||||
|
"maxAccel",
|
||||||
|
"decel",
|
||||||
|
"maxDecel",
|
||||||
|
"setpoint",
|
||||||
|
"speed",
|
||||||
|
"nmaxSpeed",
|
||||||
|
NULL};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user