| gclib 1.34.15 Communications API for Galil controllers and PLCs |

## ◆ GRead()

GCLIB_DLL_EXPORTED GReturn GCALL GRead | ( | GCon | g,
|  | GBufOut | buffer,
|  | GSize | buffer_len,
|  | GSize * | bytes_read
| ) |  |

Performs a read on the connection.

Parameters

  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.

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

Warning
  This function is deprecated and will be removed in a future gclib version. Please contact Galil for needs not covered by the other gclib functions.

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.