40 cerr <<
"There was an error with the connection." << endl;
49 e(
GCmd(g,
"VS 20000"));
50 e(
GCmd(g,
"VA 200000"));
51 e(
GCmd(g,
"VD 200000"));
58 cout <<
"Unable to open file\n";
64 e(
GCmdI(g,
"MG _LMS", &capacity));
74 e(
GCmdI(g,
"MG _LMS", &capacity));
82 return GALIL_EXAMPLE_OK;
92 for (capacity; capacity > 1; capacity--)
94 if (getline(fs, s_cmd))
97 e(
GCmd(g, s_cmd.c_str()));
GCLIB_DLL_EXPORTED GReturn GCALL GMotionComplete(GCon g, GCStringIn axes)
Blocking call that returns once all axes specified have completed their motion.
GCLIB_DLL_EXPORTED void GCALL GSleep(unsigned int timeout_ms)
Uses GUtility() and G_UTIL_SLEEP to provide a blocking sleep call which can be useful for timing-base...
GCLIB_DLL_EXPORTED GReturn GCALL GCmdI(GCon g, GCStringIn command, int *value)
Wrapper around GCommand that provides the return value of a command parsed into an int.
GCLIB_DLL_EXPORTED GReturn GCALL GCmd(GCon g, GCStringIn command)
Wrapper around GCommand for use when the return value is not desired.
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
#define G_CONNECTION_NOT_ESTABLISHED
Function was called with no connection.
#define G_BAD_FILE
Bad file path, bad file contents, or bad write.
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
bool load_buffer(GCon g, ifstream &fs, int capacity)
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.