21 int main(
int argc,
char * argv[])
31 if (argc < 2 || argc > 3)
33 cerr <<
"Incorrect number of arguments provided\n";
34 cerr <<
"Usage: position_tracking_example.exe <ADDRESS> <SPEED=5000>\n";
35 return GALIL_EXAMPLE_ERROR;
38 char* address = argv[1];
45 int speed = strtol(argv[2], &end, 10);
50 cerr <<
"An invalid speed was entered. " 51 "Please enter a valid integer for speed.\n" 52 "Usage: position_tracking_example.exe <ADDRESS> <SPEED=5000>\n";
53 return GALIL_EXAMPLE_ERROR;
71 GSize size =
sizeof(buf);
75 return GALIL_EXAMPLE_ERROR;
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
GCLIB_DLL_EXPORTED GReturn GCALL GUtility(GCon g, GOption request, GMemory memory1, GMemory memory2)
Provides read/write access to driver settings and convenience features based on the request variable.
int main(int argc, char *argv[])
Main function for Commands Example.
#define G_UTIL_ERROR_CONTEXT
GUtility(), provides additional error context, where available.
GReturn position_tracking(GCon g, int speed=5000)
Puts controller into Position Tracking Mode and accepts user-entered positions.
GCLIB_DLL_EXPORTED GReturn GCALL GOpen(GCStringIn address, GCon *g)
Open a connection to a Galil Controller.
GCLIB_DLL_EXPORTED void GCALL GError(GReturn rc, GCStringOut error, GSize error_len)
Provides a human-readable description string for return codes.
unsigned int GSize
Size of buffers, etc.
#define G_SMALL_BUFFER
Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.