1 Partial Public Module Examples
3 ''' Demonstrates various uses of GCommand() And basic controller queries.
5 ''' <param name="gclib">A gclib object with a valid connection.</param>
6 ''' <returns>The success status Or error code of the function.</returns>
7 ''' <remarks>See commands_example.cs for an example.</remarks>
8 Function Commands(gclib As Gclib) As Integer
9 Console.WriteLine("*****************************************************************************")
10 Console.WriteLine("*********************** GCommand Trimmed example ***********************")
11 Console.WriteLine("*****************************************************************************")
13 Console.WriteLine("GCommand(""PR ?,? "", true) will return a trimmed response of GCommand()")
14 Console.WriteLine("The command 'PR ?,?' will return the relative " +
15 "position of the A and B axes")
16 Console.WriteLine("<<PR ?,? with no trim: " + gclib.GCommand("PR ?,?", False) + ">>")
17 Console.WriteLine("<<PR ?,? with trim: " + gclib.GCommand("PR ?,?", True) + ">>")
19 Console.WriteLine("*****************************************************************************")
20 Console.WriteLine("************************* GCommand Int example *************************")
21 Console.WriteLine("*****************************************************************************")
23 Console.WriteLine("Use GCmdI() to retrieve the value of GCommand as an int.")
24 Console.WriteLine("The command 'MG _LMS' will return the available " +
25 "space in the vector buffer of the S plane.")
27 Console.WriteLine("MG _LMS with GCmdI(): " + gclib.GCmdI("MG _LMS").ToString())
29 Console.WriteLine("*****************************************************************************")
30 Console.WriteLine("*********************** GCommand Double example ************************")
31 Console.WriteLine("*****************************************************************************")
33 Console.WriteLine("Use GCmdD() to retrieve the value of GCommand as a double.")
34 Console.WriteLine("The command 'MG @AN[1]' will return the value of Analog Input 1")
36 Console.WriteLine("MG @AN[1] with GCmdD(): " + gclib.GCmdD("MG @AN[1]").ToString())
38 Return Examples.GALIL_EXAMPLE_OK