EPICS Motor Module motor-R6-8-RC1_1-4
motorApp/OmsAsynSrc/omsMAXvEncFunc.h
00001 /*
00002 FILENAME...     omsMAXvEncFunc.h
00003 USAGE...        Pro-Dex OMS MAXv encoder asyn motor support
00004 
00005 Version:        $Revision: 1.2 $
00006 Modified By:    $Author: ernesto $
00007 Last Modified:  $Date: 2012/12/04 17:16:52 $
00008 HeadURL:        $URL$
00009 */
00010 
00011 /*
00012  *  Created on: 10/2010
00013  *      Author: eden
00014  */
00015 
00016 #ifndef OMSMAXVENCFUNC_H_
00017 #define OMSMAXVENCFUNC_H_
00018 
00019 #include "omsMAXv.h"
00020 
00021 
00022 #define ENCFUNCTION_FUNCTMASK     0xFF00  /* 8 function bits  */
00023 #define ENCFUNCTION_ENC_MASK      0x00F0  /* 4 encoder bits (encoder 0 - 15)  */
00024 #define ENCFUNCTION_AXISMASK      0x000F  /* 4 axis bits (axis 0 - 15)  */
00025 
00026 #define ENCFUNCTION_NONE          0x00  /* no encoder functions  */
00027 #define ENCFUNCTION_READ          0x01  /* read (auxiliary) encoder  */
00028 #define ENCFUNCTION_REPLACE       0x02  /* replace encoder of axis axismask with encoder encodermask */
00029 #define ENCFUNCTION_AVERAGE       0x03  /* read (auxiliary) encoder  */
00030 
00031 #define ENCFUNCTION_AUXENC_0     0x0E  /* aux encoder 0 is defined as encoder 14)  */
00032 #define ENCFUNCTION_AUXENC_1     0x0F  /* aux encoder 1 is defined as encoder 15)  */
00033 
00034 #define MAXENCFUNC 8
00035 
00036 class omsMAXvEncFunc : public omsMAXv {
00037 public:
00038     omsMAXvEncFunc(const char*, int, int, const char*, int, int, unsigned int, int, int, const char* );
00039     omsMAXvEncFunc(const char*, int, int, const char*, int, int );
00040     virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
00041     virtual asynStatus getEncoderPositions(epicsInt32 encPosArr[OMS_MAX_AXES]);
00042 
00043 private:
00044     void initialize();
00045     int averageChannel[MAXENCFUNC];
00046     int encFuncIndex[MAXENCFUNC];
00047     int encRawPosIndex[MAXENCFUNC];
00048     int encPosIndex[2];
00049 };
00050 
00051 #endif /* OMSMAXVENCFUNC_H_ */
 All Classes Functions Variables