gclib  2.0.8
Communications API for Galil controllers and PLCs
Remote_Server.cs
Go to the documentation of this file.
1 
10 using System;
11 
12 namespace examples
13 {
14  public static partial class Examples
15  {
31 
32  public static int Remote_Server(string server_name)
33  {
34  gclib gclib = new gclib();
35 
36  bool loop = true;
37 
38  Console.WriteLine("<p> Publish this server to the network\n" +
39  "<r> Remove this server from the network\n" +
40  "<q> Quit");
41 
42  while (loop)
43  {
44  switch (Console.ReadKey(true).Key)
45  {
46  case ConsoleKey.Q:
47  loop = false;
48  break;
49  case ConsoleKey.P:
50  gclib.GPublishServer(server_name, true, false);
51  Console.WriteLine("Published Server");
52  break;
53  case ConsoleKey.R:
54  gclib.GPublishServer(server_name, false, false);
55  Console.WriteLine("Removed Server");
56  break;
57  }
58  }
59 
60  return GALIL_EXAMPLE_OK;
61  }
63  }
64 }
const int GALIL_EXAMPLE_OK
Examples success code.
Definition: examples.cs:29
void GPublishServer(string server_name, bool publish, bool save)
Publishes or removes local gcaps server from the network
Definition: gclib.cs:738
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
Definition: gclib.cs:68
static int Remote_Server(string server_name)
Accepts user input to publish or remove local gcaps server from the network.
partial Module Examples
Definition: Commands.vb:4