我是CANopen的新手,正在努力将其用于微处理器和电池管理系统之间的接口。我有几个问题。
对象字典,电子数据表和设备配置文件是否用于制造商提供的电池管理系统之类的东西?
我必须自己生成这些文件吗?
任何帮助将不胜感激!
根据他们的文档,您需要提供电子数据表文件,在git repo(https://github.com/christiansandberg/canopen/tree/3d3d46beae7f6aad65d58b1247eab5ae758fb9e2)中查找,很明显,您需要eds文件:
# 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]
通常在创建节点node = network.add_node(6, 'od.eds')
时提供对象字典文件,在下面您可以找到add_node
函数定义:
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
"""
也许您可以在此处找到所需的数据表:https://compatibility.rockwellautomation.com/pages/search.aspx?crumb=117&q=EDS%20files
- 对象字典,电子数据表和设备配置文件是否用于制造商提供的电池管理系统之类的东西?
设备配置文件(DSF)是指网络中节点的特定配置。而EDS是原始出厂默认设置。文件格式方面,我认为它们是相同的。
通常不会提供DSF,因为提供特定配置没有多大意义。当您希望将配置存储在磁盘上时,您的特定PLC或其他可能会吐出一些东西。
- 我必须自己生成这些文件吗?
仅DSF,如果您实际上需要一个。如果您正在编写Python程序,那么我认为没有必要。
我还建议您确定制造商是否已在自动化领域(拥有“ CANopen标准”的非营利组织,CAN)中注册了供应商ID。
https://www.can-cia.org/services/canopen-vendor-id/
同一站点上还有一些有关CAN和CANopen的不错的阅读材料。