13 char buf[G_SMALL_BUFFER];
14 int acc = 100 * speed;
18 cerr <<
"There was an error with the connection." << endl;
19 return G_CONNECTION_NOT_ESTABLISHED;
23 e(GMotionComplete(g,
"A"));
28 sprintf(buf,
"SPA=%d", speed);
31 sprintf(buf,
"ACA=%d", acc);
34 sprintf(buf,
"DCA=%d", acc);
37 cout <<
"Begin Position Tracking with speed " << speed;
38 cout <<
". Enter a non-number to exit.\n";
44 cout <<
"Enter a new position:\n";
49 cout <<
"Position Tracking has exited\n";
54 sprintf(buf,
"PAA=%d", position);
60 e(GMotionComplete(g,
"A"));
62 return GALIL_EXAMPLE_OK;
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
GReturn position_tracking(GCon g, int speed)
Puts controller into Position Tracking Mode and accepts user-entered positions.