gclib  2.0.8
Communications API for Galil controllers and PLCs
gclib.h File Reference
#include "gclib_record.h"
#include "gclib_errors.h"

Go to the source code of this file.

Macros

#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_PUBLISH_SERVER   1
 For GPublishServer(), use this value to publish server to local network.
 
#define G_REMOVE_SERVER   0
 For GPublishServer(), use this value to remove server from local network.
 
#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 IP addresses over the network.
 
#define G_UTIL_DEVICE_INITIALIZE   134
 GUtility(), sends CF, CW, EO etc. to initialize the connection. Useful after RS or other reset.
 
#define G_UTIL_PING   135
 GUtility(), uses ICMP ping to determine if an IP address is reachable and assigned.
 
#define G_UTIL_ERROR_CONTEXT   136
 GUtility(), provides additional error context, where available.
 
#define G_UTIL_GCAPS_HOST   256
 
#define G_UTIL_GCAPS_VERSION   257
 GUtility(), get the version of the gcaps server.
 
#define G_UTIL_GCAPS_KEEPALIVE   258
 GUtility(), Deprecated 20210119. No longer functional.
 
#define G_UTIL_GCAPS_ADDRESSES   259
 GUtility(), get a list of available connections from the gcaps server.
 
#define G_UTIL_GCAPS_IPREQUEST   260
 GUtility(), get a list of hardware requesting IPs from the gcaps server.
 
#define G_UTIL_GCAPS_ASSIGN   261
 GUtility(), assign IP addresses over the network from the gcaps server.
 
#define G_UTIL_GCAPS_PING   262
 GUtility(), uses ICMP ping to determine if an IP address is reachable and assigned. Ping sent from the gcaps server.
 
#define G_UTIL_GCAPS_LIST_SERVERS   263
 GUtility(), get a list of all available gcaps servers on the local network.
 
#define G_UTIL_GCAPS_PUBLISH_SERVER   264
 GUtility(), make local gcaps server discoverable by other gcaps servers on the local network.
 
#define G_UTIL_GCAPS_SET_SERVER   265
 GUtility(), set the new active gcaps server.
 
#define G_UTIL_GCAPS_SERVER_STATUS   266
 GUtility(), get information on the local server's name and if it is published to the local network.
 
#define G_UTIL_GCAPS_REMOTE_CONNECTIONS   267
 GUtility(), get a list of remote addresses connected to local server.
 
#define G_UTIL_GCAPS_SERVER_INFO   268
 
#define G_UTIL_GCAPS_ADDRESSES_GET_REMEMBERED   269
 GUtility(), returns true if gcaps is remembering ip assignments.
 
#define G_UTIL_GCAPS_ADDRESSES_SET_REMEMBERED   270
 GUtility(), sets if gcaps should remember ip assignments.
 
#define G_SMALL_BUFFER   1024
 Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.
 
#define G_HUGE_BUFFER   524288
 Most reads from Galil hardware are small. This value will hold the largest array or program upload/download possible.
 
#define G_LINE_BUFFER   80
 For writes, via command interpreter, to the Galil.
 

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. More...
 
GCLIB_DLL_EXPORTED GReturn GCALL GClose (GCon g)
 Closes a connection to a Galil Controller. More...
 
GCLIB_DLL_EXPORTED GReturn GCALL GRead (GCon g, GBufOut buffer, GSize buffer_len, GSize *bytes_read)
 Performs a read on the connection. More...
 
GCLIB_DLL_EXPORTED GReturn GCALL GWrite (GCon g, GBufIn buffer, GSize buffer_len)
 Performs a write on the connection. More...
 
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. More...
 
GCLIB_DLL_EXPORTED GReturn GCALL GProgramDownload (GCon g, GCStringIn program, GCStringIn preprocessor)
 Downloads a program to the controller's program buffer. More...
 
GCLIB_DLL_EXPORTED GReturn GCALL GProgramUpload (GCon g, GBufOut buffer, GSize buffer_len)
 Uploads a program from the controller's program buffer. More...
 
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. More...
 
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. More...
 
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. More...
 
GCLIB_DLL_EXPORTED GReturn GCALL GMessage (GCon g, GCStringOut buffer, GSize buffer_len)
 Provides access to unsolicited messages from the controller. More...
 
GCLIB_DLL_EXPORTED GReturn GCALL GInterrupt (GCon g, GStatus *status_byte)
 Provides access to PCI and UDP interrupts from the controller. More...
 
GCLIB_DLL_EXPORTED GReturn GCALL GFirmwareDownload (GCon g, GCStringIn filepath)
 Upgrade firmware. More...
 
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. More...
 

Detailed Description

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

Definition in file gclib.h.