| gclib 422 Communications API for Galil controllers and PLCs |

gclibo.h
Go to the documentation of this file.
1
7 #ifndef I_007AD0AF_C956_4B96_ADE2_AD04FAFFEE99
8 #define I_007AD0AF_C956_4B96_ADE2_AD04FAFFEE99
9
10 //set library visibility for gcc and msvc
11 #if BUILDING_GCLIB && HAVE_VISIBILITY
12 #define GCLIB_DLL_EXPORTED __attribute__((__visibility__("default")))
13 #elif BUILDING_GCLIB && defined _MSC_VER
14 #define GCLIB_DLL_EXPORTED __declspec(dllexport)
15 #elif defined _MSC_VER
16 #define GCLIB_DLL_EXPORTED __declspec(dllimport)
17 #else
18 #define GCLIB_DLL_EXPORTED
19 #endif
20
21 #include "gclib.h" //Galil's C Library
22
23 #ifdef _WIN32
24 #define GCALL __stdcall
25 #else
26 #define GCALL /* nothing */
27 #endif
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #define MALLOCBUF G_HUGE_BUFFER
34 #define MAXPROG MALLOCBUF
35 #define MAXARRAY MALLOCBUF
36 #define POLLINGINTERVAL 100
37 #define G_USE_GCAPS
38
39 GCLIB_DLL_EXPORTED void GCALL GSleep(unsigned int timeout_ms);
48 GCLIB_DLL_EXPORTED GReturn GCALL GVersion(GCStringOut ver, GSize ver_len);
72 GCLIB_DLL_EXPORTED GReturn GCALL GAddresses(GCStringOut addresses, GSize addresses_len);
104 GCLIB_DLL_EXPORTED GReturn GCALL GInfo(GCon g, GCStringOut info, GSize info_len);
121 GCLIB_DLL_EXPORTED GReturn GCALL GTimeout(GCon g, short timeout_ms);
133 GCLIB_DLL_EXPORTED GReturn GCALL GCmd(GCon g, GCStringIn command);
147 GCLIB_DLL_EXPORTED GReturn GCALL GCmdT(GCon g, GCStringIn command, GCStringOut trimmed_response, GSize response_len, GCStringOut* front);
165 GCLIB_DLL_EXPORTED GReturn GCALL GCmdI(GCon g, GCStringIn command, int* value);
180 GCLIB_DLL_EXPORTED GReturn GCALL GCmdD(GCon g, GCStringIn command, double* value);
196 GCLIB_DLL_EXPORTED GReturn GCALL GMotionComplete(GCon g, GCStringIn axes);
214 GCLIB_DLL_EXPORTED GReturn GCALL GRecordRate(GCon g, double period_ms);
228 GCLIB_DLL_EXPORTED GReturn GCALL GProgramDownloadFile(GCon g, GCStringIn file_path, GCStringIn preprocessor);
241 GCLIB_DLL_EXPORTED GReturn GCALL GProgramUploadFile(GCon g, GCStringIn file_path);
253 GCLIB_DLL_EXPORTED GReturn GCALL GArrayDownloadFile(GCon g, GCStringIn file_path);
267 GCLIB_DLL_EXPORTED GReturn GCALL GArrayUploadFile(GCon g, GCStringIn file_path, GCStringIn names);
282 GCLIB_DLL_EXPORTED GReturn GCALL GIpRequests(GCStringOut requests, GSize requests_len);
308 GCLIB_DLL_EXPORTED GReturn GCALL GAssign(GCStringIn ip, GCStringIn mac);
330 GCLIB_DLL_EXPORTED void GCALL GError(GReturn rc, GCStringOut error, GSize error_len);
341 GCLIB_DLL_EXPORTED GReturn GCALL GSetupDownloadFile(GCon g, GCStringIn file_path, GOption options, GCStringOut info, GSize info_len);
394 #ifdef __cplusplus
395 } //extern "C"
396 #endif
397
398 #endif //I_007AD0AF_C956_4B96_ADE2_AD04FAFFEE99
GOption
int GOption
Option integer for various formatting, etc.
Definition: gclib.h:72
GMotionComplete
GCLIB_DLL_EXPORTED GReturn GCALL GMotionComplete(GCon g, GCStringIn axes)
Blocking call that returns once all axes specified have completed their motion.
Definition: gclibo.c:173
GSize
unsigned int GSize
Size of buffers, etc.
Definition: gclib.h:71
GIpRequests
GCLIB_DLL_EXPORTED GReturn GCALL GIpRequests(GCStringOut requests, GSize requests_len)
Uses GUtility(), G_UTIL_GCAPS_IPREQUEST or G_UTIL_IPREQUEST to provide a list of all Galil controller...
Definition: gclibo.c:99
GCmdT
GCLIB_DLL_EXPORTED GReturn GCALL GCmdT(GCon g, GCStringIn command, GCStringOut trimmed_response, GSize response_len, GCStringOut *front)
Wrapper around GCommand that trims the response.
Definition: gclibo.c:116
GRecordRate
GCLIB_DLL_EXPORTED GReturn GCALL GRecordRate(GCon g, double period_ms)
Sets the asynchronous data record to a user-specified period via DR.
Definition: gclibo.c:199
GAssign
GCLIB_DLL_EXPORTED GReturn GCALL GAssign(GCStringIn ip, GCStringIn mac)
Uses GUtility(), G_UTIL_GCAPS_ASSIGN or G_UTIL_ASSIGN to assign an IP address over the Ethernet to a ...
Definition: gclibo.c:66
GArrayUploadFile
GCLIB_DLL_EXPORTED GReturn GCALL GArrayUploadFile(GCon g, GCStringIn file_path, GCStringIn names)
Array upload to file.
Definition: arrays.c:398
GAddresses
GCLIB_DLL_EXPORTED GReturn GCALL GAddresses(GCStringOut addresses, GSize addresses_len)
Uses GUtility(), G_UTIL_GCAPS_ADDRESSES or G_UTIL_ADDRESSES to provide a listing of all available con...
Definition: gclibo.c:50
GCon
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen()...
Definition: gclib.h:70
GSetupDownloadFile
GCLIB_DLL_EXPORTED GReturn GCALL GSetupDownloadFile(GCon g, GCStringIn file_path, GOption options, GCStringOut info, GSize info_len)
Download a saved controller configuration from a file.
Definition: arrays.c:465
GProgramDownloadFile
GCLIB_DLL_EXPORTED GReturn GCALL GProgramDownloadFile(GCon g, GCStringIn file_path, GCStringIn preprocessor)
Program download from file.
Definition: gclibo.c:244
GTimeout
GCLIB_DLL_EXPORTED GReturn GCALL GTimeout(GCon g, short timeout_ms)
Uses GUtility() and G_UTIL_TIMEOUT_OVERRIDE to set the library timeout.
Definition: gclibo.c:61
GArrayDownloadFile
GCLIB_DLL_EXPORTED GReturn GCALL GArrayDownloadFile(GCon g, GCStringIn file_path)
Array download from file.
Definition: arrays.c:370
GVersion
GCLIB_DLL_EXPORTED GReturn GCALL GVersion(GCStringOut ver, GSize ver_len)
Uses GUtility(), G_UTIL_VERSION and G_UTIL_GCAPS_VERSION to provide the library and gcaps version num...
Definition: gclibo.c:25
GReturn
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
Definition: gclib.h:69
GInfo
GCLIB_DLL_EXPORTED GReturn GCALL GInfo(GCon g, GCStringOut info, GSize info_len)
Uses GUtility() and G_UTIL_INFO to provide a useful connection string.
Definition: gclibo.c:45
GError
GCLIB_DLL_EXPORTED void GCALL GError(GReturn rc, GCStringOut error, GSize error_len)
Provides a human-readable description string for return codes.
Definition: gclibo.c:316
GCStringIn
const char * GCStringIn
C-string input to the library. Implies null-termination.
Definition: gclib.h:74
GSleep
GCLIB_DLL_EXPORTED void GCALL GSleep(unsigned int timeout_ms)
Uses GUtility() and G_UTIL_SLEEP to provide a blocking sleep call which can be useful for timing-base...
Definition: gclibo.c:20
GCmdD
GCLIB_DLL_EXPORTED GReturn GCALL GCmdD(GCon g, GCStringIn command, double *value)
Wrapper around GCommand that provides the return value of a command parsed into a double...
Definition: gclibo.c:162
GCStringOut
char * GCStringOut
C-string output from the library. Implies null-termination.
Definition: gclib.h:73
GCALL
#define GCALL
Specify calling convention for Windows.
Definition: gclib.h:24
gclib.h
GCmdI
GCLIB_DLL_EXPORTED GReturn GCALL GCmdI(GCon g, GCStringIn command, int *value)
Wrapper around GCommand that provides the return value of a command parsed into an int...
Definition: gclibo.c:151
GProgramUploadFile
GCLIB_DLL_EXPORTED GReturn GCALL GProgramUploadFile(GCon g, GCStringIn file_path)
Program upload to file.
Definition: gclibo.c:287
GCmd
GCLIB_DLL_EXPORTED GReturn GCALL GCmd(GCon g, GCStringIn command)
Wrapper around GCommand for use when the return value is not desired.
Definition: gclibo.c:110