gclib.h File Reference

#include "gclib_record.h"
#include "gclib_errors.h"

Go to the source code of this file.

Defines

#define GCLIB_DLL_EXPORTED
#define GCALL   __stdcall
 Specify calling convention for Windows.
#define G_DR   1
 Value for GRecord() `method` variable for acquiring a data record via DR mode.
#define G_QR   0
 Value for GRecord() `method` variable for acquiring a data record via QR mode.
#define G_BOUNDS   -1
 For functions that take range options, e.g. GArrayUpload(), use this value for full range.
#define G_CR   0
 For GArrayUpload(), use this value in the delim field to delimit with carriage returns.
#define G_COMMA   1
 For GArrayUpload(), use this value in the delim field to delimit with commas.
#define G_UTIL_TIMEOUT   1
 GUtility(), Access to timeout.
#define G_UTIL_TIMEOUT_OVERRIDE   2
 GUtility(), read/write access to timeout override.
#define G_USE_INITIAL_TIMEOUT   -1
 GUtility(), for timeout override. Set `G_UTIL_TIMEOUT_OVERRIDE` to this value to use initial GOpen() timeout (`--timeout`).
#define G_UTIL_VERSION   128
 GUtility(), get a library version string.
#define G_UTIL_INFO   129
 GUtility(), get a connection info string.
#define G_UTIL_SLEEP   130
 GUtility(), specify an interval to sleep.
#define G_UTIL_ADDRESSES   131
 GUtility(), get a list of available connections.
#define G_UTIL_IPREQUEST   132
 GUtility(), get a list of hardware requesting IPs.
#define G_UTIL_ASSIGN   133
 GUtility(), assign.
#define G_HUGE_BUFFER   524288
 Most reads/writes to Galil hardware are small. This value will hold the largest array or program upload/download possible.

Typedefs

typedef int GReturn
 Every function returns a value of type GReturn. See gclib_errors.h for possible values.
typedef void * GCon
 Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
typedef unsigned int GSize
 Size of buffers, etc.
typedef int GOption
 Option integer for various formatting, etc.
typedef char * GCStringOut
 C-string output from the library. Implies null-termination.
typedef const char * GCStringIn
 C-string input to the library. Implies null-termination.
typedef char * GBufOut
 Data output from the library. No null-termination implied. Returned values may be null-terminated, see function documentation for details.
typedef const char * GBufIn
 Data input to the library. No null-termination, function will have a GSize to indicate bytes to write .
typedef unsigned char GStatus
 Interrupt status byte.
typedef void * GMemory
 Pointer to untyped memory for use in GUtility().

Functions

GCLIB_DLL_EXPORTED GReturn GCALL GOpen (GCStringIn address, GCon *g)
 Open a connection to a Galil Controller.
GCLIB_DLL_EXPORTED GReturn GCALL GClose (GCon g)
 Closes a connection to a Galil Controller.
GCLIB_DLL_EXPORTED GReturn GCALL GRead (GCon g, GBufOut buffer, GSize buffer_len, GSize *bytes_read)
 Performs a read on the connection.
GCLIB_DLL_EXPORTED 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 GProgramDownload (GCon g, GCStringIn program, GCStringIn preprocessor)
 Downloads a program to the controller's program buffer.
GCLIB_DLL_EXPORTED GReturn GCALL GProgramUpload (GCon g, GBufOut buffer, GSize buffer_len)
 Uploads a program from the controller's program buffer.
GCLIB_DLL_EXPORTED GReturn GCALL GArrayDownload (GCon g, const GCStringIn array_name, GOption first, GOption last, GCStringIn buffer)
 Downloads array data to a pre-dimensioned array in the controller's array table.
GCLIB_DLL_EXPORTED GReturn GCALL GArrayUpload (GCon g, const GCStringIn array_name, GOption first, GOption last, GOption delim, GBufOut buffer, GSize buffer_len)
 Uploads array data from the controller's array table.
GCLIB_DLL_EXPORTED GReturn GCALL GRecord (GCon g, union GDataRecord *record, GOption method)
 Provides a fresh copy of the controller's data record. Data is cast into a union, GDataRecord.
GCLIB_DLL_EXPORTED GReturn GCALL GMessage (GCon g, GCStringOut buffer, GSize buffer_len)
 Provides access to unsolicited messages from the controller.
GCLIB_DLL_EXPORTED GReturn GCALL GInterrupt (GCon g, GStatus *status_byte)
 Provides access to PCI and UDP interrupts from the controller.
GCLIB_DLL_EXPORTED GReturn GCALL GFirmwareDownload (GCon g, GCStringIn filepath)
 Upgrade firmware.
GCLIB_DLL_EXPORTED GReturn GCALL GUtility (GCon g, GOption request, GMemory memory1, GMemory memory2)
 Provides read/write access to driver settings and convenience features based on the request variable.

Detailed Description

Defines the interface for the Galil C Library (GCLIB).

Definition in file gclib.h.