gclib  2.0.8
Communications API for Galil controllers and PLCs
Jog_Example.vb
Go to the documentation of this file.
1 '
7 Module Jog_Example
8 
9  Function Main() As Integer
10  Dim rc As Integer = Examples.GALIL_EXAMPLE_OK
11  Dim gclib As Gclib = New Gclib()
12  Dim args() As String = Environment.GetCommandLineArgs()
13  Try
14  If args.Count() <> 2 Then
15  Console.WriteLine("Incorrect number of arguments provided")
16  Console.WriteLine("Usage: jog_example.exe <ADDRESS>")
17 
18  Console.Write(vbCrLf + "Press any key to close the example.")
19  Console.ReadKey()
20  Return Examples.GALIL_EXAMPLE_ERROR
21  End If
22 
23  Dim address As String = args(1)
24 
25  gclib.GOpen(address)
26 
27  rc = Examples.Jog(gclib)
28  Catch ex As Exception
29  Examples.PrintError(gclib, ex)
30  rc = Examples.GALIL_EXAMPLE_ERROR
31  Finally
32  gclib.GClose()
33  End Try
34 
35  Console.Write(vbCrLf + "Press any key to close the example.")
36  Console.ReadKey()
37 
38  Return rc
39  End Function
40 
41 End Module