gclib 2.0.9
Communications API for Galil controllers and PLCs
 
Loading...
Searching...
No Matches
Examples.vb
Go to the documentation of this file.
1''' <summary>
3''' </summary>
5 Public Const GALIL_EXAMPLE_OK As Integer = 0
6 Public Const GALIL_EXAMPLE_ERROR = -100
7
8 ''' <summary>
10 ''' error message.
11 ''' </summary>
12 ''' <param name="gclib">The gclib object from where the exception originated.</param>
13 ''' <param name="ex">The exception object caught by the example.</param>
14 ''' <remarks>See commands_example.cs for an example.</remarks>
15 Public Sub PrintError(gclib As Gclib, ex As Exception)
16 Console.WriteLine(ex.Message)
17
18 'If exception was Not a GOpen() exception, safe to query
20 If Not ex.Message.Contains("-1101") Then
21 Console.WriteLine(gclib.GCommand("TC 1"))
22 End If
23 End Sub
string GCommand(string Command, bool Trim=true)
Used for command-and-response transactions.
Definition gclib.cs:257
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
Definition gclib.cs:68
void error(GCon g, GReturn rc)
An example of error handling and debugging information.
Definition examples.h:40
GReturn message(GCon g)
Demonstrates how to receive messages from the controller and detect differences in Trace and crashed ...
Definition message.cpp:14
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
Definition vector.cpp:36
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.