gclib  2.0.8
Communications API for Galil controllers and PLCs
Vector_Mode_Example.vb
Go to the documentation of this file.
1 Module Vector_Mode_Example
2 
3  Function Main() As Integer
4  Dim rc As Integer = Examples.GALIL_EXAMPLE_OK
5  Dim gclib As Gclib = New Gclib()
6  Dim args() As String = Environment.GetCommandLineArgs()
7  Try
8  If args.Count() <> 3 Then
9  Console.WriteLine("Incorrect number of arguments provided")
10  Console.WriteLine("Usage: vector_mode_example.exe <ADDRESS> <FILE>")
11 
12  Console.Write(vbCrLf + "Press any key to close the example.")
13  Console.ReadKey()
14  Return Examples.GALIL_EXAMPLE_ERROR
15  End If
16 
17  Dim address As String = args(1) 'Retrieve address from command line
18  Dim file = args(2) 'Retrieve file from command line
19 
20  gclib.GOpen(address)
21 
22  rc = Examples.Vector_Mode(gclib, file)
23  Catch ex As Exception
25  rc = Examples.GALIL_EXAMPLE_ERROR
26  Finally
27  gclib.GClose()
28  End Try
29 
30  Console.Write(vbCrLf + "Press any key to close the example.")
31  Console.ReadKey()
32 
33  Return rc
34  End Function
35 
36 End Module
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
Definition: gclib.cs:68
GCLIB_DLL_EXPORTED GReturn GCALL GClose(GCon g)
Closes a connection to a Galil Controller.
GCLIB_DLL_EXPORTED GReturn GCALL GOpen(GCStringIn address, GCon *g)
Open a connection to a Galil Controller.
int Main()
partial Module Examples
Definition: Commands.vb:4
void PrintError(Gclib gclib, Exception ex)
Prints the exception to the console And queries the controller for the most recent error message.