18 printf(
"ERROR: %d", rc);
30 printf(
"version: %s\n", buf);
32 check(
GOpen(
"192.168.0.43", &g));
34 check(
GInfo(g, buf,
sizeof(buf)));
35 printf(
"info: %s\n", buf);
37 check(
GCommand(g,
"MG TIME", buf,
sizeof(buf), 0));
38 printf(
"response: %s\n", buf);
GCLIB_DLL_EXPORTED GReturn GCALL GClose(GCon g)
Closes a connection to a Galil Controller.
GCLIB_DLL_EXPORTED GReturn GCALL GVersion(GCStringOut ver, GSize ver_len)
Uses GUtility(), G_UTIL_VERSION and G_UTIL_GCAPS_VERSION to provide the library and gcaps version num...
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.
GCLIB_DLL_EXPORTED GReturn GCALL GInfo(GCon g, GCStringOut info, GSize info_len)
Uses GUtility() and G_UTIL_INFO to provide a useful connection string.
GCLIB_DLL_EXPORTED GReturn GCALL GOpen(GCStringIn address, GCon *g)
Open a connection to a Galil Controller.
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
#define G_NO_ERROR
Return value if function succeeded.
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
int main(int argc, char *argv[])
Main function for Commands Example.