| gclib 556 Communications API for Galil controllers and PLCs |

Remote_Server.vb
1 Partial Public Module Examples
2 ''' <summary>
3 ''' Demonstrates various uses of GPublishServer()
4 ''' </summary>
5 ''' <param name="server_name">The name to publish the server under.</param>
6 ''' <returns>The success status Or error code of the function.</returns>
7 ''' <remarks>See remote_server_example.cs for an example.</remarks>
8 Function Remote_Server(server_name As String) As Integer
9 Dim gclib = New Gclib()
10
11 Console.WriteLine("<p> Publish this server to the network" + vbNewLine +
12 "<r> Remove this server from the network" + vbNewLine +
13 "<q> Quit")
14
15 Dim loop_bool = True
16
17 While loop_bool
18 Select Case Console.ReadKey(True).Key
19 Case ConsoleKey.Q
20 loop_bool = False
21 Case ConsoleKey.P
22 gclib.GPublishServer(server_name, True, False)
23 Console.WriteLine("Published Server")
24 Case ConsoleKey.R
25 gclib.GPublishServer(server_name, False, False)
26 Console.WriteLine("Removed Server")
27 End Select
28
29 End While
30
31 Return Examples.GALIL_EXAMPLE_OK
32 End Function
33 End Module