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>
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())
Provides a class of shared constants and methods for gclib's example projects.
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
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 GCmdI(GCon g, GCStringIn command, int *value)
Wrapper around GCommand that provides the return value of a command parsed into an int.
GCLIB_DLL_EXPORTED GReturn GCALL GCmdD(GCon g, GCStringIn command, double *value)
Wrapper around GCommand that provides the return value of a command parsed into a double.
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
void error(GCon g, GReturn rc)
An example of error handling and debugging information.
int Commands(Gclib gclib)
Demonstrates various uses of GCommand() And basic controller queries.