7 vector<std::string> Galil::sources()
10 for (
auto it = d->map.begin(); it != d->map.end(); ++it)
11 s.push_back(it->first);
13 std::sort(s.begin(), s.end());
18 void Galil::recordsStart(
double period_ms)
23 vector<char> Galil::record(
const std::string& method)
27 vector <char> record_vector;
34 double Galil::sourceValue(
const std::vector<char>& record,
const std::string& source)
39 const Source& s = d->map.at(source);
44 case 'B': return_value = *(
unsigned char*)(&record[0] + s.byte);
break;
45 case 'W': return_value = *(
unsigned short*)(&record[0] + s.byte);
break;
46 case 'L': return_value = *(
unsigned int*)(&record[0] + s.byte);
break;
51 case 'B': return_value = *(
char*)(&record[0] + s.byte);
break;
52 case 'W': return_value = *(
short*)(&record[0] + s.byte);
break;
53 case 'L': return_value = *(
int*)(&record[0] + s.byte);
break;
58 bool bTRUE = s.scale > 0;
59 return return_value & (1 << s.bit) ? bTRUE : !bTRUE;
62 return (return_value / s.scale) + s.offset;
65 catch (
const std::out_of_range&
e)
73 string Galil::source(
const std::string& field,
const std::string& source)
77 const Source& s = d->map.at(source);
78 if (field ==
"Description")
85 return to_string(s.scale);
87 if (field ==
"Offset")
88 return to_string(s.offset);
92 catch (
const std::out_of_range&
e)
100 void Galil::setSource(
const std::string& field,
const std::string& source,
const std::string& to)
104 Source& s = d->map.at(source);
105 if (field ==
"Description")
111 if (field ==
"Units")
117 if (field ==
"Scale")
123 if (field ==
"Offset")
129 catch (
const std::out_of_range&
e)
138 void GalilPrivate::InitializeDataRecord()
143 string qz = q->command(
"QZ");
144 vector<int> qz_split;
146 for (
size_t i = 0; i < qz.length(); i++)
150 qz_split.push_back(stoi(qz.substr(start, i - start)));
155 if (i == qz.length() - 1)
157 qz_split.push_back(stoi(qz.substr(start)));
162 if (4 != qz_split.size())
return;
164 int axes = qz_split[0];
168 string rv = q->command(
"\x12\x16");
169 if (rv.find(
"DMC18") != string::npos)
171 if (rv.length() >= 7)
173 if (rv[6] ==
'6')
return Init1806(axes);
174 if (rv[6] ==
'0')
return Init1800(axes,
false);
175 if (rv[6] ==
'2')
return Init1800(axes,
true);
179 int gen_status = qz_split[1];
180 if (gen_status == 18)
return Init30010(rv.find(
"DMC31") != string::npos);
182 int axis_block = qz_split[3];
183 if (axis_block == 36)
return Init4000(axes);
184 if (axis_block == 28)
return Init2103(axes);
187 if (axis_block != 0)
return;
190 int io_block = qz_split[2];
193 bool rio3 = ((io_block == 52) || (io_block == 60) || (io_block == 68));
196 bool rioser = ((io_block == 64) || (io_block == 68));
199 bool rio3ex = (io_block == 60);
204 if (rio3ex) InitRio3_24Ex();
205 if (rioser) InitRioSer(rio3);
209 string GalilPrivate::ax(
string prefix,
int axis,
string suffix)
211 return prefix + (char)(
'A' + axis) + suffix;
214 void GalilPrivate::input_bits(
int byte,
int num)
218 for (
int i = 0; i < 8; i++)
221 ss << setw(2) << setfill(
'0') << right << num;
223 map[ss.str()] =
Source(
byte,
"UB", i,
"Boolean",
"Digital input " + to_string(num));
229 void GalilPrivate::output_bits(
int byte,
int num)
233 for (
int i = 0; i < 8; i++)
236 ss << setw(2) << setfill(
'0') << right << num;
238 map[ss.str()] =
Source(
byte,
"UB", i,
"Boolean",
"Digital output " + to_string(num));
244 void GalilPrivate::aq_analog(
int byte,
int input_num)
250 string command =
"MG{Z10.0}_AQ" + to_string(input_num);
255 case 1:
case -1: divisor = 32768.0 / 5; type =
"SW";
break;
256 case 3:
case -3: divisor = 65536.0 / 5; type =
"UW";
break;
257 case 4:
case -4: divisor = 65536.0 / 10; type =
"UW";
break;
258 case 2:
case -2:
default:
259 divisor = 32768.0 / 10; type =
"SW";
break;
261 map[
"@AN[" + to_string(input_num + 1) +
"]"] =
Source(
byte, type, -1,
"V",
"Analog input " + to_string(input_num), divisor);
265 void GalilPrivate::dq_analog(
int byte,
int input_num)
271 string command =
"MG{Z10.0}_DQ" + to_string(input_num);
276 case 3: divisor = 32768.0 / 5; type =
"SW";
break;
277 case 1: divisor = 65536.0 / 5; type =
"UW";
break;
278 case 2: divisor = 65536.0 / 10; type =
"UW";
break;
280 divisor = 32768.0 / 10; type =
"SW";
break;
282 map[
"@AO[" + to_string(input_num + 1) +
"]"] =
Source(
byte, type, -1,
"V",
"Analog output " + to_string(input_num), divisor);
286 void GalilPrivate::Init4000(
int axes)
290 map[
"TIME"] =
Source(4,
"UW", -1,
"samples",
"Sample counter");
293 map[
"_TI0"] =
Source(6,
"UB", -1,
"",
"Digital inputs 1 to 8");
296 map[
"_TI1"] =
Source(7,
"UB", -1,
"",
"Digital inputs 9 to 16");
301 map[
"_OP0"] =
Source(16,
"UW", -1,
"",
"Digital outputs 1 to 16");
311 map[
"_TI2"] =
Source(8,
"UB", -1,
"",
"Digital inputs 17 to 24");
312 map[
"_TI3"] =
Source(9,
"UB", -1,
"",
"Digital inputs 25 to 32");
313 map[
"_TI4"] =
Source(10,
"UB", -1,
"",
"Digital inputs 33 to 40");
314 map[
"_TI5"] =
Source(11,
"UB", -1,
"",
"Digital inputs 41 to 48");
316 map[
"_OP1"] =
Source(18,
"UW", -1,
"",
"Digital outputs 17 to 32");
317 map[
"_OP2"] =
Source(20,
"UW", -1,
"",
"Digital outputs 33 to 48");
341 map[
"_IHA2"] =
Source(42,
"UB", -1,
"",
"Handle A Ethernet status");
342 map[
"_IHB2"] =
Source(43,
"UB", -1,
"",
"Handle B Ethernet status");
343 map[
"_IHC2"] =
Source(44,
"UB", -1,
"",
"Handle C Ethernet status");
344 map[
"_IHD2"] =
Source(45,
"UB", -1,
"",
"Handle D Ethernet status");
345 map[
"_IHE2"] =
Source(46,
"UB", -1,
"",
"Handle E Ethernet status");
346 map[
"_IHF2"] =
Source(47,
"UB", -1,
"",
"Handle F Ethernet status");
347 map[
"_IHG2"] =
Source(48,
"UB", -1,
"",
"Handle G Ethernet status");
348 map[
"_IHH2"] =
Source(49,
"UB", -1,
"",
"Handle H Ethernet status");
350 map[
"_TC"] =
Source(50,
"UB", -1,
"",
"Error code");
353 map[
"NO0"] =
Source(51,
"UB", 0,
"Boolean",
"Thread 0 running");
354 map[
"NO1"] =
Source(51,
"UB", 1,
"Boolean",
"Thread 1 running");
355 map[
"NO2"] =
Source(51,
"UB", 2,
"Boolean",
"Thread 2 running");
356 map[
"NO3"] =
Source(51,
"UB", 3,
"Boolean",
"Thread 3 running");
357 map[
"NO4"] =
Source(51,
"UB", 4,
"Boolean",
"Thread 4 running");
358 map[
"NO5"] =
Source(51,
"UB", 5,
"Boolean",
"Thread 5 running");
359 map[
"NO6"] =
Source(51,
"UB", 6,
"Boolean",
"Thread 6 running");
360 map[
"NO7"] =
Source(51,
"UB", 7,
"Boolean",
"Thread 7 running");
363 map[
"TA00"] =
Source(52,
"UB", 0,
"Boolean",
"Axis A-D over current");
364 map[
"TA01"] =
Source(52,
"UB", 1,
"Boolean",
"Axis A-D over voltage");
365 map[
"TA02"] =
Source(52,
"UB", 2,
"Boolean",
"Axis A-D over temperature");
366 map[
"TA03"] =
Source(52,
"UB", 3,
"Boolean",
"Axis A-D under voltage");
367 map[
"TA04"] =
Source(52,
"UB", 4,
"Boolean",
"Axis E-H over current");
368 map[
"TA05"] =
Source(52,
"UB", 5,
"Boolean",
"Axis E-H over voltage");
369 map[
"TA06"] =
Source(52,
"UB", 6,
"Boolean",
"Axis E-H over temperature");
370 map[
"TA07"] =
Source(52,
"UB", 7,
"Boolean",
"Axis E-H under voltage");
372 map[
"TA1A"] =
Source(53,
"UB", 0,
"Boolean",
"Axis A hall error");
373 map[
"TA1B"] =
Source(53,
"UB", 1,
"Boolean",
"Axis B hall error");
374 map[
"TA1C"] =
Source(53,
"UB", 2,
"Boolean",
"Axis C hall error");
375 map[
"TA1D"] =
Source(53,
"UB", 3,
"Boolean",
"Axis D hall error");
376 map[
"TA1E"] =
Source(53,
"UB", 4,
"Boolean",
"Axis E hall error");
377 map[
"TA1F"] =
Source(53,
"UB", 5,
"Boolean",
"Axis F hall error");
378 map[
"TA1G"] =
Source(53,
"UB", 6,
"Boolean",
"Axis G hall error");
379 map[
"TA1H"] =
Source(53,
"UB", 7,
"Boolean",
"Axis H hall error");
381 map[
"TA2A"] =
Source(54,
"UB", 0,
"Boolean",
"Axis A at _TKA peak current");
382 map[
"TA2B"] =
Source(54,
"UB", 1,
"Boolean",
"Axis B at _TKB peak current");
383 map[
"TA2C"] =
Source(54,
"UB", 2,
"Boolean",
"Axis C at _TVC peak current");
384 map[
"TA2D"] =
Source(54,
"UB", 3,
"Boolean",
"Axis D at _TKD peak current");
385 map[
"TA2E"] =
Source(54,
"UB", 4,
"Boolean",
"Axis E at _TKE peak current");
386 map[
"TA2F"] =
Source(54,
"UB", 5,
"Boolean",
"Axis F at _TKF peak current");
387 map[
"TA2G"] =
Source(54,
"UB", 6,
"Boolean",
"Axis G at _TKG peak current");
388 map[
"TA2H"] =
Source(54,
"UB", 7,
"Boolean",
"Axis H at _TKH peak current");
390 map[
"TA3AD"] =
Source(55,
"UB", 0,
"Boolean",
"Axis A-D ELO active");
391 map[
"TA3EH"] =
Source(55,
"UB", 1,
"Boolean",
"Axis E-H ELO active");
394 map[
"CD"] =
Source(56,
"UL", -1,
"segments",
"Contour segment count");
395 map[
"_CM"] =
Source(60,
"UW", -1,
"elements",
"Contour buffer space");
398 map[
"_CSS"] =
Source(62,
"UW", -1,
"segments",
"Axis S segment count");
399 map[
"VDS"] =
Source(64,
"UB", 3,
"Boolean",
"Axis S final deceleration");
400 map[
"STS"] =
Source(64,
"UB", 4,
"Boolean",
"Axis S stopping");
401 map[
"VSS"] =
Source(64,
"UB", 5,
"Boolean",
"Axis S slewing");
402 map[
"_BGS"] =
Source(65,
"UB", 7,
"Boolean",
"Axis S moving");
403 map[
"_AVS"] =
Source(66,
"SL", -1,
"counts",
"Axis S length");
404 map[
"_LMS"] =
Source(70,
"UW", -1,
"elements",
"Axis S buffer speace");
407 map[
"_CST"] =
Source(72,
"UW", -1,
"segments",
"Axis T segment count");
408 map[
"VDT"] =
Source(74,
"UB", 3,
"Boolean",
"Axis T final deceleration");
409 map[
"STT"] =
Source(74,
"UB", 4,
"Boolean",
"Axis T stopping");
410 map[
"VST"] =
Source(74,
"UB", 5,
"Boolean",
"Axis T slewing");
411 map[
"_BGT"] =
Source(75,
"UB", 7,
"Boolean",
"Axis T moving");
412 map[
"_AVT"] =
Source(76,
"SL", -1,
"counts",
"Axis T length");
413 map[
"_LMT"] =
Source(80,
"UW", -1,
"elements",
"Axis T buffer speace");
417 for (
int i = 0; i < axes; i++)
419 map[ax(
"_MO", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" motor off"));
420 map[ax(
"HM", i,
"3")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" found index"));
421 map[ax(
"_AL", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" latch armed"));
422 map[ax(
"DC", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" began deceleration"));
423 map[ax(
"ST", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" began stop"));
424 map[ax(
"SP", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" began slew"));
425 map[ax(
"CM", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in contour mode"));
426 map[ax(
"JG", i,
"-")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" negative move"));
428 map[ax(
"VM", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" in VM or LI mode"));
429 map[ax(
"HM", i,
"2")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" finding index"));
430 map[ax(
"HM", i,
"1")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" coming off home switch"));
431 map[ax(
"HM", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" home command issued"));
432 map[ax(
"FE", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" find edge issued"));
433 map[ax(
"PA", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" in PA mode"));
434 map[ax(
"PR", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in PA or PR mode"));
435 map[ax(
"_BG", i,
"")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" move in progress"));
437 map[ax(
"MT", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" in stepper mode"));
438 map[ax(
"_HM", i,
"")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" home switch"));
439 map[ax(
"_LR", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" reverse limit switch"));
440 map[ax(
"_LF", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" forward limit switch"));
442 map[ax(
"AL", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch digital input"));
443 map[ax(
"_AL", i,
"=0")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch occurred"));
445 map[ax(
"_SC", i,
"")] =
Source(base,
"UB", -1,
"", ax(
"Axis ", i,
" stop code"));
447 map[ax(
"_RP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" reference position"));
449 map[ax(
"_TP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" encoder position"));
451 map[ax(
"_TE", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" position error"));
453 map[ax(
"_TD", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" dual encoder position"));
455 map[ax(
"_TV", i,
"")] =
Source(base,
"SL", -1,
"counts/s", ax(
"Axis ", i,
" filtered velocity"), 64);
457 map[ax(
"_TT", i,
"")] =
Source(base,
"SL", -1,
"V", ax(
"Axis ", i,
" torque (DAC)"), 3255);
461 aq_analog(base, i + 1);
464 map[ax(
"_QH", i,
"")] =
Source(base,
"UB", -1,
"", ax(
"Axis ", i,
" hall sensors"));
467 map[ax(
"_ZA", i,
"")] =
Source(base,
"SL", -1,
"", ax(
"Axis ", i,
" user variable"));
473 void GalilPrivate::Init1806(
int axes)
475 map[
"TIME"] =
Source(0,
"UW", -1,
"samples",
"Sample counter");
478 map[
"_TI0"] =
Source(2,
"UB", -1,
"",
"Digital inputs 1 to 8");
481 map[
"_TI1"] =
Source(3,
"UB", -1,
"",
"Digital inputs 9 to 16");
487 map[
"_OP0"] =
Source(12,
"UW", -1,
"",
"Digital outputs 1 to 16");
498 map[
"_TI2"] =
Source(4,
"UB", -1,
"",
"Digital inputs 17 to 24");
499 map[
"_TI3"] =
Source(5,
"UB", -1,
"",
"Digital inputs 25 to 32");
500 map[
"_TI4"] =
Source(6,
"UB", -1,
"",
"Digital inputs 33 to 40");
501 map[
"_TI5"] =
Source(7,
"UB", -1,
"",
"Digital inputs 41 to 48");
502 map[
"_TI6"] =
Source(8,
"UB", -1,
"",
"Digital inputs 49 to 56");
503 map[
"_TI7"] =
Source(9,
"UB", -1,
"",
"Digital inputs 57 to 64");
504 map[
"_TI8"] =
Source(10,
"UB", -1,
"",
"Digital inputs 65 to 72");
505 map[
"_TI9"] =
Source(11,
"UB", -1,
"",
"Digital inputs 73 to 80");
507 map[
"_OP1"] =
Source(14,
"UW", -1,
"",
"Digital outputs 17 to 32");
508 map[
"_OP2"] =
Source(16,
"UW", -1,
"",
"Digital outputs 33 to 48");
509 map[
"_OP3"] =
Source(18,
"UW", -1,
"",
"Digital outputs 49 to 64");
510 map[
"_OP4"] =
Source(20,
"UW", -1,
"",
"Digital outputs 65 to 80");
553 map[
"_TC"] =
Source(46,
"UB", -1,
"",
"Error code");
556 map[
"NO0"] =
Source(47,
"UB", 0,
"Boolean",
"Thread 0 running");
557 map[
"NO1"] =
Source(47,
"UB", 1,
"Boolean",
"Thread 1 running");
558 map[
"NO2"] =
Source(47,
"UB", 2,
"Boolean",
"Thread 2 running");
559 map[
"NO3"] =
Source(47,
"UB", 3,
"Boolean",
"Thread 3 running");
560 map[
"NO4"] =
Source(47,
"UB", 4,
"Boolean",
"Thread 4 running");
561 map[
"NO5"] =
Source(47,
"UB", 5,
"Boolean",
"Thread 5 running");
562 map[
"NO6"] =
Source(47,
"UB", 6,
"Boolean",
"Thread 6 running");
563 map[
"NO7"] =
Source(47,
"UB", 7,
"Boolean",
"Thread 7 running");
566 map[
"CD"] =
Source(52,
"UL", -1,
"segments",
"Contour segment count");
567 map[
"_CM"] =
Source(56,
"UW", -1,
"elements",
"Contour buffer space");
570 map[
"_CSS"] =
Source(58,
"UW", -1,
"segments",
"Axis S segment count");
571 map[
"VDS"] =
Source(60,
"UB", 3,
"Boolean",
"Axis S final deceleration");
572 map[
"STS"] =
Source(60,
"UB", 4,
"Boolean",
"Axis S stopping");
573 map[
"VSS"] =
Source(60,
"UB", 5,
"Boolean",
"Axis S slewing");
574 map[
"_BGS"] =
Source(61,
"UB", 7,
"Boolean",
"Axis S moving");
575 map[
"_AVS"] =
Source(62,
"SL", -1,
"counts",
"Axis S length");
576 map[
"_LMS"] =
Source(66,
"UW", -1,
"elements",
"Axis S buffer speace");
579 map[
"_CST"] =
Source(68,
"UW", -1,
"segments",
"Axis T segment count");
580 map[
"VDT"] =
Source(70,
"UB", 3,
"Boolean",
"Axis T final deceleration");
581 map[
"STT"] =
Source(70,
"UB", 4,
"Boolean",
"Axis T stopping");
582 map[
"VST"] =
Source(70,
"UB", 5,
"Boolean",
"Axis T slewing");
583 map[
"_BGT"] =
Source(71,
"UB", 7,
"Boolean",
"Axis T moving");
584 map[
"_AVT"] =
Source(72,
"SL", -1,
"counts",
"Axis T length");
585 map[
"_LMT"] =
Source(76,
"UW", -1,
"elements",
"Axis T buffer speace");
589 for (
int i = 0; i < axes; i++)
591 map[ax(
"_MO", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" motor off"));
592 map[ax(
"HM", i,
"3")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" found index"));
593 map[ax(
"_AL", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" latch armed"));
594 map[ax(
"DC", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" began deceleration"));
595 map[ax(
"ST", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" began stop"));
596 map[ax(
"SP", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" began slew"));
597 map[ax(
"CM", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in contour mode"));
598 map[ax(
"JG", i,
"-")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" negative move"));
600 map[ax(
"VM", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" in VM or LI mode"));
601 map[ax(
"HM", i,
"2")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" finding index"));
602 map[ax(
"HM", i,
"1")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" coming off home switch"));
603 map[ax(
"HM", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" home command issued"));
604 map[ax(
"FE", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" find edge issued"));
605 map[ax(
"PA", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" in PA mode"));
606 map[ax(
"PR", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in PA or PR mode"));
607 map[ax(
"_BG", i,
"")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" move in progress"));
609 map[ax(
"MT", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" in stepper mode"));
610 map[ax(
"_HM", i,
"")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" home switch"));
611 map[ax(
"_LR", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" reverse limit switch"));
612 map[ax(
"_LF", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" forward limit switch"));
614 map[ax(
"AL", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch digital input"));
615 map[ax(
"_AL", i,
"=0")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch occurred"));
617 map[ax(
"_SC", i,
"")] =
Source(base,
"UB", -1,
"", ax(
"Axis ", i,
" stop code"));
619 map[ax(
"_RP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" reference position"));
621 map[ax(
"_TP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" encoder position"));
623 map[ax(
"_TE", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" position error"));
625 map[ax(
"_TD", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" dual encoder position"));
627 map[ax(
"_TV", i,
"")] =
Source(base,
"SL", -1,
"counts/s", ax(
"Axis ", i,
" filtered velocity"), 64);
629 map[ax(
"_TT", i,
"")] =
Source(base,
"SL", -1,
"V", ax(
"Axis ", i,
" torque (DAC)"), 3255);
632 map[
"@AN[" + to_string(i + 1) +
"]"] =
Source(base,
"SW", -1,
"V",
"Analog input " + to_string(i + 1), 3276.8);
637 map[ax(
"_ZA", i,
"")] =
Source(base,
"SL", -1,
"", ax(
"Axis ", i,
" user variable"));
642 void GalilPrivate::Init1800(
int axes,
bool dmc1802)
645 map[
"TIME"] =
Source(0,
"UW", -1,
"samples",
"Sample counter");
648 map[
"_TI0"] =
Source(2,
"UB", -1,
"",
"Digital inputs 1 to 8");
651 map[
"_TI1"] =
Source(3,
"UB", -1,
"",
"Digital inputs 9 to 16");
656 map[
"_OP0"] =
Source(12,
"UW", -1,
"",
"Digital outputs 1 to 16");
665 map[
"_TI2"] =
Source(4,
"UB", -1,
"",
"Digital inputs 17 to 24");
666 map[
"_TI3"] =
Source(5,
"UB", -1,
"",
"Digital inputs 25 to 32");
667 map[
"_TI4"] =
Source(6,
"UB", -1,
"",
"Digital inputs 33 to 40");
668 map[
"_TI5"] =
Source(7,
"UB", -1,
"",
"Digital inputs 41 to 48");
669 map[
"_TI6"] =
Source(8,
"UB", -1,
"",
"Digital inputs 49 to 56");
670 map[
"_TI7"] =
Source(9,
"UB", -1,
"",
"Digital inputs 57 to 64");
671 map[
"_TI8"] =
Source(10,
"UB", -1,
"",
"Digital inputs 65 to 72");
672 map[
"_TI9"] =
Source(11,
"UB", -1,
"",
"Digital inputs 73 to 80");
674 map[
"_OP1"] =
Source(14,
"UW", -1,
"",
"Digital outputs 17 to 32");
675 map[
"_OP2"] =
Source(16,
"UW", -1,
"",
"Digital outputs 33 to 48");
676 map[
"_OP3"] =
Source(18,
"UW", -1,
"",
"Digital outputs 49 to 64");
677 map[
"_OP4"] =
Source(20,
"UW", -1,
"",
"Digital outputs 65 to 80");
720 map[
"_TC"] =
Source(22,
"UB", -1,
"",
"Error code");
723 map[
"_EO"] =
Source(23,
"UB", 0,
"Boolean",
"Echo on");
724 map[
"TR"] =
Source(23,
"UB", 1,
"Boolean",
"Trace on");
725 map[
"IN"] =
Source(23,
"UB", 2,
"Boolean",
"IN waiting for user input");
726 map[
"XQ"] =
Source(23,
"UB", 7,
"Boolean",
"Program running");
729 map[
"_CSS"] =
Source(24,
"UW", -1,
"segments",
"Axis S segment count");
730 map[
"VDS"] =
Source(26,
"UB", 3,
"Boolean",
"Axis S final deceleration");
731 map[
"STS"] =
Source(26,
"UB", 4,
"Boolean",
"Axis S stopping");
732 map[
"VSS"] =
Source(26,
"UB", 5,
"Boolean",
"Axis S slewing");
733 map[
"_BGS"] =
Source(27,
"UB", 7,
"Boolean",
"Axis S moving");
734 map[
"_AVS"] =
Source(28,
"SL", -1,
"counts",
"Axis S length");
737 map[
"_CST"] =
Source(32,
"UW", -1,
"segments",
"Axis T segment count");
738 map[
"VDT"] =
Source(34,
"UB", 3,
"Boolean",
"Axis T final deceleration");
739 map[
"STT"] =
Source(34,
"UB", 4,
"Boolean",
"Axis T stopping");
740 map[
"VST"] =
Source(34,
"UB", 5,
"Boolean",
"Axis T slewing");
741 map[
"_BGT"] =
Source(35,
"UB", 7,
"Boolean",
"Axis T moving");
742 map[
"_AVT"] =
Source(36,
"SL", -1,
"counts",
"Axis T length");
746 for (
int i = 0; i < axes; i++)
748 map[ax(
"_MO", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" motor off"));
749 map[ax(
"_OE", i,
"")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" off-on-error set"));
750 map[ax(
"_AL", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" latch armed"));
751 map[ax(
"DC", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" began deceleration"));
752 map[ax(
"ST", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" began stop"));
753 map[ax(
"SP", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" began slew"));
754 map[ax(
"CM", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in contour mode"));
755 map[ax(
"JG", i,
"-")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" negative move"));
757 map[ax(
"VM", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" in VM or LI mode"));
758 map[ax(
"HM", i,
"2")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" finding index"));
759 map[ax(
"HM", i,
"1")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" coming off home switch"));
760 map[ax(
"HM", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" home command issued"));
761 map[ax(
"FE", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" find edge issued"));
762 map[ax(
"PA", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" in PA mode"));
763 map[ax(
"PR", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in PA or PR mode"));
764 map[ax(
"_BG", i,
"")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" move in progress"));
766 map[ax(
"SM", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" stepper jumper installed"));
767 map[ax(
"_HM", i,
"")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" home switch"));
768 map[ax(
"_LR", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" reverse limit switch"));
769 map[ax(
"_LF", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" forward limit switch"));
771 map[ax(
"AL", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch digital input"));
772 map[ax(
"_AL", i,
"=0")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch occurred"));
774 map[ax(
"_SC", i,
"")] =
Source(base,
"UB", -1,
"", ax(
"Axis ", i,
" stop code"));
776 map[ax(
"_RP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" reference position"));
778 map[ax(
"_TP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" encoder position"));
780 map[ax(
"_TE", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" position error"));
782 map[ax(
"_TD", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" dual encoder position"));
784 map[ax(
"_TV", i,
"")] =
Source(base,
"SL", -1,
"counts/s", ax(
"Axis ", i,
" filtered velocity"), 64);
786 map[ax(
"_TT", i,
"")] =
Source(base,
"SW", -1,
"V", ax(
"Axis ", i,
" torque (DAC)"), 3255);
790 map[
"@AN[" + to_string(i + 1) +
"]"] =
Source(base,
"SW", -1,
"V",
"Analog input " + to_string(i + 1), 3276.8);
797 void GalilPrivate::Init30010(
bool dmc31010)
801 map[
"TIME"] =
Source(4,
"UW", -1,
"samples",
"Sample counter");
803 map[
"@IN[1]"] =
Source(6,
"UB", 0,
"Boolean",
"Digital input 1");
804 map[
"@IN[2]"] =
Source(6,
"UB", 1,
"Boolean",
"Digital input 2");
805 map[
"@IN[3]"] =
Source(6,
"UB", 2,
"Boolean",
"Digital input 3");
806 map[
"@IN[4]"] =
Source(6,
"UB", 3,
"Boolean",
"Digital input 4");
807 map[
"@IN[5]"] =
Source(6,
"UB", 4,
"Boolean",
"Digital input 5");
808 map[
"@IN[6]"] =
Source(6,
"UB", 5,
"Boolean",
"Digital input 6");
809 map[
"@IN[7]"] =
Source(6,
"UB", 6,
"Boolean",
"Digital input 7");
810 map[
"@IN[8]"] =
Source(6,
"UB", 7,
"Boolean",
"Digital input 8");
812 map[
"@OUT[1]"] =
Source(8,
"UB", 0,
"Boolean",
"Digital output 1");
813 map[
"@OUT[2]"] =
Source(8,
"UB", 1,
"Boolean",
"Digital output 2");
814 map[
"@OUT[3]"] =
Source(8,
"UB", 2,
"Boolean",
"Digital output 3");
815 map[
"@OUT[4]"] =
Source(8,
"UB", 3,
"Boolean",
"Digital output 4");
817 map[
"_TC"] =
Source(10,
"UB", -1,
"",
"Error code");
820 map[
"NO0"] =
Source(11,
"UB", 0,
"Boolean",
"Thread 0 running");
821 map[
"NO1"] =
Source(11,
"UB", 1,
"Boolean",
"Thread 1 running");
822 map[
"NO2"] =
Source(11,
"UB", 2,
"Boolean",
"Thread 2 running");
823 map[
"NO3"] =
Source(11,
"UB", 3,
"Boolean",
"Thread 3 running");
824 map[
"NO4"] =
Source(11,
"UB", 4,
"Boolean",
"Thread 4 running");
825 map[
"NO5"] =
Source(11,
"UB", 5,
"Boolean",
"Thread 5 running");
832 map[
"@AN[2]"] =
Source(12,
"UW", -1,
"V",
"Analog input 2", 13107.2);
834 map[
"@AO[1]"] =
Source(14,
"SW", -1,
"V",
"Analog output 1", 3276.8);
835 map[
"@AO[2]"] =
Source(16,
"SW", -1,
"V",
"Analog output 2", 3276.8);
838 map[
"TA00"] =
Source(18,
"UB", 0,
"Boolean",
"Axis A over current");
839 map[
"TA01"] =
Source(18,
"UB", 1,
"Boolean",
"Axis A over voltage");
840 map[
"TA02"] =
Source(18,
"UB", 2,
"Boolean",
"Axis A over temperature");
841 map[
"TA03"] =
Source(18,
"UB", 3,
"Boolean",
"Axis A under voltage");
842 map[
"TA1A"] =
Source(19,
"UB", 0,
"Boolean",
"Axis A hall error");
843 map[
"TA2A"] =
Source(20,
"UB", 0,
"Boolean",
"Axis A at _TKA peak current");
844 map[
"TA3AD"] =
Source(21,
"UB", 0,
"Boolean",
"Axis A ELO active");
847 map[
"CD"] =
Source(22,
"UL", -1,
"segments",
"Contour segment count");
848 map[
"_CM"] =
Source(26,
"UW", -1,
"elements",
"Contour buffer space");
851 map[
"_CSS"] =
Source(28,
"UW", -1,
"segments",
"Axis S segment count");
852 map[
"VDS"] =
Source(30,
"UB", 3,
"Boolean",
"Axis S final deceleration");
853 map[
"STS"] =
Source(30,
"UB", 4,
"Boolean",
"Axis S stopping");
854 map[
"VSS"] =
Source(30,
"UB", 5,
"Boolean",
"Axis S slewing");
855 map[
"_BGS"] =
Source(31,
"UB", 7,
"Boolean",
"Axis S moving");
856 map[
"_AVS"] =
Source(32,
"SL", -1,
"counts",
"Axis S length");
857 map[
"_LMS"] =
Source(36,
"UW", -1,
"elements",
"Axis S buffer speace");
863 map[ax(
"_MO", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" motor off"));
864 map[ax(
"HM", i,
"3")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" found index"));
865 map[ax(
"_AL", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" latch armed"));
866 map[ax(
"DC", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" began deceleration"));
867 map[ax(
"ST", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" began stop"));
868 map[ax(
"SP", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" began slew"));
869 map[ax(
"CM", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in contour mode"));
870 map[ax(
"JG", i,
"-")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" negative move"));
872 map[ax(
"VM", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" in VM or LI mode"));
873 map[ax(
"HM", i,
"2")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" finding index"));
874 map[ax(
"HM", i,
"1")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" coming off home switch"));
875 map[ax(
"HM", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" home command issued"));
876 map[ax(
"FE", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" find edge issued"));
877 map[ax(
"PA", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" in PA mode"));
878 map[ax(
"PR", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in PA or PR mode"));
879 map[ax(
"_BG", i,
"")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" move in progress"));
881 map[ax(
"MT", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" in stepper mode"));
882 map[ax(
"_HM", i,
"")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" home switch"));
883 map[ax(
"_LR", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" reverse limit switch"));
884 map[ax(
"_LF", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" forward limit switch"));
886 map[ax(
"AL", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch digital input"));
887 map[ax(
"_AL", i,
"=0")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch occurred"));
889 map[ax(
"_SC", i,
"")] =
Source(base,
"UB", -1,
"", ax(
"Axis ", i,
" stop code"));
891 map[ax(
"_RP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" reference position"));
893 map[ax(
"_TP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" encoder position"));
895 map[ax(
"_TE", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" position error"));
897 map[ax(
"_TD", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" dual encoder position"));
899 map[ax(
"_TV", i,
"")] =
Source(base,
"SL", -1,
"counts/s", ax(
"Axis ", i,
" filtered velocity"), 64);
901 map[ax(
"_TT", i,
"")] =
Source(base,
"SL", -1,
"V", ax(
"Axis ", i,
" torque (DAC)"), 3255);
906 aq_analog(base, i + 1);
908 map[
"@AN[" + to_string(i + 1) +
"]"] =
Source(base,
"UW", -1,
"V",
"Analog input " + to_string(i + 1), 13107.2);
912 map[ax(
"_QH", i,
"")] =
Source(base,
"UB", -1,
"", ax(
"Axis ", i,
" hall sensors"));
915 map[ax(
"_ZA", i,
"")] =
Source(base,
"SL", -1,
"", ax(
"Axis ", i,
" user variable"));
920 void GalilPrivate::Init2103(
int axes)
927 map[
"TIME"] =
Source(4,
"UW", -1,
"samples",
"Sample counter");
930 map[
"_TI0"] =
Source(6,
"UB", -1,
"",
"Digital inputs 1 to 8");
933 map[
"_TI1"] =
Source(7,
"UB", -1,
"",
"Digital inputs 9 to 16");
938 map[
"_OP0"] =
Source(16,
"UW", -1,
"",
"Digital outputs 1 to 16");
948 map[
"_TI2"] =
Source(8,
"UB", -1,
"",
"Digital inputs 17 to 24");
949 map[
"_TI3"] =
Source(9,
"UB", -1,
"",
"Digital inputs 25 to 32");
950 map[
"_TI4"] =
Source(10,
"UB", -1,
"",
"Digital inputs 33 to 40");
951 map[
"_TI5"] =
Source(11,
"UB", -1,
"",
"Digital inputs 41 to 48");
952 map[
"_TI6"] =
Source(12,
"UB", -1,
"",
"Digital inputs 49 to 56");
954 map[
"_OP1"] =
Source(18,
"UW", -1,
"",
"Digital outputs 17 to 32");
955 map[
"_OP2"] =
Source(20,
"UW", -1,
"",
"Digital outputs 33 to 48");
956 map[
"_OP3"] =
Source(22,
"UW", -1,
"",
"Digital outputs 49 to 64");
984 map[
"_TC"] =
Source(26,
"UB", -1,
"",
"Error code");
987 map[
"_EO"] =
Source(27,
"UB", 0,
"Boolean",
"Echo on");
988 map[
"TR"] =
Source(27,
"UB", 1,
"Boolean",
"Trace on");
989 map[
"IN"] =
Source(27,
"UB", 2,
"Boolean",
"IN waiting for user input");
990 map[
"XQ"] =
Source(27,
"UB", 7,
"Boolean",
"Program running");
993 map[
"_CSS"] =
Source(28,
"UW", -1,
"segments",
"Axis S segment count");
994 map[
"VDS"] =
Source(30,
"UB", 3,
"Boolean",
"Axis S final deceleration");
995 map[
"STS"] =
Source(30,
"UB", 4,
"Boolean",
"Axis S stopping");
996 map[
"VSS"] =
Source(30,
"UB", 5,
"Boolean",
"Axis S slewing");
997 map[
"_BGS"] =
Source(31,
"UB", 7,
"Boolean",
"Axis S moving");
998 map[
"_AVS"] =
Source(32,
"SL", -1,
"counts",
"Axis S length");
1001 map[
"_CST"] =
Source(36,
"UW", -1,
"segments",
"Axis T segment count");
1002 map[
"VDT"] =
Source(38,
"UB", 3,
"Boolean",
"Axis T final deceleration");
1003 map[
"STT"] =
Source(38,
"UB", 4,
"Boolean",
"Axis T stopping");
1004 map[
"VST"] =
Source(38,
"UB", 5,
"Boolean",
"Axis T slewing");
1005 map[
"_BGT"] =
Source(39,
"UB", 7,
"Boolean",
"Axis T moving");
1006 map[
"_AVT"] =
Source(40,
"SL", -1,
"counts",
"Axis T length");
1010 for (
int i = 0; i < axes; i++)
1012 map[ax(
"_MO", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" motor off"));
1013 map[ax(
"_OE", i,
"")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" off-on-error set"));
1014 map[ax(
"_AL", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" latch armed"));
1015 map[ax(
"DC", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" began deceleration"));
1016 map[ax(
"ST", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" began stop"));
1017 map[ax(
"SP", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" began slew"));
1018 map[ax(
"CM", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in contour mode"));
1019 map[ax(
"JG", i,
"-")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" negative move"));
1021 map[ax(
"VM", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" in VM or LI mode"));
1022 map[ax(
"HM", i,
"2")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" finding index"));
1023 map[ax(
"HM", i,
"1")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" coming off home switch"));
1024 map[ax(
"HM", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" home command issued"));
1025 map[ax(
"FE", i,
"")] =
Source(base,
"UW", 4,
"Boolean", ax(
"Axis ", i,
" find edge issued"));
1026 map[ax(
"PA", i,
"")] =
Source(base,
"UW", 5,
"Boolean", ax(
"Axis ", i,
" in PA mode"));
1027 map[ax(
"PR", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" in PA or PR mode"));
1028 map[ax(
"_BG", i,
"")] =
Source(base,
"UW", 7,
"Boolean", ax(
"Axis ", i,
" move in progress"));
1030 map[ax(
"SM", i,
"")] =
Source(base,
"UW", 0,
"Boolean", ax(
"Axis ", i,
" stepper jumper installed"));
1031 map[ax(
"_HM", i,
"")] =
Source(base,
"UW", 1,
"Boolean", ax(
"Axis ", i,
" home switch"));
1032 map[ax(
"_LR", i,
"")] =
Source(base,
"UW", 2,
"Boolean", ax(
"Axis ", i,
" reverse limit switch"));
1033 map[ax(
"_LF", i,
"")] =
Source(base,
"UW", 3,
"Boolean", ax(
"Axis ", i,
" forward limit switch"));
1035 map[ax(
"AL", i,
"")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch digital input"));
1036 map[ax(
"_AL", i,
"=0")] =
Source(base,
"UW", 6,
"Boolean", ax(
"Axis ", i,
" latch occurred"));
1038 map[ax(
"_SC", i,
"")] =
Source(base,
"UB", -1,
"", ax(
"Axis ", i,
" stop code"));
1040 map[ax(
"_RP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" reference position"));
1042 map[ax(
"_TP", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" encoder position"));
1044 map[ax(
"_TE", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" position error"));
1046 map[ax(
"_TD", i,
"")] =
Source(base,
"SL", -1,
"counts", ax(
"Axis ", i,
" dual encoder position"));
1048 map[ax(
"_TV", i,
"")] =
Source(base,
"SL", -1,
"counts/s", ax(
"Axis ", i,
" filtered velocity"), 64);
1050 map[ax(
"_TT", i,
"")] =
Source(base,
"SW", -1,
"V", ax(
"Axis ", i,
" torque (DAC)"), 3255);
1055 aq_analog(base, i + 1);
1061 void GalilPrivate::InitRio(
bool rio3)
1067 map[
"TIME"] =
Source(4,
"UW", -1,
"samples",
"Sample counter");
1068 map[
"_TC"] =
Source(6,
"UB", -1,
"",
"Error code");
1071 map[
"_EO"] =
Source(7,
"UB", 0,
"Boolean",
"Echo on");
1072 map[
"TR"] =
Source(7,
"UB", 1,
"Boolean",
"Trace on");
1073 map[
"IN"] =
Source(7,
"UB", 2,
"Boolean",
"IN waiting for user input");
1074 map[
"XQ"] =
Source(7,
"UB", 7,
"Boolean",
"Program running");
1076 bool aqdq = (q->command(
"ID").find(
"(AQ)") != string::npos);
1091 map[
"@AO[0]"] =
Source(8,
"UW", -1,
"V",
"Analog output 0", 13107.2, 0);
1092 map[
"@AO[1]"] =
Source(10,
"UW", -1,
"V",
"Analog output 1", 13107.2, 0);
1093 map[
"@AO[2]"] =
Source(12,
"UW", -1,
"V",
"Analog output 2", 13107.2, 0);
1094 map[
"@AO[3]"] =
Source(14,
"UW", -1,
"V",
"Analog output 3", 13107.2, 0);
1095 map[
"@AO[4]"] =
Source(16,
"UW", -1,
"V",
"Analog output 4", 13107.2, 0);
1096 map[
"@AO[5]"] =
Source(18,
"UW", -1,
"V",
"Analog output 5", 13107.2, 0);
1097 map[
"@AO[6]"] =
Source(20,
"UW", -1,
"V",
"Analog output 6", 13107.2, 0);
1098 map[
"@AO[7]"] =
Source(22,
"UW", -1,
"V",
"Analog output 7", 13107.2, 0);
1115 map[
"@AN[0]"] =
Source(24,
"UW", -1,
"V",
"Analog input 0", 13107.2, 0);
1116 map[
"@AN[1]"] =
Source(26,
"UW", -1,
"V",
"Analog input 1", 13107.2, 0);
1117 map[
"@AN[2]"] =
Source(28,
"UW", -1,
"V",
"Analog input 2", 13107.2, 0);
1118 map[
"@AN[3]"] =
Source(30,
"UW", -1,
"V",
"Analog input 3", 13107.2, 0);
1119 map[
"@AN[4]"] =
Source(32,
"UW", -1,
"V",
"Analog input 4", 13107.2, 0);
1120 map[
"@AN[5]"] =
Source(34,
"UW", -1,
"V",
"Analog input 5", 13107.2, 0);
1121 map[
"@AN[6]"] =
Source(36,
"UW", -1,
"V",
"Analog input 6", 13107.2, 0);
1122 map[
"@AN[7]"] =
Source(38,
"UW", -1,
"V",
"Analog input 7", 13107.2, 0);
1129 map[
"_OP0"] =
Source(base,
"UB", -1,
"",
"Digital ouputs 0-7");
1130 output_bits(base, 0);
1133 map[
"_OP1"] =
Source(base,
"UB", -1,
"",
"Digital outputs 8-15");
1134 output_bits(base, 8);
1139 map[
"_OP2"] =
Source(base,
"UB", -1,
"",
"Digital outputs 16-23");
1140 output_bits(base, 16);
1146 map[
"_TI0"] =
Source(base,
"UB", -1,
"",
"Digital inputs 0-7");
1147 input_bits(base, 0);
1150 map[
"_TI1"] =
Source(base,
"UB", -1,
"",
"Digital inputs 8-15");
1151 input_bits(base, 8);
1156 map[
"_TI2"] =
Source(base,
"UB", -1,
"",
"Digital inputs 16-23");
1157 input_bits(base, 16);
1163 map[
"_PC"] =
Source(base,
"UL", -1,
"edges",
"Pulse counter");
1167 map[
"_ZC"] =
Source(base,
"SL", -1,
"",
"1st user variable");
1169 map[
"_ZD"] =
Source(base,
"SL", -1,
"",
"2nd user variable");
1173 void GalilPrivate::InitRio3_24Ex()
1176 map[
"_OP3"] =
Source(60,
"UB", -1,
"",
"Digital outputs 24-31");
1177 output_bits(60, 24);
1178 map[
"_OP4"] =
Source(61,
"UB", -1,
"",
"Digital outputs 32-39");
1179 output_bits(61, 32);
1180 map[
"_OP5"] =
Source(62,
"UB", -1,
"",
"Digital outputs 40-47");
1181 output_bits(62, 40);
1184 map[
"_TI3"] =
Source(64,
"UB", -1,
"",
"Digital inputs 24-31");
1186 map[
"_TI4"] =
Source(65,
"UB", -1,
"",
"Digital inputs 32-39");
1188 map[
"_TI5"] =
Source(66,
"UB", -1,
"",
"Digital inputs 40-47");
1193 void GalilPrivate::InitRioSer(
bool rio3)
1196 int base = rio3 ? 60 : 56;
1197 map[
"_QE0"] =
Source(base,
"SL", -1,
"counts",
"encoder position"); base += 4;
1198 map[
"_QE1"] =
Source(base,
"SL", -1,
"counts",
"encoder position"); base += 4;
1199 map[
"_QE2"] =
Source(base,
"SL", -1,
"counts",
"encoder position"); base += 4;
1200 map[
"_QE3"] =
Source(base,
"SL", -1,
"counts",
"encoder position"); base += 4;
GCLIB_DLL_EXPORTED GReturn GCALL GRecord(GCon g, union GDataRecord *record, GOption method)
Provides a fresh copy of the controller's data record. Data is cast into a union, GDataRecord.
GCLIB_DLL_EXPORTED GReturn GCALL GRecordRate(GCon g, double period_ms)
Sets the asynchronous data record to a user-specified period via DR.
GCLIB_DLL_EXPORTED GReturn GCALL GCmdI(GCon g, GCStringIn command, int *value)
Wrapper around GCommand that provides the return value of a command parsed into an int.
GCLIB_DLL_EXPORTED GReturn GCALL GCmd(GCon g, GCStringIn command)
Wrapper around GCommand for use when the return value is not desired.
#define G_DR
Value for GRecord() method variable for acquiring a data record via DR mode.
#define G_NO_ERROR
Return value if function succeeded.
#define G_QR
Value for GRecord() method variable for acquiring a data record via QR mode.
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
Data record union, containing all structs and a generic byte array accessor.
unsigned char byte_array[GALILDATARECORDMAXLENGTH]
Generic byte array for offsets.