gclib 2.0.9
Communications API for Galil controllers and PLCs
 
Loading...
Searching...
No Matches
remote_client_example.cpp
Go to the documentation of this file.
1
9#include "examples.h"
10
11#include <iostream> //std::cout
12
13using namespace std;
14
16
19int main(int argc, char * argv[])
20{
21 char buf[G_SMALL_BUFFER];
22 int rc = GALIL_EXAMPLE_OK;
23
24 try
25 {
26 //Demonstrates various uses of GListServers() and GSetServer().
28 }
29 catch (GReturn gr)
30 {
31 error(nullptr, gr); //see examples.h for error handling
32 pause();
33 return GALIL_EXAMPLE_ERROR;
34 }
35
36 pause();
37 return GALIL_EXAMPLE_OK;
38}
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
Definition gclib.h:93
#define G_SMALL_BUFFER
Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.
Definition gclib.h:89
int main(int argc, char *argv[])
Main function for Commands Example.
void error(GCon g, GReturn rc)
An example of error handling and debugging information.
Definition examples.h:40
int pause()
Pauses console apps for a user key stroke.
Definition examples.h:62
GReturn remote_client()
Lists available remote servers and allows connection to remote server.
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
Definition vector.cpp:36