gclib  2.0.8
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
gConnection's handle.
bufferThe user's read buffer.
buffer_lenThe length of the user's read buffer.
bytes_readPointer 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.