gclib 2.0.9
Communications API for Galil controllers and PLCs
 
Loading...
Searching...
No Matches
Remote_Server.cs
Go to the documentation of this file.
1
10using System;
11
12namespace 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
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
Definition vector.cpp:36
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