![]() |
gclib 2.4.0
Galil Communications Library
|
Send commands. More...
Functions | |
| GCLIB_DEPRECATED GReturn | GCommand (GCon g, GCStringIn command, GBufOut buffer, GSize buffer_len, GSize *bytes_returned) |
| Performs a command-and-response transaction on the connection. | |
| GCLIB_DEPRECATED GReturn | GCmd (GCon g, GCStringIn command) |
| Wrapper around GCommand for use when the return value is not desired. | |
| GCLIB_DEPRECATED GReturn | GCmdT (GCon g, GCStringIn command, GCStringOut trimmed_response, GSize response_len, GCStringOut *front) |
| Wrapper around GCommand that trims the response. | |
| GCLIB_DEPRECATED GReturn | GCmdI (GCon g, GCStringIn command, int *value) |
| Wrapper around GCommand that provides the return value of a command parsed into an int. | |
| GCLIB_DEPRECATED GReturn | GCmdD (GCon g, GCStringIn command, double *value) |
| Wrapper around GCommand that provides the return value of a command parsed into a double. | |
Send commands.
| GCLIB_DEPRECATED GReturn 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. |
| GCLIB_DEPRECATED GReturn 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. |
| GCLIB_DEPRECATED GReturn 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. |
| GCLIB_DEPRECATED GReturn 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. |
| GCLIB_DEPRECATED GReturn 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. |