@@ -328,12 +328,16 @@ void EtherlabMaster::update(uint32_t domain)
328
328
329
329
// read and write process data
330
330
for (DomainInfo::Entry & entry : domain_info->entries ) {
331
+ int channel_counter = 0 ;
331
332
for (auto mi = 0ul ; mi < (entry.slave )->get_pdo_config ().size (); mi++) {
332
333
for (auto ci = 0ul ; ci < (entry.slave )->get_pdo_config ()[mi].pdo_channel_config .size ();
333
334
ci++)
334
335
{
335
336
if ((entry.slave )->get_pdo_config ()[mi].pdo_channel_config [ci].index != 0x0000 ) {
336
- (entry.slave )->process_data (mi, ci, domain_info->domain_pd + entry.offset [mi + ci]);
337
+ (entry.slave )->process_data (
338
+ mi, ci,
339
+ domain_info->domain_pd + entry.offset [channel_counter]);
340
+ channel_counter++;
337
341
}
338
342
}
339
343
}
@@ -373,12 +377,16 @@ bool EtherlabMaster::read_process_data()
373
377
374
378
// read and write process data
375
379
for (DomainInfo::Entry & entry : domain_info->entries ) {
380
+ int channel_counter = 0 ;
376
381
for (auto mi = 0ul ; mi < (entry.slave )->get_pdo_config ().size (); mi++) {
377
382
for (auto ci = 0ul ; ci < (entry.slave )->get_pdo_config ()[mi].pdo_channel_config .size ();
378
383
ci++)
379
384
{
380
385
if ((entry.slave )->get_pdo_config ()[mi].pdo_channel_config [ci].index != 0x0000 ) {
381
- (entry.slave )->process_data (mi, ci, domain_info->domain_pd + entry.offset [mi + ci]);
386
+ (entry.slave )->process_data (
387
+ mi, ci,
388
+ domain_info->domain_pd + entry.offset [channel_counter]);
389
+ channel_counter++;
382
390
}
383
391
}
384
392
}
@@ -393,12 +401,16 @@ bool EtherlabMaster::write_process_data()
393
401
DomainInfo * domain_info = domain_info_[0 ];
394
402
// read and write process data
395
403
for (DomainInfo::Entry & entry : domain_info->entries ) {
404
+ int channel_counter = 0 ;
396
405
for (auto mi = 0ul ; mi < (entry.slave )->get_pdo_config ().size (); mi++) {
397
406
for (auto ci = 0ul ; ci < (entry.slave )->get_pdo_config ()[mi].pdo_channel_config .size ();
398
407
ci++)
399
408
{
400
409
if ((entry.slave )->get_pdo_config ()[mi].pdo_channel_config [ci].index != 0x0000 ) {
401
- (entry.slave )->process_data (mi, ci, domain_info->domain_pd + entry.offset [mi + ci]);
410
+ (entry.slave )->process_data (
411
+ mi, ci,
412
+ domain_info->domain_pd + entry.offset [channel_counter]);
413
+ channel_counter++;
402
414
}
403
415
}
404
416
}
0 commit comments