OpenEtherCATsociety / SOES

Simple Open Source EtherCAT Slave
Other
588 stars 251 forks source link

How to know index PDO. #125

Closed tuhai711 closed 2 years ago

tuhai711 commented 2 years ago

Hi, I have a problem that in the process of processing PDO, How to know the index of PDO. I for example: I use a converter from canopen to ethercat, then the packet includes index + lengt+data, how do I convert to send to Ethercat slave.

nakarlsson commented 2 years ago

Could you give an example for better understanding.

CanOpen and EtherCAT differs when it comes to send/receive PDOs. EtherCAT transfer all PDOs in a "single frame" without index, length and so on. SOES takes care of the pack/unpack of the PDO mapped SDOs into/from the PDO frame. So, from and SOES application point of view, you can simply use the object dictionary defined application variables.

https://github.com/OpenEtherCATsociety/SOES/blob/fc72fbeeecc10d53c9c0655c88d43214c4ef0759/applications/rtl_xmc4_dynpdo/main.c#L30

there you can se the usage of the PDO data, SOES unpack the Obj.LEDgroup0.LED0 from the PDO frame for you.

tuhai711 commented 2 years ago

I see. Thank you.

nakarlsson commented 2 years ago

can we close the issue?

tuhai711 commented 2 years ago

Yes, Thank you.