Files
sics/motor.h
koennecke bd50b19178 - Fixed sicsprompt bug. Sicsprompt caused a core dump
- Removed generation of incommenurate reflections for 0,0,0 in fourmess.c
- Implemented a Poch command for heartbeats
- Fixed 64 bit dimension issues in nxdict
- Fixed different calling conventions for NXReportError deep stack in nxdict
- Stopped ei motor driving when not necessary
- Added yet another monitor for POLDI
- Added a protocoll driver for the JVL motor RS-485 binary protocoll
- Fixed some reporting issues


SKIPPED:
	psi/jvlprot.c
	psi/make_gen
	psi/polterwrite.c
	psi/psi.c
	psi/spss7.c
2012-06-05 09:09:20 +00:00

82 lines
2.6 KiB
C

/*--------------------------------------------------------------------------
SICS needs to run motors. This is where this happens.
Mark Koennecke, November 1996
copyright: see implementation file
----------------------------------------------------------------------------*/
#ifndef SICSMOTOR
#define SICSMOTOR
#include "Scommon.h"
#include "obpar.h"
#include "modriv.h"
#include "obdes.h"
#include "interface.h"
#include "hipadaba.h"
#define MOTOBPARLENGTH 12
typedef struct __Motor {
pObjectDescriptor pDescriptor;
pHdb objectNode;
pIDrivable pDrivInt;
pICallBack pCall;
int (*MotorSetPar) (struct __Motor * self, SConnection * pCon,
char *name, float fVal);
int (*MotorGetPar) (struct __Motor * self, char *name, float *fVal);
int (*MotorGetHardPosition) (struct __Motor * self, SConnection * pCon,
float *fVal);
char *drivername;
char *name;
MotorDriver *pDriver;
float fTarget;
float fPosition;
long endScriptID;
int posCount; /* counter for calling the
motor callback */
int retryCount; /* for retries in status */
int posFaultCount;
int stopped;
int stopReported;
int errorCount;
int running;
ObPar *ParArray;
void *pPrivate;
void (*KillPrivate) (void *);
} Motor;
typedef Motor *pMotor;
/*------------------------------------------------------------------------
a tiny structure used in CallBack work
--------------------------------------------------------------------------*/
typedef struct {
float fVal;
char *pName;
} MotCallback;
/*-------------------------------------------------------------------------*/
/* parameter management */
int MotorGetPar(pMotor self, char *name, float *fVal);
int MotorSetPar(pMotor self, SConnection * pCon, char *name, float fVal);
/* driving */
long MotorRun(void *self, SConnection * pCon, float fNew);
int MotorCheckBoundary(pMotor self, float fVal, float *fHard,
char *error, int iErrLen);
/* Where are we ? */
int MotorGetSoftPosition(pMotor self, SConnection * pCon, float *fVal);
int MotorGetHardPosition(pMotor self, SConnection * pCon, float *fVal);
/* creation */
int MotorCreate(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[]);
pMotor MotorInit(char *drivername, char *name, MotorDriver * pDriv);
void MotorKill(void *self);
/* interface to interpreter */
int MotorAction(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[]);
pMotor FindMotor(SicsInterp * pSics, char *name);
#endif