author | Edouard Tisserant <edouard.tisserant@gmail.com> |
Tue, 10 Jul 2018 16:49:05 +0200 | |
branch | stable-1.5 |
changeset 2701 | 00a6a77face6 |
parent 2674 | 3be68a020748 |
permissions | -rw-r--r-- |
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
1 |
/***************************************************************************** |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
2 |
* |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
3 |
* Copyright (C) 2006-2017 Florian Pose, Ingenieurgemeinschaft IgH |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
4 |
* |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
5 |
* This file is part of the IgH EtherCAT Master. |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
6 |
* |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
7 |
* The IgH EtherCAT Master is free software; you can redistribute it and/or |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
8 |
* modify it under the terms of the GNU General Public License version 2, as |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
9 |
* published by the Free Software Foundation. |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
10 |
* |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
11 |
* The IgH EtherCAT Master is distributed in the hope that it will be useful, |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
14 |
* Public License for more details. |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
15 |
* |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
16 |
* You should have received a copy of the GNU General Public License along |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
17 |
* with the IgH EtherCAT Master; if not, write to the Free Software |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
18 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
19 |
* |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
20 |
* --- |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
21 |
* |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
22 |
* The license mentioned above concerns the source code only. Using the |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
23 |
* EtherCAT technology and brand is only permitted in compliance with the |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
24 |
* industrial property and similar rights of Beckhoff Automation GmbH. |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
25 |
* |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
26 |
****************************************************************************/ |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
27 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
28 |
#include <iostream> |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
29 |
#include <iomanip> |
2667 | 30 |
#include <algorithm> |
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
31 |
using namespace std; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
32 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
33 |
#include "CommandCrc.h" |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
34 |
#include "MasterDevice.h" |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
35 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
36 |
/*****************************************************************************/ |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
37 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
38 |
CommandCrc::CommandCrc(): |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
39 |
Command("crc", "CRC error register diagnosis.") |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
40 |
{ |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
41 |
} |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
42 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
43 |
/*****************************************************************************/ |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
44 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
45 |
string CommandCrc::helpString(const string &binaryBaseName) const |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
46 |
{ |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
47 |
stringstream str; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
48 |
|
2667 | 49 |
str |
50 |
<< binaryBaseName << " " << getName() << endl |
|
51 |
<< binaryBaseName << " " << getName() << " reset" << endl |
|
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
52 |
<< endl |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
53 |
<< getBriefDescription() << endl |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
54 |
<< endl |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
55 |
<< "CRC - CRC Error Counter 0x300, 0x302, 0x304, 0x306" |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
56 |
<< endl |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
57 |
<< "PHY - Physical Interface Error Counter 0x301, 0x303, 0x305, 0x307" |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
58 |
<< endl |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
59 |
<< "FWD - Forwarded RX Error Counter 0x308, 0x309, 0x30a, 0x30b" |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
60 |
<< endl |
2674
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
61 |
<< "NXT - Next slave" << endl |
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
62 |
<< endl; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
63 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
64 |
return str.str(); |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
65 |
} |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
66 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
67 |
/****************************************************************************/ |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
68 |
|
2667 | 69 |
#define REG_SIZE (20) |
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
70 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
71 |
void CommandCrc::execute(const StringVector &args) |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
72 |
{ |
2667 | 73 |
bool reset = false; |
74 |
||
75 |
if (args.size() > 1) { |
|
76 |
stringstream err; |
|
77 |
err << "'" << getName() << "' takes either no or 'reset' argument!"; |
|
78 |
throwInvalidUsageException(err); |
|
79 |
} |
|
80 |
||
81 |
if (args.size() == 1) { |
|
82 |
string arg = args[0]; |
|
83 |
transform(arg.begin(), arg.end(), |
|
84 |
arg.begin(), (int (*) (int)) std::tolower); |
|
85 |
if (arg != "reset") { |
|
86 |
stringstream err; |
|
87 |
err << "'" << getName() << "' takes either no or 'reset' argument!"; |
|
88 |
throwInvalidUsageException(err); |
|
89 |
} |
|
90 |
||
91 |
reset = true; |
|
92 |
} |
|
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
93 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
94 |
MasterDevice m(getSingleMasterIndex()); |
2667 | 95 |
m.open(reset ? MasterDevice::ReadWrite : MasterDevice::Read); |
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
96 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
97 |
ec_ioctl_master_t master; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
98 |
m.getMaster(&master); |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
99 |
|
2667 | 100 |
uint8_t data[REG_SIZE]; |
101 |
ec_ioctl_slave_reg_t io; |
|
102 |
io.emergency = 0; |
|
103 |
io.address = 0x0300; |
|
104 |
io.size = REG_SIZE; |
|
105 |
io.data = data; |
|
106 |
||
107 |
if (reset) { |
|
108 |
for (int j = 0; j < REG_SIZE; j++) { |
|
109 |
data[j] = 0x00; |
|
110 |
} |
|
111 |
||
112 |
for (unsigned int i = 0; i < master.slave_count; i++) { |
|
113 |
||
114 |
io.slave_position = i; |
|
115 |
try { |
|
116 |
m.writeReg(&io); |
|
117 |
} catch (MasterDeviceException &e) { |
|
118 |
throw e; |
|
119 |
} |
|
120 |
} |
|
121 |
return; |
|
122 |
} |
|
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
123 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
124 |
cout << " |"; |
2672 | 125 |
for (unsigned int port = 0; port < EC_MAX_PORTS; port++) { |
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
126 |
cout << "Port " << port << " |"; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
127 |
} |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
128 |
cout << endl; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
129 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
130 |
cout << " |"; |
2672 | 131 |
for (unsigned int port = 0; port < EC_MAX_PORTS; port++) { |
2674
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
132 |
cout << "CRC PHY FWD NXT|"; |
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
133 |
} |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
134 |
cout << endl; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
135 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
136 |
for (unsigned int i = 0; i < master.slave_count; i++) { |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
137 |
|
2674
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
138 |
ec_ioctl_slave_t slave; |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
139 |
m.getSlave(&slave, i); |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
140 |
|
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
141 |
io.slave_position = i; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
142 |
try { |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
143 |
m.readReg(&io); |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
144 |
} catch (MasterDeviceException &e) { |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
145 |
throw e; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
146 |
} |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
147 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
148 |
cout << setw(3) << i << "|"; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
149 |
for (int port = 0; port < 4; port++) { |
2674
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
150 |
if (slave.ports[port].link.loop_closed) { |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
151 |
cout << " |"; |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
152 |
continue; |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
153 |
} |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
154 |
|
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
155 |
cout << setw(3) << (unsigned int) io.data[ 0 + port * 2]; // CRC |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
156 |
cout << setw(4) << (unsigned int) io.data[ 1 + port * 2]; // PHY |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
157 |
cout << setw(4) << (unsigned int) io.data[ 8 + port]; // FWD |
2674
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
158 |
if (slave.ports[port].next_slave == i - 1) { |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
159 |
cout << " ↑"; |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
160 |
} |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
161 |
else if (slave.ports[port].next_slave == i + 1) { |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
162 |
cout << " ↓"; |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
163 |
} |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
164 |
else if (slave.ports[port].next_slave != 0xffff) { |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
165 |
cout << setw(4) << slave.ports[port].next_slave; |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
166 |
} |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
167 |
else { |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
168 |
cout << " "; |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
169 |
} |
3be68a020748
Clear unused ports; use arrows for next slaves.
Florian Pose <fp@igh-essen.com>
parents:
2672
diff
changeset
|
170 |
|
2666
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
171 |
cout << "|"; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
172 |
} |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
173 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
174 |
std::string slaveName(slave.name); |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
175 |
slaveName = slaveName.substr(0, 11); |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
176 |
cout << slaveName << endl; |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
177 |
} |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
178 |
} |
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
179 |
|
d9e14a0ddbd6
New tool command 'ethercat crc'.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
180 |
/*****************************************************************************/ |