12 cout <<
"\n************************************************************************\n";
13 cout <<
"Example GRecord() usage\n";
14 cout <<
"************************************************************************\n";
21 cout <<
"\nQR-based data record\n";
24 cout <<
r.dmc4000.sample_number <<
'\n';
25 cout <<
r.dmc4000.axis_a_reference_position <<
"\n";
41 cout <<
"\nDR-based data record\n";
42 unsigned short time = 0;
50 time =
r.dmc4000.sample_number;
62 cout <<
"\nQR-based data record with offsets\n";
64 cout <<
r.dmc4000.sample_number <<
'\n';
65 cout << *((
unsigned short*)(
r.byte_array + 4)) <<
'\n';
80 cout <<
"Beginning independent motion... ";
83 cout <<
"Motion Complete on A\n";
88 return GALIL_EXAMPLE_OK;
105 for (
int i = 0;
i < len; )
148 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_DR
Value for GRecord() method variable for acquiring a data record via DR mode.
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
GCLIB_DLL_EXPORTED GReturn GCALL GRecord(GCon g, union GDataRecord *record, GOption method)
Provides a fresh copy of the controller's data record. Data is cast into a union, GDataRecord.
#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().
#define G_QR
Value for GRecord() method variable for acquiring a data record via QR mode.
GCLIB_DLL_EXPORTED GReturn GCALL GRecordRate(GCon g, double period_ms)
Sets the asynchronous data record to a user-specified period via DR.
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.
const char * GCStringIn
C-string input to the library. Implies null-termination.
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.
Data record union, containing all structs and a generic byte array accessor.
void x_e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
int x_grecord(GCon g)
Example GRecord() usage.
int x_dr_motioncomplete(GCon g, GCStringIn axes)
Example of MotionComplete with data records.