11 cout <<
"\n************************************************************************\n";
12 cout <<
"Example GCommand() usage\n";
13 cout <<
"************************************************************************\n";
19 cout <<
"Revision report, ^R^V\n";
28 cout <<
"Command Values\n";
50 cout <<
"\nCommand Trimming\n";
52 cout <<
">" <<
buf <<
"<" <<
'\n';
55 cout <<
">" <<
buf <<
"<" <<
'\n';
62 cout <<
"\nReceiving Binary Data\n";
67 cout <<
"\nError handling\n";
70 cout <<
"QD correctly trapped, not allowed, try GArrayDownload()\n";
73 cout <<
"Unexpected QD behaviour\n";
74 return GALIL_EXAMPLE_ERROR;
78 cout <<
"DL correctly trapped, not allowed, try GProgramDownload()\n";
81 cout <<
"Unexpected DL behaviour\n";
82 return GALIL_EXAMPLE_ERROR;
86 cout <<
"\nModifying timeout\n";
88 cout <<
"Burning program...";
93 return GALIL_EXAMPLE_OK;
GCLIB_DLL_EXPORTED GReturn GCALL GCmdT(GCon g, GCStringIn command, GCStringOut trimmed_response, GSize response_len, GCStringOut *front)
Wrapper around GCommand that trims the response.
#define G_COMMAND_CALLED_WITH_ILLEGAL_COMMAND
GCommand() was called with an illegal command, e.g. ED, DL or QD.
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
GCLIB_DLL_EXPORTED GReturn GCALL GTimeout(GCon g, short timeout_ms)
Uses GUtility() and G_UTIL_TIMEOUT_OVERRIDE to set the library timeout.
#define G_NO_ERROR
Return value if function succeeded.
GCLIB_DLL_EXPORTED GReturn GCALL GCommand(GCon g, GCStringIn command, GBufOut buffer, GSize buffer_len, GSize *bytes_returned)
Performs a command-and-response transaction on the connection.
unsigned int GSize
Size of buffers, etc.
#define G_USE_INITIAL_TIMEOUT
GUtility(), for timeout override. Set G_UTIL_TIMEOUT_OVERRIDE to this value to use initial GOpen() ti...
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
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 GCmdD(GCon g, GCStringIn command, double *value)
Wrapper around GCommand that provides the return value of a command parsed into a double.
GCLIB_DLL_EXPORTED GReturn GCALL GCmd(GCon g, GCStringIn command)
Wrapper around GCommand for use when the return value is not desired.
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
void x_e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
int x_gcommand(GCon g)
Example GCommand() usage.