gclib  2.0.8
Communications API for Galil controllers and PLCs
Contour_Example.vb
Go to the documentation of this file.
1 Module Contour_Example
2  Function Main() As Integer
3  Dim rc As Integer = Examples.GALIL_EXAMPLE_OK
4  Dim gclib As Gclib = New Gclib()
5  Dim args() As String = Environment.GetCommandLineArgs()
6  Try
7  If args.Count <> 4 Then
8  Console.WriteLine("Incorrect number of arguments provided")
9  Console.WriteLine("Usage: contour_example.exe <ADDRESS> <FILE A> <FILE B>")
10 
11  Console.Write(vbCrLf + "Press any key to close the example.")
12  Console.ReadKey()
13  Return Examples.GALIL_EXAMPLE_ERROR
14  End If
15 
16  Dim address As String = args(1) 'Retrieve address from command line
17  Dim fileA As String = args(2) 'Retrieve filepath from command line
18  Dim fileB As String = args(3) 'Retrieve filepath from command line
19 
20  gclib.GOpen(address) 'Open a connection at the provided address
21 
22  'Record user's training and play back training through contour mode
23  rc = Examples.Contour(gclib, fileA, fileB)
24  Catch ex As Exception
26  rc = Examples.GALIL_EXAMPLE_ERROR
27  Finally
28  gclib.GClose()
29  End Try
30 
31  Console.Write(vbCrLf + "Press any key to close the example.")
32  Console.ReadKey()
33 
34  Return rc
35  End Function
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.
GReturn contour(GCon g, char *fileA, char *fileB)
Record user's training and plays back training through contour mode.
Definition: contour.cpp:20
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.