OpenEtherCATsociety / SOEM

Simple Open Source EtherCAT Master
Other
1.34k stars 682 forks source link

SDO and PDO parallel execution #867

Open nkt17 opened 1 week ago

nkt17 commented 1 week ago

Good day everyone. I need periodically request not mappable object by SDO. So the question occured. Can we parallel execute next actions?

1. ec_send_processdata(); ec_receive_processdata(EC_TIMEOUTRET);

and 2. ec_SDOread(1, index, subindex, FALSE, &size1, &v1, EC_TIMEOUTSAFE);

nkt17 commented 1 week ago

Also when i'm trying to request object by SDO sometimes there is incorrect data (correct data is 33282, incorrect data -1527169000)

image

ArthurKetels commented 1 week ago

Yes, PDO and SDO can function perfectly next to each other. But make sure they are running in different threads. Also check the return value of any SDO function, they might fail. And when it fails check the error message that is stored in the error list.

nkt17 commented 1 week ago

Yes, PDO and SDO can function perfectly next to each other. But make sure they are running in different threads. Also check the return value of any SDO function, they might fail. And when it fails check the error message that is stored in the error list.

Good day. Thanks for response. I removed lock_guard to allow PDOs and SDOs execute at the same time: image

I use this method to request parameters on the next photo (right values). image

On removing lock_guard all the parameters became wrong (result on the next photo) image

ArthurKetels commented 1 week ago

OK, but did you do it the way I instructed? You do not show any of your code or a wireshark trace.