00001 #ifndef LSF_MOTOR_H
00002 #define LSF_MOTOR_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "lsfControl.h"
00014 #include "mot.h"
00015
00016 typedef struct
00017 {
00018 lsfSTATE state;
00019 lsfSUBSTATE subState;
00020 vltLOGICAL init;
00021 vltLOGICAL simulation;
00022 vltINT32 timeout;
00023 motSTATUS *motorStatus;
00024 vltLOGICAL twoStepDefined;
00025 } lsfMOTOR_ENTRY;
00026
00027 typedef struct
00028 {
00029 void *ctrlData;
00030 void *userData;
00031 lsfSTATE state;
00032 lsfSUBSTATE subState;
00033 vltLOGICAL init;
00034 vltLOGICAL simulation;
00035 vltINT32 timeout;
00036 vltINT32 numMotors;
00037
00038 vltBYTES20 *motorNames;
00039 char *attrTable[lsfMAX_DEVICES+1];
00040 lsfMOTOR_ENTRY *motorTable[lsfMAX_DEVICES];
00041
00042 motHANDLE motorHandle[lsfMAX_MOTORS+1];
00043 motSTATUS *motorStatus;
00044 } lsfMOTOR_DATA;
00045
00046 #define lsfMotorGetData(ptr) \
00047 (lsfMOTOR_DATA *)lsfControlGetDevData((lsfCONTROL_DATA *)(((lsfCONTROL_DATA *)ptr)->ctrlData),lsfDEVICE_MOTOR)
00048 #define lsfMotorGetUserData(ptr) \
00049 (lsfMotorGetData(ptr))->userData
00050
00051 ccsCOMPL_STAT lsfMotorConstructor ( IN const char *swdName,
00052 IN lsfCONTROL_DATA *controlData,
00053 IN const char *motorNames[],
00054 OUT ccsERROR *error );
00055 void lsfMotorDestructor ( IN lsfCONTROL_DATA *controlData );
00056
00057 ccsCOMPL_STAT lsfMotorInit ( IN lsfMOTOR_DATA *motorData,
00058 IN const char *motorName,
00059 IN vltLOGICAL wait,
00060 OUT ccsERROR *error );
00061 ccsCOMPL_STAT lsfMotorStandby ( IN lsfMOTOR_DATA *motorData,
00062 IN const char *motorName,
00063 OUT ccsERROR *error );
00064 ccsCOMPL_STAT lsfMotorOnline ( IN lsfMOTOR_DATA *motorData,
00065 IN const char *motorName,
00066 OUT ccsERROR *error );
00067 ccsCOMPL_STAT lsfMotorStop ( IN lsfMOTOR_DATA *motorData,
00068 IN const char *motorName,
00069 OUT ccsERROR *error );
00070 ccsCOMPL_STAT lsfMotorOff ( IN lsfMOTOR_DATA *motorData,
00071 IN const char *motorName,
00072 OUT ccsERROR *error );
00073 ccsCOMPL_STAT lsfMotorExit ( IN lsfMOTOR_DATA *motorData,
00074 IN const char *motorName,
00075 OUT ccsERROR *error );
00076 ccsCOMPL_STAT lsfMotorSimulat ( IN lsfMOTOR_DATA *motorData,
00077 IN const char *motorName,
00078 OUT ccsERROR *error );
00079 ccsCOMPL_STAT lsfMotorStopsim ( IN lsfMOTOR_DATA *motorData,
00080 IN const char *motorName,
00081 OUT ccsERROR *error );
00082 ccsCOMPL_STAT lsfMotorSelftest ( IN lsfMOTOR_DATA *motorData,
00083 IN const char *motorName,
00084 OUT ccsERROR *error );
00085 ccsCOMPL_STAT lsfMotorTest ( IN lsfMOTOR_DATA *motorData,
00086 IN const char *motorName,
00087 OUT ccsERROR *error );
00088
00089
00090 ccsCOMPL_STAT lsfMotorWaitInit ( IN lsfMOTOR_DATA *motorData,
00091 IN const char *motorName,
00092 OUT ccsERROR *error );
00093
00094 vltINT32 lsfMotorGetState ( IN lsfMOTOR_DATA *motorData,
00095 IN const char *motorName );
00096 vltINT32 lsfMotorGetSubState ( IN lsfMOTOR_DATA *motorData,
00097 IN const char *motorName );
00098 ccsCOMPL_STAT lsfMotorSetSubState(IN lsfMOTOR_DATA *motorData,
00099 OUT ccsERROR *error );
00100
00101 ccsCOMPL_STAT lsfMotorMoveAbs ( IN lsfMOTOR_DATA *motorData,
00102 IN const char *motorName,
00103 IN vltDOUBLE target[],
00104 IN const char *unit[],
00105 IN vltLOGICAL wait,
00106 OUT ccsERROR *error );
00107 ccsCOMPL_STAT lsfMotorMoveRel ( IN lsfMOTOR_DATA *motorData,
00108 IN const char *motorName,
00109 IN vltDOUBLE target[],
00110 IN const char *unit[],
00111 IN vltLOGICAL wait,
00112 OUT ccsERROR *error );
00113 ccsCOMPL_STAT lsfMotorMoveToName ( IN lsfMOTOR_DATA *motorData,
00114 IN const char *motorName,
00115 IN const char *target[],
00116 IN vltDOUBLE offset[],
00117 IN const char *unit[],
00118 IN vltLOGICAL wait,
00119 OUT ccsERROR *error );
00120 ccsCOMPL_STAT lsfMotorMoveToIndex ( IN lsfMOTOR_DATA *motorData,
00121 IN const char *motorName,
00122 IN vltINT32 target[],
00123 IN vltDOUBLE offset[],
00124 IN const char *unit[],
00125 IN vltLOGICAL wait,
00126 OUT ccsERROR *error );
00127 ccsCOMPL_STAT lsfMotorWaitMove ( IN lsfMOTOR_DATA *motorData,
00128 IN const char *motorName,
00129 OUT char *names[],
00130 OUT vltDOUBLE *position,
00131 OUT char *unit[],
00132 OUT ccsERROR *error );
00133
00134 #endif