gclib examples  0
Example Projects for the Communications API for Galil controllers and PLCs
examples.h
Go to the documentation of this file.
1 
5 #ifndef examples_h
6 #define examples_h
7 
8 #define _CRT_SECURE_NO_WARNINGS //use traditional C calls like sprintf()
9 
10 #include "gclib.h"
11 #include "gclibo.h"
12 
13 #define GALIL_EXAMPLE_OK 0//return code for correct code execution
14 #define GALIL_EXAMPLE_ERROR -100 //return code for error in example code
15 
16 
18 
22 inline void e(GReturn rc)
23 {
24  if (rc != G_NO_ERROR)
25  throw rc;
26 }
27 
29 
37 GReturn position_tracking(GCon g, int speed = 5000);
38 
40 
47 GReturn jog(GCon g);
48 
50 
58 GReturn vector(GCon g, char* file);
59 
61 
69 GReturn ip_assigner(char* serial_num, int address);
70 
72 
79 GReturn commands(GCon g);
80 
82 
89 GReturn motion_complete(GCon g);
90 
92 
99 GReturn message(GCon g);
100 
102 
111 GReturn record_position(GCon g, char* fileA, char* fileB);
112 
114 
123 GReturn contour(GCon g, char* fileA, char* fileB);
124 
125 #endif //examples_h
126 
127 
GReturn jog(GCon g)
Puts controller into Jog Mode and accepts user input to adjust the speed.
Definition: jog.cpp:25
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:22
GReturn record_position(GCon g, char *fileA, char *fileB)
Record user's training and saves to a text file.
GReturn contour(GCon g, char *fileA, char *fileB)
Record user's training and plays back training through contour mode.
Definition: contour.cpp:16
GReturn commands(GCon g)
Demonstrates various uses of GCommand() and GUtility().
Definition: commands.cpp:12
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 vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
Definition: vector.cpp:32
GReturn message(GCon g)
Demonstrates how to receive messages from the controller and detect differences in Trace and crashed ...
Definition: message.cpp:10
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
Definition: examples.h:22