David
David

Reputation: 21

Implementing Python CANopen

I'm new to CANopen and I'm working to use it to interface between a microprocessor and a battery management system. I have a couple questions.

  1. Are the object dictionary, electronic datasheet, and device configuration files for things such as the battery management system supplied by the manufacturer?

  2. Do I have to generate any of these files myself?

Any help would be greatly appreciated!

Upvotes: 2

Views: 7308

Answers (3)

Tagli
Tagli

Reputation: 2592

Most of the CANopen software need EDS files (including the canopen library for Python). If you don't have an EDS file, you can create it yourself, if you know the complete OD structure of the device. If the CANopen device in question follows a CiA device profile, you may assume that some OD entries are present. But there is no guarantee, as the some OD entries mentioned in device profiles are optional and there can be additional ones which are not mentioned in the device profile but provided by the manufacturer. So, generally the manufacturer provides the EDS file. It wouldn't make much sense if the manufacturer documented the OD entries but left creating an EDS file to the user.

Some CANopen devices may have their EDS files embedded in themselves. Look for the OD entries 0x1021 and 0x1022. Recent versions of CiA 301 should mention them.

Upvotes: 0

Lundin
Lundin

Reputation: 213286

  1. Are the object dictionary, electronic datasheet, and device configuration files for things such as the battery management system supplied by the manufacturer?
  • The object dictionary is part of the CANopen implementation of each node. It's not some physical file, it's just one big address table of abstract addresses, most strictly standardized.

  • They aren't required to provide an electronic datasheet (EDS) but I would find it fishy if they can't provide one.

  • Device configuration files (DSF) refers to the specific configuration of a node in a network. Whereas the EDS is the original factory defaults. File format-wise I think they are identical.

    DSF won't usually be provided, because it doesn't make much sense to provide a specific configuration. It's more likely something that your specific PLC or whatever spits out when you wish to store your configuration on disk.

  1. Do I have to generate any of these files myself?

Only the DSF if you actually need one. If you are writing a Python program, I don't see the need.


I'd also recommend to seek out if the manufacturer has registered a vendor id with CAN in Automation - the non-profit organisation that "owns" the CANopen standard.

https://www.can-cia.org/services/canopen-vendor-id/

The same site also have some nice reading material about CAN and CANopen.

Upvotes: 0

dejanualex
dejanualex

Reputation: 4328

Based on their documentation, you need to provide the electronic datasheet file, looking in git repo (https://github.com/christiansandberg/canopen/tree/3d3d46beae7f6aad65d58b1247eab5ae758fb9e2), it's pretty clear that you need to have the eds file:

  # Add some nodes with corresponding Object Dictionaries
    node = canopen.BaseNode402(35, '/home/andre/Code/test/jupiter.eds')
    network.add_node(node)
    # network.add_node(34, '/home/andre/Code/test/jupiter.eds')
    # node = network[34]

The object dictionary file is normally provided when creating a node node = network.add_node(6, 'od.eds'), bellow you can find the add_node function definition:

def add_node(self, node, object_dictionary=None, upload_eds=False):
        """Add a remote node to the network.
        :param node:
            Can be either an integer representing the node ID, a
            :class:`canopen.RemoteNode` or :class:`canopen.LocalNode` object.
        :param object_dictionary:
            Can be either a string for specifying the path to an
            Object Dictionary file or a
            :class:`canopen.ObjectDictionary` object.
        :param bool upload_eds:
            Set ``True`` if EDS file should be uploaded from 0x1021.
        :return:
            The Node object that was added.
        :rtype: canopen.RemoteNode
        """

Maybe you can find the desired datasheet here: https://compatibility.rockwellautomation.com/pages/search.aspx?crumb=117&q=EDS%20files

Upvotes: 1

Related Questions