gclib  528
Communications API for Galil controllers and PLCs
examples.h
Go to the documentation of this file.
1 
13 #ifndef examples_h
14 #define examples_h
15 
16 #define _CRT_SECURE_NO_WARNINGS //use traditional C calls like sprintf()
17 
18 #include "gclib.h"
19 #include "gclibo.h"
20 
21 #define GALIL_EXAMPLE_OK 0//return code for correct code execution
22 #define GALIL_EXAMPLE_ERROR -100 //return code for error in example code
23 
24 
26 
30 inline void e(GReturn rc)
31 {
32  if (rc != G_NO_ERROR)
33  throw rc;
34 }
35 
37 
45 GReturn position_tracking(GCon g, int speed = 5000);
46 
48 
55 GReturn jog(GCon g);
56 
58 
66 GReturn vector(GCon g, char* file);
67 
69 
77 GReturn ip_assigner(char* serial_num, int address);
78 
80 
88 
90 
98 
100 
107 GReturn message(GCon g);
108 
110 
119 GReturn record_position(GCon g, char* fileA, char* fileB);
120 
122 
131 GReturn contour(GCon g, char* fileA, char* fileB);
132 
134 
141 GReturn remote_server(const char* server_name);
142 
144 
150 
151 #endif //examples_h
152 
153 
GReturn ip_assigner(char *serial_num, int address)
Assigns controller an IP Adress given a serial number and a 1 byte address.
Definition: ip_assigner.cpp:26
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
Definition: vector.cpp:36
GReturn record_position(GCon g, char *fileA, char *fileB)
Record user's training and saves to a text file.
GReturn jog(GCon g)
Puts controller into Jog Mode and accepts user input to adjust the speed.
Definition: jog.cpp:29
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
Definition: gclib.h:92
GReturn motion_complete(GCon g)
Uses interrupts to track when the motion of controller is completed.
GReturn position_tracking(GCon g, int speed=5000)
Puts controller into Position Tracking Mode and accepts user-entered positions.
GReturn contour(GCon g, char *fileA, char *fileB)
Record user's training and plays back training through contour mode.
Definition: contour.cpp:20
GReturn remote_client()
Lists available remote servers and allows connection to remote server.
GReturn message(GCon g)
Demonstrates how to receive messages from the controller and detect differences in Trace and crashed ...
Definition: message.cpp:14
#define G_NO_ERROR
Return value if function succeeded.
Definition: gclib_errors.h:13
GReturn remote_server(const char *server_name)
Publishes local gcaps server to the network.
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
Definition: examples.h:30
GReturn commands(GCon g)
Demonstrates various uses of GCommand() and GUtility().
Definition: commands.cpp:16
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
Definition: gclib.h:91