14 public static partial class Examples
28 Console.WriteLine(
"*************************************************************");
29 Console.WriteLine(
"Example GInterrupt() usage");
30 Console.WriteLine(
"*************************************************************");
34 bool ei_support =
false;
36 if (gclib.GCommand(
"WH").Contains(
"IH"))
41 Console.WriteLine(
"No support on this bus");
46 gclib.GCommand(
"EI0,0");
50 while (gclib.GInterrupt() > 0) ;
55 gclib.GCommand(
"DP 0,0");
56 Console.WriteLine(
"Position: " + gclib.GCommand(
"RP"));
58 gclib.GCommand(
"SP 4000,4000");
59 gclib.GCommand(
"AC 1280000, 1280000");
60 gclib.GCommand(
"DC 1280000, 1280000");
61 gclib.GCommand(
"PR 8000, 10000");
62 gclib.GCommand(
"SH AB");
64 Console.WriteLine(
"Beginning independent motion...");
65 gclib.GCommand(
"BG AB");
66 Check_Interrupts(gclib,
"AB");
67 Console.WriteLine(
"Motion Complete on A and B");
68 Console.WriteLine(
"Position: " + gclib.GCommand(
"RP"));
73 private static void Check_Interrupts(gclib gclib,
string axes)
77 byte axis_mask = 0xFF;
80 for (
int i = 0; i < axes.Length; i++)
113 gclib.GCommand(
"EI " + ~axis_mask);
117 while (axis_mask != 0xFF)
119 switch (status = gclib.GInterrupt())
static int Motion_Complete(gclib gclib)
Uses interrupts to track when the motion of controller is completed.
const int GALIL_EXAMPLE_OK
Examples success code.
const int GALIL_EXAMPLE_ERROR
Examples error code.