22 cout <<
"\n*************************************************************\n";
23 cout <<
"Example GInterrupt() usage\n";
24 cout <<
"***************************************************************\n";
41 cout <<
"No support on this bus\n";
61 e(
GCmd(g,
"SP 4000,4000"));
62 e(
GCmd(g,
"AC 1280000,1280000"));
63 e(
GCmd(g,
"DC 1280000,1280000"));
64 e(
GCmd(g,
"PR 8000,10000"));
66 cout <<
"Beginning independent motion...\n";
69 cout <<
"Motion Complete on A and B\n";
73 return GALIL_EXAMPLE_OK;
88 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.
#define G_SMALL_BUFFER
Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.
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().
#define G_UNSUPPORTED_FUNCTION
Function cannot be called on this bus. E.G. GInterrupt() on serial.
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.
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
GReturn motion_complete(GCon g)
Uses interrupts to track when the motion of controller is completed.
int check_interrupts(GCon g, GCStringIn axes)
Monitors interrupt status on the given axes and returns when interrupts are fired.
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.