2 Public Function Position_Tracking(
gclib As Gclib, speed As Integer)
3 Dim acc = 100 * speed
' Set acceleration/deceleration to 100 times speed
5 gclib.GCommand("STA") 'Stop motor
7 gclib.GCommand("SHA") 'Set servo here
9 gclib.GCommand("PTA=1") 'Start position tracking mode On A axis
12 gclib.GCommand("ACA=" + acc.ToString()) 'Set acceleration
15 Console.WriteLine("Begin Position Tracking with speed " + speed.ToString() +
16 ". Enter a non-number to exit.\n")
18 Dim position As Integer
20 'Loop asking user
for New position. End loop when user enters a non-number
22 Console.WriteLine(
"Enter a new position:")
23 Dim ok = Integer.TryParse(Console.ReadLine(), position)
25 If ok Then
' A Then valid position was provided
26 gclib.GCommand("PAA=" + position.ToString()) ' Go To New position
27 Else
'A non-number was entered
28 Console.WriteLine("Position Tracking has exited")
32 gclib.GCommand("STA") 'Stop motor
35 Return GALIL_EXAMPLE_OK
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...