Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

extstgmot.c

Go to the documentation of this file.
00001 /*
00002   extstgmot.c
00003 
00004   Dispatcher of external motion functions for Servo To Go board.
00005 
00006   Modification history:
00007 
00008   20-Mar-2000 WPS added unused attribute to ident to avoid 'defined but not used' compiler warning.
00009   24-Jun-1999  FMP created from extshvmot.c and extmmmot.c, which were
00010   so similar that I decided to combine them and make them obsolete. Also
00011   added NO_LIMIT_SWITCH.
00012   */
00013 
00014 #include "extintf.h"            /* these decls */
00015 #include "stg.h"                /* decls for stg implementation */
00016 
00017 /* ident tag */
00018 #ifndef __GNUC__
00019 #ifndef __attribute__
00020 #define __attribute__(x)
00021 #endif
00022 #endif
00023 
00024 static char __attribute__((unused))  ident[] = "$Id: extstgmot.c,v 1.3 2001/08/02 21:02:40 proctor Exp $";
00025 
00026 /* Uncomment any of the following declarations to inhibit
00027    the use of home switches or index pulses when homing, or to
00028    ignore limit switches if you don't have them. */
00029 
00030 /* Uncomment NO_HOME_SWITCH if you want homing sequence to
00031    ignore the home switch, and only use the index pulse for homing.
00032    This has the effect of making the home switches always appear tripped. */
00033 /* #define NO_HOME_SWITCH */
00034 
00035 /* Uncomment NO_INDEX_PULSE if you want homing sequence to
00036    ignore the index pulse, and only use the home switch for homing.
00037    This has the effect of making the index pulse always appear present. */
00038 /* #define NO_INDEX_PULSE */
00039 
00040 /* Uncomment NO_LIMIT_SWITCH if you don't have limit switches.
00041    This has the effect of making the positive and negative travel
00042    limit switches never appear tripped. */
00043 /* #define NO_LIMIT_SWITCH */
00044 
00045 int extMotInit(const char * stuff)
00046 {
00047   return stgMotInit(stuff);
00048 }
00049 
00050 int extMotQuit(void)
00051 {
00052   return stgMotQuit();
00053 }
00054 
00055 int extDacNum(void)
00056 {
00057   return stgDacNum();
00058 }
00059 
00060 int extDacWrite(int dac, double volts)
00061 {
00062   return stgDacWrite(dac, volts);
00063 }
00064 
00065 int extDacWriteAll(int max, double * volts)
00066 {
00067   return stgDacWriteAll(max, volts);
00068 }
00069 
00070 int extEncoderSetIndexModel(unsigned int model)
00071 {
00072   return stgEncoderSetIndexModel(model);
00073 }
00074 
00075 int extEncoderNum(void)
00076 {
00077   return stgEncoderNum();
00078 }
00079 
00080 int extEncoderRead(int encoder, double * counts)
00081 {
00082   return stgEncoderRead(encoder, counts);
00083 }
00084 
00085 int extEncoderReadAll(int max, double * counts)
00086 {
00087   return stgEncoderReadAll(max, counts);
00088 }
00089 
00090 int extEncoderResetIndex(int encoder)
00091 {
00092   return stgEncoderResetIndex(encoder);
00093 }
00094 
00095 int extEncoderReadLatch(int encoder, int * flag)
00096 {
00097 #ifdef NO_INDEX_PULSE
00098   *flag = 1;
00099   return 0;
00100 #else
00101   return stgEncoderReadLatch(encoder, flag);
00102 #endif
00103 }
00104 
00105 int extEncoderReadLevel(int encoder, int * flag)
00106 {
00107   return stgEncoderReadLevel(encoder, flag);
00108 }
00109 
00110 int extMaxLimitSwitchRead(int axis, int * flag)
00111 {
00112 #ifdef NO_LIMIT_SWITCH
00113   *flag = 0;
00114   return 0;
00115 #else
00116   return stgMaxLimitSwitchRead(axis, flag);
00117 #endif
00118 }
00119 
00120 int extMinLimitSwitchRead(int axis, int * flag)
00121 {
00122 #ifdef NO_LIMIT_SWITCH
00123   *flag = 0;
00124   return 0;
00125 #else
00126   return stgMinLimitSwitchRead(axis, flag);
00127 #endif
00128 }
00129 
00130 int extHomeSwitchRead(int axis, int * flag)
00131 {
00132 #ifdef NO_HOME_SWITCH
00133   *flag = 1;
00134   return 0;
00135 #else
00136   return stgHomeSwitchRead(axis, flag);
00137 #endif
00138 }
00139 
00140 int extAmpEnable(int axis, int enable)
00141 {
00142   return stgAmpEnable(axis, enable);
00143 }
00144 
00145 int extAmpFault(int axis, int * fault)
00146 {
00147   return stgAmpFault(axis, fault);
00148 }
00149 
00150 int extDioInit(const char * stuff)
00151 {
00152   return stgDioInit(stuff);
00153 }
00154 
00155 int extDioQuit(void)
00156 {
00157   return stgDioQuit();
00158 }
00159 
00160 int extDioMaxInputs(void)
00161 {
00162   return stgDioMaxInputs();
00163 }
00164 
00165 int extDioMaxOutputs(void)
00166 {
00167   return stgDioMaxOutputs();
00168 }
00169 
00170 int extDioRead(int index, int *value)
00171 {
00172   return stgDioRead(index, value);
00173 }
00174 
00175 int extDioWrite(int index, int value)
00176 {
00177   return stgDioWrite(index, value);
00178 }
00179 
00180 int extDioCheck(int index, int *value)
00181 {
00182   return stgDioCheck(index, value);
00183 }
00184 
00185 int extDioByteRead(int index, unsigned char *byte)
00186 {
00187   return stgDioByteRead(index, byte);
00188 }
00189 
00190 int extDioShortRead(int index, unsigned short *sh)
00191 {
00192   return stgDioShortRead(index, sh);
00193 }
00194 
00195 int extDioWordRead(int index, unsigned int *word)
00196 {
00197   return stgDioWordRead(index, word);
00198 }
00199 
00200 int extDioByteWrite(int index, unsigned char byte)
00201 {
00202   return stgDioByteWrite(index, byte);
00203 }
00204 
00205 int extDioShortWrite(int index, unsigned short sh)
00206 {
00207   return stgDioShortWrite(index, sh);
00208 }
00209 
00210 int extDioWordWrite(int index, unsigned int word)
00211 {
00212   return stgDioWordWrite(index, word);
00213 }
00214 
00215 int extDioByteCheck(int index, unsigned char *byte)
00216 {
00217   return stgDioByteCheck(index, byte);
00218 }
00219 
00220 int extDioShortCheck(int index, unsigned short *sh)
00221 {
00222   return stgDioShortCheck(index, sh);
00223 }
00224 
00225 int extDioWordCheck(int index, unsigned int *word)
00226 {
00227   return stgDioWordCheck(index, word);
00228 }
00229 
00230 int extAioInit(const char * stuff)
00231 {
00232   return stgAioInit(stuff);
00233 }
00234 
00235 int extAioQuit(void)
00236 {
00237   return stgAioQuit();
00238 }
00239 
00240 int extAioMaxInputs(void)
00241 {
00242   return stgAioMaxInputs();
00243 }
00244 
00245 int extAioMaxOutputs(void)
00246 {
00247   return stgAioMaxOutputs();
00248 }
00249 
00250 int extAioStart(int index)
00251 {
00252   return stgAioStart(index);
00253 }
00254 
00255 void extAioWait(void)
00256 {
00257   stgAioWait();
00258 }
00259 
00260 int extAioRead(int index, double *volts)
00261 {
00262   return stgAioRead(index, volts);
00263 }
00264 
00265 int extAioWrite(int index, double volts)
00266 {
00267   return stgAioWrite(index, volts);
00268 }
00269 
00270 int extAioCheck(int index, double *volts)
00271 {
00272   return stgAioCheck(index, volts);
00273 }

Generated on Sun Dec 2 15:27:40 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001