11 cout <<
"\n************************************************************************\n";
12 cout <<
"Example GInterrupt() usage\n";
13 cout <<
"************************************************************************\n";
28 cout <<
"No support on this bus\n";
52 if ((
status & 0xF0) == 0xF0)
59 return GALIL_EXAMPLE_ERROR;
70 x_e(
GCmd(g,
"AC 1280000,1280000"));
71 x_e(
GCmd(g,
"DC 1280000,1280000"));
74 cout <<
"Beginning independent motion... ";
77 cout <<
"Motion Complete on A and B\n";
82 return GALIL_EXAMPLE_OK;
93 for (
int i = 0;
i < len;
i++)
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.
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
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.
#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.
GCLIB_DLL_EXPORTED GReturn GCALL GInterrupt(GCon g, GStatus *status_byte)
Provides access to PCI and UDP interrupts from the controller.
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 GReturn GCALL GProgramDownload(GCon g, GCStringIn program, GCStringIn preprocessor)
Downloads a program to the controller's program buffer.
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.
void x_e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
int x_ginterrupt(GCon g)
Example GInterrupt() usage.
int x_ei_motioncomplete(GCon g, GCStringIn axes)
Example of MotionComplete with interrupts.