gclib 2.0.9
Communications API for Galil controllers and PLCs
 
Loading...
Searching...
No Matches
Commands_Example.vb
Go to the documentation of this file.
1''' <summary>
3''' </summary>
5Module Commands_Example
6
7 ''' <summary>
8 ''' Main function for the commands example.
9 ''' </summary>
12 Function Main() As Integer
13 Dim rc As Integer = Examples.GALIL_EXAMPLE_OK
14 Dim gclib As Gclib = New Gclib()
17 If args.Count() <> 2 Then
19 Console.WriteLine("Usage: commands_example.exe <ADDRESS>")
20
21 Console.Write(vbCrLf + "Press any key to close the example.")
23 Return Examples.GALIL_EXAMPLE_ERROR
24 End If
25
27
29
30 rc = Examples.Commands(gclib)
31 Catch ex As Exception
32 Examples.PrintError(gclib, ex)
33 rc = Examples.GALIL_EXAMPLE_ERROR
36 End Try
37
38 Console.Write(vbCrLf + "Press any key to close the example.")
40
43
Definition Galil.h:26
Provides a class of shared constants and methods for gclib's example projects.
Definition commands.cs:16
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 GCommand(GCon g, GCStringIn command, GBufOut buffer, GSize buffer_len, GSize *bytes_returned)
Performs a command-and-response transaction on the connection.
GCLIB_DLL_EXPORTED GReturn GCALL GOpen(GCStringIn address, GCon *g)
Open a connection to a Galil Controller.
void error(GCon g, GReturn rc)
An example of error handling and debugging information.
Definition examples.h:40
GReturn commands(GCon g)
Demonstrates various uses of GCommand() and GUtility().
Definition commands.cpp:16
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
Definition vector.cpp:36
int Main()
Main function for the commands example.