Closed npk48 closed 4 years ago
Just wondering if anyone have the same idea here.
Oh yes, I have the same idea for a very long time. Object dictionary is really outdated part. The good new is, I have some more time now and I really want to improve the Object Dictionary. I have some ideas. Implementation should be flexible: simple for simple objects and rich for sophisticated. It will be quite a difficult task.
I will start in next days. I will make a separate branch for new_OD and put some ideas on it. I hope, it will be finished in next two months.
The callback stuff already has a known issue: https://github.com/CANopenNode/CANopenNode/issues/100 where I had no idea how to fix properly.
Object Dictionary is the oldest part of CANopenNode. It's time to renew it.
The idea is:
I will start with separate branch.
Hi, currently I'm using CANopenNode for a motion control project. In this project we have been using freemodbus to support modbus communication already, we want to add canopen support for it. While integrating CANopenNode and our custom ds402 implementation, I found that the SDO interface is designed in a very complex way.
In our application we have lots of complex data structures that need to be mapped to CanOpen OD, for example servo loop.
For freemodbus, it uses a lookup function to handle it.
So we wrote our own code generation tool for this lookup function. But for CanOpenNode we can't. The only solution I found now is
and it seems work.
But the problem is here, in CO_PDO.c
it's calling CO_OD_find in pdo handling function. and this look up might take some time to complete. So for example if I use tpdo for ds402 cyclic sync position update, CO_OD_find will be the bottleneck of the performance.
In my opinion, it's better handled with something like this
In this way, for OD and PDO mapping I could set the pointer to my application data directly. It allows easy integration with existing projects.
For now, I'm not sure how much it will affect the performance and will not change it, but I do have plan to rewrite the OD part of CanOpenNode. Just wondering if anyone have the same idea here.