11 char 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";
66 cout <<
" " << hex << uppercase << (int)
byte << dec <<
'\n';
69 cout <<
"\n************************************************************************\n";
70 cout <<
"Example GRecord non-blocking usage\n";
71 cout <<
"************************************************************************\n";
90 return GALIL_EXAMPLE_OK;
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.
GCLIB_DLL_EXPORTED GReturn GCALL GInterrupt(GCon g, GStatus *status_byte)
Provides access to PCI and UDP interrupts from the controller.
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.
GCLIB_DLL_EXPORTED GReturn GCALL GCmd(GCon g, GCStringIn command)
Wrapper around GCommand for use when the return value is not desired.
#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.
unsigned char GStatus
Interrupt status byte.
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
#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 ...
UW sample_number
sample number.
Data record union, containing all structs and a generic byte array accessor.
struct GDataRecord4000 dmc4000
The DMC-4000 data record.
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().