gclib  2.0.8
Communications API for Galil controllers and PLCs
Motion_Complete_Example.vb
Go to the documentation of this file.
1 Module Motion_Complete_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 <> 2 Then
8  Console.WriteLine("Incorrect number of arguments provided")
9  Console.WriteLine("Usage: motion_complete_example.exe <ADDRESS>")
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 
18  ' Open a connection at the provided address and subcribe to event interrupts
19  gclib.GOpen(address + " --subscribe EI")
20 
21  rc = Examples.Motion_Complete(gclib)
22  Catch ex As Exception
24  rc = Examples.GALIL_EXAMPLE_ERROR
25  Finally
26  gclib.GClose()
27  End Try
28 
29  Console.Write(vbCrLf + "Press any key to close the example.")
30  Console.ReadKey()
31 
32  Return rc
33  End Function
34 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.