16#define _CRT_SECURE_NO_WARNINGS
24#define GALIL_EXAMPLE_OK 0
25#define GALIL_EXAMPLE_ERROR -100
44 std::cout <<
buf <<
'\n';
51 std::cout <<
buf <<
'\n';
56 std::cout <<
buf <<
'\n';
65 std::cout <<
"Enter any key to exit..." << std::endl;
66 return std::getchar();
#define G_BAD_RESPONSE_QUESTION_MARK
Operation received a ?, indicating controller has a TC error.
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 GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
#define G_SMALL_BUFFER
Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.
#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.
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
GCLIB_DLL_EXPORTED void GCALL GError(GReturn rc, GCStringOut error, GSize error_len)
Provides a human-readable description string for return codes.
#define G_UTIL_ERROR_CONTEXT
GUtility(), provides additional error context, where available.
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
GReturn contour(GCon g, char *fileA, char *fileB)
Record user's training and plays back training through contour mode.
GReturn motion_complete(GCon g)
Uses interrupts to track when the motion of controller is completed.
void error(GCon g, GReturn rc)
An example of error handling and debugging information.
GReturn commands(GCon g)
Demonstrates various uses of GCommand() and GUtility().
GReturn position_tracking(GCon g, int speed=5000)
Puts controller into Position Tracking Mode and accepts user-entered positions.
GReturn message(GCon g)
Demonstrates how to receive messages from the controller and detect differences in Trace and crashed ...
int pause()
Pauses console apps for a user key stroke.
GReturn remote_client()
Lists available remote servers and allows connection to remote server.
GReturn remote_server(const char *server_name)
Publishes local gcaps server to the network.
GReturn ip_assigner(char *serial_num, int address)
Assigns controller an IP Adress given a serial number and a 1 byte address.
GReturn jog(GCon g)
Puts controller into Jog Mode and accepts user input to adjust the speed.
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
GReturn record_position(GCon g, char *fileA, char *fileB)
Record user's training and saves to a text file.