Code Monkey home page Code Monkey logo

Comments (4)

CANopenNode avatar CANopenNode commented on August 17, 2024

It is possible to implement different combinations of CANopen devices and CAN channels. Stack is object-oriented. CANopen.c file must be edited.

The easiest approach may be to use one CANopen device (with one object dictionary with objects for multiple motors). PDOs may then be split into multiple CAN channels.

Please note, Linux is currently not best for hard real-time.

Some example for multiple CANopen could be interesting for someone. So some link is very welcome. But if solution is very specific or if it adds much complexity into the code, I wouldn’t like to include it into the stack. Otherwise I will accept a pull request.

from canopennode.

jhaws1982 avatar jhaws1982 commented on August 17, 2024

It is possible to implement different combinations of CANopen devices
and CAN channels. Stack is object-oriented. CANopen.c file must be
edited.

The easiest approach may be to use one CANopen device (with one object
dictionary with objects for multiple motors). PDOs may then be split
into multiple CAN channels.

The approach I took was to eliminate the global variables altogether.
The user can now create a CO_t structure of their own and have as many
as they would like. A pointer to this is passed into CO_init() and
everywhere else in CANopen.c.

Is there a reason for going the global variable route? I feel that
eliminating the global variable makes the code more understandable and
flexible, at least from my perspective. However, my experience is
fairly limited in the CAN world - maybe there is some other common
application where having globals simplifies things greatly.

Please note, Linux is currently not best for hard real-time.

Right. Our application doesn't have hard real-time requirements.

Some example for multiple CANopen could be interesting for someone. So
some link is very welcome. But if solution is very specific or if it
adds much complexity into the code, I wouldn’t like to include it into
the stack. Otherwise I will accept a pull request.

As I mentioned, I've got an implementation ready to test and I hope to
do so over the next few days. If everything works I'll submit a pull
request so you can take a look at the changes. Whether or not you
accept it is fine either way. I've got a fork that I can pull from with
my changes.

Thanks!

from canopennode.

CANopenNode avatar CANopenNode commented on August 17, 2024

Hi,

Globals are sometimes nice for debugging on some microcontrollers. However, it is possible to have separate CANopenSimple.c, which uses only globals and CANopen.c without them.

Object dictionary is now implemented with globals only. I plan to change that in future. For now there is a workaround in OD editor. If you use a underscore in the beginning of project name, OD editor can generate globals prefixed with different names.

from canopennode.

grzegorzheldt avatar grzegorzheldt commented on August 17, 2024

Hello.

I would be very interested in such change. It is actually mandatory in larger scale solutions.
My kindly question is if you have a plans to integrate this change ? That would be great.

Best Regards
Greg.

from canopennode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.