Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help: CANopenLinux and RPDO usage #17

Open
Keiroha opened this issue Mar 20, 2024 · 1 comment
Open

Help: CANopenLinux and RPDO usage #17

Keiroha opened this issue Mar 20, 2024 · 1 comment

Comments

@Keiroha
Copy link

Keiroha commented Mar 20, 2024

Hello
I'm trying to use CANopenLinux as a PDO consumer with a callback function.
The TPDO device supports the 401 profile, so I've added the required Objects from that to the basic 301 profile to create my own OD.c and OD.h for CANopenLinux.
I've implemented a test app that uses the ASCII gateway to read and write objects, and issue start etc.
For the PDO exchange, I've used the GW to read the 4x TPDOs from the remote device and then write this information to the Linux 4x default RPDOs, so that the mappings are the same at both ends of the exchange.
I've also added 4x calls to CO_RPDO_initCallbackPre() immediately after the calls to CO_CANopenInitPDO() in main().
I am not getting any errors with the above but neither am I seeing any callbacks. I am seeing CAN messages with the correct IDs, so the device is transmitting ok.
I'm not sure whether my approach of doing the configuration over via the GW is valid?
Or whether I need to make function calls within CANopenLinux instead?
Any help and guidance would be gratefully received.
Thanks.

@CANopenNode
Copy link
Owner

What you describe seems very complicated. Once you understand CANopen, it should be quite simple.

Use gateway for reading/writing object dictionary entries on any node on the network. You have full access without PDOs.

Configure PDOs only with communication and mapping parameters. No callbacks. If you have a CANopenLinux test app and remote 401 device, then map remote PDOs to OD entries of your CANopenLinux test app. (OD entries was created before, no need for mappings to be on the same indexes on both devices). Then read/write OD entries on your CANopenLinux test app. If you need callbacks, use OD_extension (advanced).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants