1 Partial Public Module Examples
2 Public Function Jog(gclib As Gclib) As Integer
3 gclib.GCommand("ST") ' Stop all motors
4 gclib.GMotionComplete("A") ' Wait For motion To complete
5 gclib.GCommand("SHA") ' Set servo here
6 gclib.GCommand("DPA=0") ' Start position at absolute zero
7 gclib.GCommand("JGA=0") ' Start jogging With 0 speed
8 gclib.GCommand("BGA") ' Begin motion On A Axis
10 Dim isJogging As Boolean = True
11 Dim speed As Integer = 0
13 Console.WriteLine("Enter a character on the keyboard to change the" +
14 " motor's speed:" + Environment.NewLine +
15 "<q> Quit" + Environment.NewLine +
16 "<a> -2000 counts/s" + Environment.NewLine +
17 "<s> -500 counts/s" + Environment.NewLine +
18 "<d> +500 counts/s" + Environment.NewLine +
19 "<f> +2000 counts/s" + Environment.NewLine +
20 "<r> Direction Reversal" + Environment.NewLine)
23 gclib.GCommand("JGA=" + speed.ToString())
24 Console.WriteLine("Jog Speed: " + speed.ToString())
26 Select Case Console.ReadKey(True).Key
43 gclib.GMotionComplete("A")
45 Return GALIL_EXAMPLE_OK