@@ -123,28 +123,28 @@ class Drive {
123123
124124 /* *
125125 * \brief Lists of PDOs
126- *
126+ *
127127 */
128128 std::vector<RPDO *> rpdos;
129129 std::vector<TPDO *> tpdos;
130-
130+
131131 /* *
132132 * \brief Generates the list of commands required to configure TPDOs on the drives
133133 *
134134 * \param items A list of OD_Entry_t items which are to be configured with this TPDO
135135 * \param PDO_Num The number/index of this PDO
136- * \param COB_ID the COB-ID of the PDO
136+ * \param COB_ID the COB-ID of the PDO
137137 * \param SyncRate The rate at which this PDO transmits (e.g. number of Sync Messages. 0xFF represents internal trigger event)
138138 * \param sub_idx The register sub index
139139 * \return std::string
140140 */
141- std::vector<std::string> generateTPDOConfigSDO (std::vector<OD_Entry_t> items, int PDO_Num, int COB_ID, int SyncRate, int sub_idx = 0 );
141+ std::vector<std::string> generateTPDOConfigSDO (std::vector<OD_Entry_t> items, int PDO_Num, int COB_ID, int SyncRate);
142142
143143 /* *
144144 * \brief Creates a RPDO in the Local Object Dictionary for the equivalent TPDO on the drive
145145 *
146146 * \param items A list of OD_Entry_t items which are to be configured with this RPDO
147- * \param COB_ID the COB-ID of the PDO
147+ * \param COB_ID the COB-ID of the PDO
148148 * \param RPDOSyncRate The rate at which the RPDO processes NOTE: This is not the same as for the equivalent TPDO
149149 */
150150 void generateEquivalentMasterRPDO (std::vector<OD_Entry_t> items, int COB_ID, int RPDOSyncRate);
@@ -155,18 +155,18 @@ class Drive {
155155 *
156156 * \param items A list of OD_Entry_t items which are to be configured with this RPDO
157157 * \param PDO_Num The number/index of this PDO
158- * \param COB_ID the COB-ID of the PDO
158+ * \param COB_ID the COB-ID of the PDO
159159 * \param UpdateTiming 0-240 represents hold until next sync message, 0xFF represents immediate update
160160 * \param sub_idx The register sub index
161161 * \return std::string
162162 */
163- std::vector<std::string> generateRPDOConfigSDO (std::vector<OD_Entry_t> items, int PDO_Num, int COB_ID,int UpdateTiming, int sub_idx = 0 );
163+ std::vector<std::string> generateRPDOConfigSDO (std::vector<OD_Entry_t> items, int PDO_Num, int COB_ID,int UpdateTiming);
164164
165165 /* *
166166 * \brief Creates a TPDO in the Local Object Dictionary for the equivalent RPDO on the drive
167167 *
168168 * \param items A list of OD_Entry_t items which are to be configured with this TPDO
169- * \param COB_ID the COB-ID of the PDO
169+ * \param COB_ID the COB-ID of the PDO
170170 * \param RPDOSyncRate The rate at which the TPDO sends messages NOTE: This is not the same as for the equivalent RPDO
171171 */
172172 void generateEquivalentMasterTPDO (std::vector<OD_Entry_t> items, int COB_ID, int TPDOSyncRate);
@@ -239,7 +239,7 @@ class Drive {
239239
240240
241241 /* *
242- * \brief Map between the TPDO Number and their Mapped Objects
242+ * \brief Map between the TPDO Number and their Mapped Objects
243243 *
244244 */
245245 std::map<UNSIGNED8, std::vector<OD_Entry_t>> TPDO_MappedObjects = {
@@ -248,18 +248,18 @@ class Drive {
248248 {3 , {ACTUAL_TOR}},
249249 {4 , {DIGITAL_IN}}};
250250
251- /* *
252- * \brief Map between the RPDO Number and their Mapped Objects
251+ /* *
252+ * \brief Map between the RPDO Number and their Mapped Objects
253253 *
254254 */
255255 std::map<UNSIGNED8, std::vector<OD_Entry_t>> RPDO_MappedObjects = {
256- {1 , {DIGITAL_OUT}},
256+ {1 , {CONTROL_WORD, DIGITAL_OUT}},
257257 {2 , {TARGET_POS}},
258258 {3 , {TARGET_VEL}},
259259 {4 , {TARGET_TOR}}};
260260
261261 /* *
262- * \brief Map between the RPDO Number and their base COB-ID (actualy is base COB-ID + Node_ID)
262+ * \brief Map between the RPDO Number and their base COB-ID (actualy is base COB-ID + Node_ID)
263263 *
264264 * NOTE: This is an arbitrary default mapping unique to CORC. This can be changed in derived classes
265265 */
@@ -270,7 +270,7 @@ class Drive {
270270 {4 , 0x480 }};
271271
272272 /* *
273- * \brief Map between the RPDO Number and their base COB-ID (actualy is base COB-ID + Node_ID)
273+ * \brief Map between the RPDO Number and their base COB-ID (actualy is base COB-ID + Node_ID)
274274 *
275275 * NOTE: This is an arbitrary default mapping unique to CORC. This can be changed in derived classes
276276 */
@@ -299,22 +299,22 @@ class Drive {
299299 {DIGITAL_OUT, 2 }};
300300
301301 /* *
302- * \brief Map between the Commonly-used OD entries and their addresses - used to generate PDO Configurations
302+ * \brief Map between the Commonly-used OD entries and their addresses and sub-index - used to generate PDO Configurations
303303 * NOTE: These are written in hexadecimal. They can be altered in derived classes if required.
304304 *
305305 */
306- std::map<OD_Entry_t, int > OD_Addresses = {
307- {STATUS_WORD, 0x6041 },
308- {ERROR_WORD, 0x2601 },
309- {ACTUAL_POS, 0x6064 },
310- {ACTUAL_VEL, 0x606C },
311- {ACTUAL_TOR, 0x6077 },
312- {CONTROL_WORD, 0x6040 },
313- {TARGET_POS, 0x607A },
314- {TARGET_VEL, 0x60FF },
315- {TARGET_TOR, 0x6071 },
316- {DIGITAL_IN, 0x2010 },
317- {DIGITAL_OUT, 0x2010 }};
306+ std::map<OD_Entry_t, std::array< int , 2 > > OD_Addresses = {
307+ {STATUS_WORD, { 0x6041 , 0x00 } },
308+ {ERROR_WORD, { 0x2601 , 0x00 } },
309+ {ACTUAL_POS, { 0x6064 , 0x00 } },
310+ {ACTUAL_VEL, { 0x606C , 0x00 } },
311+ {ACTUAL_TOR, { 0x6077 , 0x00 } },
312+ {CONTROL_WORD, { 0x6040 , 0x00 } },
313+ {TARGET_POS, { 0x607A , 0x00 } },
314+ {TARGET_VEL, { 0x60FF , 0x00 } },
315+ {TARGET_TOR, { 0x6071 , 0x00 } },
316+ {DIGITAL_IN, { 0x2501 , 0x00 } },
317+ {DIGITAL_OUT, { 0x2601 , 0x00 } }};
318318
319319 std::map<OD_Entry_t, void *> OD_MappedObjectAddresses = {
320320 {STATUS_WORD, (void *)&statusWord},
@@ -594,7 +594,7 @@ class Drive {
594594 * \brief Sets the continous/not continous profile bit
595595 *
596596 * \param continuous if this is true, continous movement is enabled, otherwise it is disabled
597- * \return true If change is successful
597+ * \return true If change is successful
598598 * \return false If drive was not in position control mode
599599 */
600600 virtual bool posControlSetContinuousProfile (bool continuous);
0 commit comments