| gclib 1.34.15 Communications API for Galil controllers and PLCs |

remote_client_example.cpp
1
9 #include "examples.h"
10
11 #include <iostream> //std::cout
12
13 using namespace std;
14
16
19 int 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().
27 remote_client();
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 }
examples.h
GReturn
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
Definition: gclib.h:93
G_SMALL_BUFFER
#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
main
int main(int argc, char *argv[])
Main function for Commands Example.
Definition: commands_example.cpp:18
remote_client
GReturn remote_client()
Lists available remote servers and allows connection to remote server.
Definition: remote_client.cpp:89
error
void error(GCon g, GReturn rc)
An example of error handling and debugging information.
Definition: examples.h:40
pause
int pause()
Pauses console apps for a user key stroke.
Definition: examples.h:62