In the function ec_master_clear_device_stats in master/master.c, the fields tx_frame_rates and tx_byte_rates are initialized to zero but not their rx counterparts. This causes the 'Common' section of the 'ethercat master' command to report incorrect RX stats.
I fixed this by adding two lines to the for loop in this function as follows: master->device_stats.rx_frame_rates[i] = 0; master->device_stats.rx_byte_rates[i] = 0; So that the function now looks like this: void ec_master_clear_device_stats( ec_master_t *master /**< EtherCAT master */ ) { unsigned int i; // zero frame statistics master->device_stats.tx_count = 0; master->device_stats.last_tx_count = 0; master->device_stats.rx_count = 0; master->device_stats.last_rx_count = 0; master->device_stats.tx_bytes = 0; master->device_stats.last_tx_bytes = 0; master->device_stats.rx_bytes = 0; master->device_stats.last_rx_bytes = 0; master->device_stats.last_loss = 0; for (i = 0; i < EC_RATE_COUNT; i++) { master->device_stats.tx_frame_rates[i] = 0; master->device_stats.tx_byte_rates[i] = 0; master->device_stats.rx_frame_rates[i] = 0; master->device_stats.rx_byte_rates[i] = 0; master->device_stats.loss_rates[i] = 0; } }
_______________________________________________ etherlab-dev mailing list etherlab-dev@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-dev