| gclib 2.4.1 Galil Communications Library

Loading...
Searching...
No Matches
Functions
Communication
C (Legacy) » Controller

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.

## Detailed Description

Send commands.

## Function Documentation

## ◆ GCommand()

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.

Deprecated
  This function is part of the deprecated C (Legacy) API, which will be removed in a future release. Use gclib_command() instead.

Parameters

  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.

Returns
  The success status or error code of the function. See gclib_errors.h for possible values.

## ◆ GCmd()

GCLIB_DEPRECATED GReturn GCmd | ( | GCon | g,
|  | GCStringIn | command )

Wrapper around GCommand for use when the return value is not desired.

Deprecated
  This function is part of the deprecated C (Legacy) API, which will be removed in a future release.

The returned data is still checked for error, e.g. ? or timeout, but is not brought out through the prototype.

Parameters

  g | Connection's handle.
  command | Null-terminated command string to send to the controller.

Returns
  The success status or error code of the function. See gclib_errors.h for possible values.

## ◆ GCmdT()

GCLIB_DEPRECATED GReturn GCmdT | ( | GCon | g,
|  | GCStringIn | command,
|  | GCStringOut | trimmed_response,
|  | GSize | response_len,
|  | GCStringOut * | front )

Wrapper around GCommand that trims the response.

Deprecated
  This function is part of the deprecated C (Legacy) API, which will be removed in a future release.

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.

Parameters

  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.

Returns
  The success status or error code of the function. See gclib_errors.h for possible values.

## ◆ GCmdI()

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.

Deprecated
  This function is part of the deprecated C (Legacy) API, which will be removed in a future release.

Use this function to get most values including TP, RP, TE, Digital I/O states, etc.

Parameters

  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.

Returns
  The success status or error code of the function. See gclib_errors.h for possible values.

## ◆ GCmdD()

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.

Deprecated
  This function is part of the deprecated C (Legacy) API, which will be removed in a future release.

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.

Parameters

  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.

Returns
  The success status or error code of the function. See gclib_errors.h for possible values.