OpenEtherCATsociety / SOEM

Simple Open Source EtherCAT Master
Other
1.35k stars 686 forks source link

Problem with using IOM ECT -- ec_SDOwrite failed #830

Open gzovermas opened 5 months ago

gzovermas commented 5 months ago

We had use SOEM with Beckhoff IOs and servo drives sucessfully, but with IOM ECT we have problems. We have 4 sub modules: 32DI, 32DO, 4AI, 4AO IOM ECT modules the xml file of this module is below: IOM ECT-V1.2_xml.txt We can config and use it with codesys 微信图片_20240627100407 微信图片_20240627100414 But when we change back to soem, it can't be auto config. the slave_info below slaveinfo_map.txt slaveinfo_sdo.txt We had try to reconfig the pdo, but found that ec_SDOwrite() always return 0, the test code like below:

u8val = 0;
res = ec_SDOwrite(1, 0x1c13, 0x00, FALSE, sizeof(u8val), &u8val, EC_TIMEOUTRXM);
printf("write 1c13.00 : %d\n", res);

We had try to trace the code in ethercatcod.c, and found that in function:

1719454176490

the judgement returns false, so abort. the value of etohs(aSDOp->CANOpen)>> 12 is 0(should be 3) the value of aSDOp->Index is 1c00(should be 1c13)

Is there any suggestion? Thx a lot

gzovermas commented 5 months ago

The manufacture said their products doesn't support pdo assignment, and won't config pdo using sdo. How can I do then? Does SOEM can support this module?

toshisanro commented 5 months ago

I've had the same issue before, the slave's SM 2 and SM3 are empty ,you should config the SMs manually.

gzovermas commented 5 months ago

I've had the same issue before, the slave's SM 2 and SM3 are empty ,you should config the SMs manually.

how can i config SMs? is there any example? thx a lot

ArthurKetels commented 4 months ago

There are plenty examples here in the issues. Just use search. And as always, first read the documentation.