参考可能的解决方法之一
通过ec_wc_state_t::EC_WC_COMPLETE
这个flag来判断
while (!CheckDomainState()){
for (auto &master : v_master_ptr_) {
// receive process data
ecrt_master_receive(master->master_);
ecrt_domain_process(master->domain_);
// check process data state
master->UptateAndCheckDomainStateChange();
}
}
参考
【1】Preventing Data Loss in Linux-Based EtherCAT Master. Cheol-Jin An. IJFCC.2015.V4.394