2 Public Function Vector_Mode(
gclib As Gclib, file As String) As Integer
4 gclib.GCommand("SH AB") 'Set servo here
7 gclib.GCommand("CAS") 'Defines S As active coordinate system
9 gclib.GCommand("VA 200000") 'Defines
vector acceleration
11 gclib.GCommand("VM AB") 'Begin
vector segment
13 Using reader As System.IO.StreamReader = New System.IO.StreamReader(file)
14 'Stores the available space of the vector buffer in the capacity variable
15 Dim capacity = gclib.GCmdI("MG _LMS")
16 Load_Buffer(gclib, reader, capacity)
18 Console.WriteLine("Begin Motion")
19 gclib.GCommand("BG S")
22 System.Threading.Thread.Sleep(100)
24 'Stores the available space of the vector buffer in the capacity variable
25 capacity = gclib.GCmdI("MG _LMS")
26 Loop While Load_Buffer(gclib, reader, capacity)
28 gclib.GCommand("VE") 'Segment End
30 Console.WriteLine(
"Motion Complete")
32 Return GALIL_EXAMPLE_OK
36 Private Function Load_Buffer(
gclib As Gclib, reader As System.IO.StreamReader, capacity As Integer) As Boolean
37 Dim s_cmd As String =
""
38 'Fully load the vector buffer leaving room for one VE command
39 For i = capacity To 1 Step -1
40 'If there Is another line of the text file
41 If reader.Peek() >= 0 Then
42 s_cmd = reader.ReadLine()
43 'Run the command on each line of the text file
string GCommand(string Command, bool Trim=true)
Used for command-and-response transactions.
void GMotionComplete(string axes)
Blocking call that returns once all axes specified have completed their motion.
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
GReturn commands(GCon g)
Demonstrates various uses of GCommand() and GUtility().
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.