gclib  1.37.6
Communications API for Galil controllers and PLCs
C++ examples


Files included in the C++ examples.


file  commands.cpp
file  commands_example.cpp
file  contour.cpp
file  contour_example.cpp
file  examples.h
file  ip_assigner.cpp
file  ip_assigner_example.cpp
file  jog.cpp
file  jog_example.cpp
file  message.cpp
file  message_example.cpp
file  motion_complete.cpp
file  motion_complete_example.cpp
file  position_tracking.cpp
file  position_tracking_example.cpp
file  record_position.cpp
file  record_position_example.cpp
file  remote_client.cpp
file  remote_server_example.cpp
file  remote_server.cpp
file  remote_server_example.cpp
file  vector.cpp
file  vector_example.cpp


#define GALIL_EXAMPLE_OK   0
#define GALIL_EXAMPLE_ERROR   -100
#define G_LASTINDEX   999


typedef std::vector< string > tokens


GReturn commands (GCon g)
 Demonstrates various uses of GCommand() and GUtility(). More...
int main (int argc, char *argv[])
 Main function for Commands Example. More...
bool load_buf (GCon g, const std::vector< int > &positions_A, const std::vector< int > &positions_B, int capacity, int &cmd)
 Loads contour buffer with commands from the given text file.
std::vector< int > csv_to_vector (ifstream &is)
 Converts a file of comma separated values to a vector.
GReturn contour (GCon g, char *fileA, char *fileB)
 Record user's training and plays back training through contour mode. More...
void e (GReturn rc)
 A trivial, C++ style return code check used in Galil's examples and demos. More...
void error (GCon g, GReturn rc)
 An example of error handling and debugging information.
int pause ()
 Pauses console apps for a user key stroke.
GReturn position_tracking (GCon g, int speed=5000)
 Puts controller into Position Tracking Mode and accepts user-entered positions. More...
GReturn jog (GCon g)
 Puts controller into Jog Mode and accepts user input to adjust the speed. More...
GReturn vector (GCon g, char *file)
 Puts controller into Vector Mode and accepts a file defining vector points. More...
GReturn ip_assigner (char *serial_num, int address)
 Assigns controller an IP Adress given a serial number and a 1 byte address. More...
GReturn motion_complete (GCon g)
 Uses interrupts to track when the motion of controller is completed. More...
GReturn message (GCon g)
 Demonstrates how to receive messages from the controller and detect differences in Trace and crashed code. More...
GReturn record_position (GCon g, char *fileA, char *fileB)
 Record user's training and saves to a text file. More...
GReturn remote_server (const char *server_name)
 Publishes local gcaps server to the network. More...
GReturn remote_client ()
 Lists available remote servers and allows connection to remote server. More...
tokens string_split (const string &str, const string &token)
 Splits a string into a vector based on a token.
int check_interrupts (GCon g, GCStringIn axes)
 Monitors interrupt status on the given axes and returns when interrupts are fired.
void write_array_to_file (GCon g, ofstream &os, const char *array_name, int previous_rd, int rd)
 Grabs data from array on controller and writes it to the given text file.
void print_client_message (const char *message)
void print_servers_list (const std::vector< std::string > &server_list)
void servers_to_list (std::vector< std::string > &server_list, std::string servers)
void print_server_message (const char *message)
bool load_buffer (GCon g, ifstream &fs, int capacity)