33 #include <PanTilt/IselLinearControlTwoAxis.hh>
38 int main(
int argc,
char *argv[])
48 cout <<
"Usage: ./ExampleIselLinearControlTwoAxis <PortName>" << endl;
52 if (control.
Init(argv[1]) != 0) {
53 cout <<
"Initialising IGOR unit on serial port x failed!" << endl;
59 cout <<
"bla" << endl;
62 cout <<
"============================" << endl;
63 cout <<
"(1) move x-axis" << endl;
64 cout <<
"(2) move y-axis" << endl;
65 cout <<
"(3) status output" << endl;
66 cout <<
"(4) set speed" << endl;
67 cout <<
"(5) reference movement" << endl;
68 cout <<
"(6) move free" << endl;
69 cout <<
"(7) position output" << endl;
70 cout <<
"(8) set position" << endl;
71 cout <<
"(9) send command" << endl;
72 cout <<
"(Q) quit" << endl;
77 cout <<
"move distance (mm):" << endl;
79 control.
Move(input,0);
82 cout <<
"move distance (mm):" << endl;
84 control.
Move(0,input);
92 cout <<
"set speed on x-axis (mm/sec) to:" << endl;
94 cout <<
"set speed on y-axis (mm/sec) to:" << endl;
107 cout <<
"position (mm): " << f <<
", " << f2 << endl;
110 cout <<
"set position on x-axis (mm) to:" << endl;
112 cout <<
"set position on y-axis (mm) to:" << endl;
117 cout <<
"enter command:" << endl;
121 cout <<
"return: " << s << endl;
127 cout <<
"unknown input!" << endl;
This class controls the Isel iMC-S8 Linear Unit (two axis controll)
void SendRawCommand(const std::string cmd)
Send a command string, terminated by <cr> character.
void GetCurrentPosition(float &millimetersX, float &millimetersY)
int Init(const int nCOMportNumber)
opens the serial port and initialises unit
int SetSpeed(const float speedX, const float speedY)
sets the maximum/desired speed for all movements in millimeter per second
int SetPosition(const float millimetersX, const float millimetersY, const bool bWaitComplete=true)
int Reset(const int axis=3)
Start Reference Tour on given axis (1-x, 2-y, or 3 x+y)
int Move(const float millimetersX, const float millimetersY)
move millimeters in directions
int ReadRawLine(std::string &cmd)
Read a line from the serial port, returns length of read string, zero on nothing to read...