| gclib 1.35.5 Communications API for Galil controllers and PLCs |

commands.cs
Go to the documentation of this file.
1
11 using System;
12
13 namespace examples
14 {
15 public static partial class Examples
16 {
27
28 public static int Commands(gclib gclib)
29 {
30 Console.WriteLine("*****************************************************************************");
31 Console.WriteLine("*********************** GCommand Trimmed example ***********************");
32 Console.WriteLine("*****************************************************************************");
33
34 Console.WriteLine("GCommand(\"PR ?,? \", true) will return a trimmed response of GCommand()");
35 Console.WriteLine("The command 'PR ?,?' will return the relative " +
36 "position of the A and B axes");
37 Console.WriteLine("<<PR ?,? with no trim: " + gclib.GCommand("PR ?,?", false) + ">>");
38 Console.WriteLine("<<PR ?,? with trim: " + gclib.GCommand("PR ?,?", true) + ">>");
39
40 Console.WriteLine("*****************************************************************************");
41 Console.WriteLine("************************* GCommand Int example *************************");
42 Console.WriteLine("*****************************************************************************");
43
44 Console.WriteLine("Use GCmdI() to retrieve the value of GCommand as an int.");
45 Console.WriteLine("The command 'MG _LMS' will return the available " +
46 "space in the vector buffer of the S plane.");
47
48 Console.WriteLine("MG _LMS with GCmdI(): " + gclib.GCmdI("MG _LMS"));
49
50 Console.WriteLine("*****************************************************************************");
51 Console.WriteLine("*********************** GCommand Double example ************************");
52 Console.WriteLine("*****************************************************************************");
53
54 Console.WriteLine("Use GCmdD() to retrieve the value of GCommand as a double.");
55 Console.WriteLine("The command 'MG @AN[1]' will return the value of Analog Input 1");
56
57 Console.WriteLine("MG @AN[1] with GCmdD(): " + gclib.GCmdD("MG @AN[1]"));
58
59 return GALIL_EXAMPLE_OK;
60 }
62 }
63 }
examples.Examples
Provides a class of shared constants and methods for gclib's example projects.
Definition: commands.cs:16
examples.Examples.GALIL_EXAMPLE_OK
const int GALIL_EXAMPLE_OK
Examples success code.
Definition: examples.cs:29
examples.Examples.Commands
static int Commands(gclib gclib)
Demonstrates various uses of GCommand() and basic controller queries.
Definition: commands.cs:28
examples
Definition: commands.cs:14