| 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
87 GReturn commands(GCon g);
88
90
97 GReturn motion_complete(GCon g);
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
149 GReturn remote_client();
150
151 #endif //examples_h
152
153
ip_assigner
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
vector
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
Definition: vector.cpp:36
record_position
GReturn record_position(GCon g, char *fileA, char *fileB)
Record user's training and saves to a text file.
Definition: record_position.cpp:20
jog
GReturn jog(GCon g)
Puts controller into Jog Mode and accepts user input to adjust the speed.
Definition: jog.cpp:29
GCon
void * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
Definition: gclib.h:92
motion_complete
GReturn motion_complete(GCon g)
Uses interrupts to track when the motion of controller is completed.
Definition: motion_complete.cpp:18
position_tracking
GReturn position_tracking(GCon g, int speed=5000)
Puts controller into Position Tracking Mode and accepts user-entered positions.
Definition: position_tracking.cpp:15
contour
GReturn contour(GCon g, char *fileA, char *fileB)
Record user's training and plays back training through contour mode.
Definition: contour.cpp:20
remote_client
GReturn remote_client()
Lists available remote servers and allows connection to remote server.
Definition: remote_client.cpp:89
message
GReturn message(GCon g)
Demonstrates how to receive messages from the controller and detect differences in Trace and crashed ...
Definition: message.cpp:14
G_NO_ERROR
#define G_NO_ERROR
Return value if function succeeded.
Definition: gclib_errors.h:13
remote_server
GReturn remote_server(const char *server_name)
Publishes local gcaps server to the network.
Definition: remote_server.cpp:39
gclib.h
e
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
Definition: examples.h:30
commands
GReturn commands(GCon g)
Demonstrates various uses of GCommand() and GUtility().
Definition: commands.cpp:16
gclibo.h
GReturn
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
Definition: gclib.h:91