![]() |
gclib 2.1.20
Galil Communications Library
|
Send commands More...
Functions | |
GCLIB_DLL_EXPORTED GCLIB_DEPRECATED GReturn GCALL | GRead (GCon g, GBufOut buffer, GSize buffer_len, GSize *bytes_read) |
Performs a read on the connection. | |
GCLIB_DLL_EXPORTED GCLIB_DEPRECATED GReturn GCALL | GWrite (GCon g, GBufIn buffer, GSize buffer_len) |
Performs a write on the connection. | |
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 | GCmd (GCon g, GCStringIn command) |
Wrapper around GCommand for use when the return value is not desired. | |
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. | |
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. | |
GCLIB_DLL_EXPORTED GReturn GCALL | GCmdD (GCon g, GCStringIn command, double *value) |
Wrapper around GCommand that provides the return value of a command parsed into a double. | |
GCLIB_DLL_EXPORTED GCLIB_DEPRECATED GReturn GCALL GRead | ( | GCon | g, |
GBufOut | buffer, | ||
GSize | buffer_len, | ||
GSize * | bytes_read ) |
Performs a read on the connection.
g | Connection's handle. |
buffer | The user's read buffer. |
buffer_len | The length of the user's read buffer. |
bytes_read | Pointer to a GSize which will be filled with the number of bytes read upon return. |
Unsolicited messages may be returned in the read data. The high bit of each message byte will be set unless the user changes the CW setting. Interrupts and Data Records are always filtered from a read.
See x_gread_gwrite.cpp for an example.
GCLIB_DLL_EXPORTED GCLIB_DEPRECATED GReturn GCALL GWrite | ( | GCon | g, |
GBufIn | buffer, | ||
GSize | buffer_len ) |
Performs a write on the connection.
g | Connection's handle. |
buffer | The user's write buffer. To send a Galil command, a terminating carriage return is usually required. |
buffer_len | The length of the data in the buffer. |
See x_gread_gwrite.cpp for an example.
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.
g | Connection's handle. |
command | Null-terminated command string to send to the controller. The library will append a carriage return to the command string. |
buffer | Buffer for the response. Will be filled with the response from the controller. The data will be null terminated unless the function returns G_BAD_LOST_DATA due to the buffer being too small to hold the data. |
buffer_len | The size of the response buffer. |
bytes_returned | The size of the data returned from the controller. This does not include null termination. This argument may be null if the value is not desired. |
See x_gcommand.cpp for an example.
GCLIB_DLL_EXPORTED GReturn GCALL GCmd | ( | GCon | g, |
GCStringIn | command ) |
Wrapper around GCommand for use when the return value is not desired.
The returned data is still checked for error, e.g. ?
or timeout, but is not brought out through the prototype.
g | Connection's handle. |
command | Null-terminated command string to send to the controller. |
See x_gcommand.cpp for an example.
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.
For use when the return value is desired, is ASCII (not binary), and the response should be trimmed of trailing colon, whitespace, and optionally leading space.
g | Connection's handle. |
command | Null-terminated command string to send to the controller. |
trimmed_response | The trimmed response from the controller. Trailing space is trimmed by null terminating any trailing spaces, carriage returns, or line feeds. |
response_len | The length of the trimmed_response buffer. |
front | If non-null, upon return *front will point to the first non-space character in trimmed_response. This allows trimming the front of the string without modifying the user's buffer pointer, which may be allocated on the heap. |
See x_gcommand.cpp for an example.
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.
Use this function to get most values including TP, RP, TE, Digital I/O states, etc.
g | Connection's handle. |
command | Null-terminated command string to send to the controller. |
value | Pointer to an int that will be filled with the return value. |
See x_gcommand.cpp for an example.
GCLIB_DLL_EXPORTED GReturn GCALL GCmdD | ( | GCon | g, |
GCStringIn | command, | ||
double * | value ) |
Wrapper around GCommand that provides the return value of a command parsed into a double.
Use this function to retrieve the full Galil 4.2 range, e.g. for a variable value with fractional data, or the value of an Analog input or Output.
g | Connection's handle. |
command | Null-terminated command string to send to the controller. |
value | Pointer to a double that will be filled with the return value. |
See x_gcommand.cpp for an example.