fix(SF-33): Исправления на стенде

This commit is contained in:
algin 2023-09-18 10:25:47 +03:00
parent bb4a206507
commit 31016aa2af
3 changed files with 15 additions and 9 deletions

View File

@ -153,7 +153,7 @@ private:
telegram::EcatTelegram& telegram = ecat_buffer_.get_ecat().get_telegram();
ecat_buffer::FMMUGlobalProperties& fmmu_global_properties = ecat_buffer_.get_fmmu_global_properties();
address::Logical logical = fmmu_global_properties.logical_start_address + offset;
const datagram::TEcatWkc expected_wkc = 1;
const datagram::TEcatWkc expected_wkc = pdo_fmmu_slaves_.size();
TDatagram datagram{ {{logical}}, expected_wkc, data... };
return telegram.transfer(datagram);
@ -166,7 +166,7 @@ private:
telegram::EcatTelegram& telegram = ecat_buffer_.get_ecat().get_telegram();
ecat_buffer::FMMUGlobalProperties& fmmu_global_properties = ecat_buffer_.get_fmmu_global_properties();
address::Logical logical = fmmu_global_properties.logical_start_address + fmmu_global_properties.logical_full_length_write + offset;
const datagram::TEcatWkc expected_wkc = 1;
const datagram::TEcatWkc expected_wkc = pdo_fmmu_slaves_.size();
TDatagram datagram{ {{logical}}, expected_wkc, data... };
return telegram.transfer(datagram);

View File

@ -119,7 +119,7 @@ bool EcatTelegram::transfer() {
status_.attempts_exceeded_errors++;
status_.result = EcatTelegramResult::FATAL_ERROR;
DebugP_log((char*)"%s\r\n", status_.get_description().string);
DebugP_log((char*)"%s: %d\r\n", status_.get_description().string, status_.attempts_exceeded_errors);
break;
}
@ -131,6 +131,8 @@ bool EcatTelegram::transfer() {
status_.transfer_errors++;
status_.result = EcatTelegramResult::WARNING_TRANSFER_ERROR;
//DebugP_log((char*)"%s: %d\r\n", status_.get_description().string, status_.transfer_errors);
continue;
}
@ -138,6 +140,8 @@ bool EcatTelegram::transfer() {
status_.transfer_errors++;
status_.result = EcatTelegramResult::WARNING_TIMEOUT_ERROR;
//DebugP_log((char*)"%s: %d\r\n", status_.get_description().string, status_.transfer_errors);
continue;
}
@ -147,6 +151,8 @@ bool EcatTelegram::transfer() {
status_.expected_wkc_errors++;
status_.result = EcatTelegramResult::WARNING_WKC_ERROR;
//DebugP_log((char*)"%s: %d\r\n", status_.get_description().string, status_.expected_wkc_errors);
continue;
}

View File

@ -31,9 +31,9 @@ struct EcatDescription {
};
struct EcatTelegramStatus {
uint16_t transfer_errors;
uint16_t expected_wkc_errors;
uint16_t attempts_exceeded_errors;
uint16_t transfer_errors{0x0000};
uint16_t expected_wkc_errors{0x0000};
uint16_t attempts_exceeded_errors{0x0000};
EcatTelegramResult result = EcatTelegramResult::BUSY;
const EcatDescription& get_description() {
@ -74,8 +74,8 @@ public:
bool transfer(queue::Queue<datagram::IEcatDatagram>& next);
private:
static constexpr uint32_t connection_timeout_ticks_ = 2;
static constexpr uint32_t max_transfer_attempts_ = 3;
static constexpr uint32_t connection_timeout_ticks_ = 100;
static constexpr uint32_t max_transfer_attempts_ = 2;
Eth& eth_;
EthTxFlowIface& tx_flow_;
@ -87,7 +87,7 @@ private:
queue::Queue<datagram::IEcatDatagram> datagram_queue_;
//datagram::IEcatDatagram *datagram_queue_{nullptr};
EcatTelegramStatus status_;
EcatTelegramStatus status_{0x0000, 0x0000, 0x0000, EcatTelegramResult::BUSY};
bool transfer();