11char chars[] = {
'|',
'\\',
'-',
'/'};
15 cout << chars[cur] <<
'\r';
29 cout <<
"\n************************************************************************\n";
30 cout <<
"Example GMessage non-blocking usage\n";
31 cout <<
"************************************************************************\n";
50 cout <<
"\n************************************************************************\n";
51 cout <<
"Example GInterrupt non-blocking usage\n";
52 cout <<
"************************************************************************\n";
69 cout <<
"\n************************************************************************\n";
70 cout <<
"Example GRecord non-blocking usage\n";
71 cout <<
"************************************************************************\n";
88 cout <<
" " <<
dr.dmc4000.sample_number <<
'\n';
90 return GALIL_EXAMPLE_OK;
#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.
GCLIB_DLL_EXPORTED GReturn GCALL GTimeout(GCon g, short timeout_ms)
Uses GUtility() and G_UTIL_TIMEOUT_OVERRIDE to set the library timeout.
unsigned char GStatus
Interrupt status byte.
GCLIB_DLL_EXPORTED GReturn GCALL GInterrupt(GCon g, GStatus *status_byte)
Provides access to PCI and UDP interrupts from the controller.
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
GCLIB_DLL_EXPORTED GReturn GCALL GMessage(GCon g, GCStringOut buffer, GSize buffer_len)
Provides access to unsolicited messages from the controller.
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 GProgramDownload(GCon g, GCStringIn program, GCStringIn preprocessor)
Downloads a program to the controller's program buffer.
#define G_GCLIB_NON_BLOCKING_READ_EMPTY
GMessage, GInterrupt, and GRecord can be called with a zero timeout. If there wasn't data waiting in ...
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_nonblocking(GCon g)
Examples of using non-blocking operation of GRecord(), GInterrupt(), and GMessage().