KL Chin

Results 5 comments of KL Chin

The salve module did not reply EC_STATE_ACK. Tested with 1 or 2 salve, problem were same, the code never work for me. I did increase the counter, also not work....

a) '0' before entering to the loop b) '2' immediate after ecx_statecheck -> ecx_BRD -> ecx_srconfirm was return '2' My modified code works for my slave. Not sure why so...

Will it better to by code below, so it cover both condition counter--; } while ( (0 < counter) && (EC_STATE_NONE == (context->slavelist[0].state) & (EC_STATE_PRE_OP | EC_STATE_ACK)) ); if (...

From the WireShark, I got these result ![image](https://user-images.githubusercontent.com/28014984/122955518-c48ac400-d3b2-11eb-93de-2cf101533db4.png) ![image](https://user-images.githubusercontent.com/28014984/122955607-d40a0d00-d3b2-11eb-9771-f8c6c940845f.png) ![image](https://user-images.githubusercontent.com/28014984/122956166-5692cc80-d3b3-11eb-87f2-67945fa438b2.png) Look likely it did receive STATE_ACK on the ecx_FPWRw( context->port,configadr,ECT_REG_ALCTL,htoes(EC_STATE_PRE_OP | EC_STATE_ACK),EC_TIMEOUTRET3 ); But not during ecx_statecheck( context,0,EC_STATE_PRE_OP,EC_TIMEOUTSTATE ); Anything...

I changed two modules to resolve my problem. "EC_STATE_ACK" was acknowledge by the salve during ecx_config_init, but not ScanDevices. a) ethercatconfig.c -> int ecx_config_init( ecx_contextt *context, uint8 usetable ) //...