canopen icon indicating copy to clipboard operation
canopen copied to clipboard

Is it possible to play/repeat a CANopenDump.log file?

Open klausz opened this issue 1 year ago • 0 comments

In using CANplayer: canplayer vcan0=can0 -I abc.log -g 1000 is it possible to play/repeat a CANopenDump.log file?

With Jupyter notebooks and the code:

import canopen

network = canopen.Network()

node = network.add_node(0x47, 'ab.eds') 
node2 = network.add_node(01a, 'cd.eds') 

network.connect(bustype='socketcan', channel='vcan0')

for obj in node2.object_dictionary.values():
    print('0x%X: %s' % (obj.index, obj.name))
    if isinstance(obj, canopen.objectdictionary.Record):
        for subobj in obj.values():
            print('  %d: %s' % (subobj.subindex, subobj.name))

0x1000: DeviceType 0x1001: ErrorRegister 0x1002: Manufacturer status register

node.object_dictionary[0x2001][1].__dict__

{'parent': <canopen.objectdictionary.Array at 0x7f4b2f479300>, 'index': 8193, 'subindex': 1, ..False}

node.object_dictionary[0x2021][5].default_raw '440'

I can get a lot of information. What i miss, (1) is it possible to get a online translation of the CANopen and .eds content (mapped) and displayed in the terminal window while CAN (real or CANplayer) is running? A terminal command in Linux displaying CANopen data thats addionaly calling CANOPEN and provides the link to the .eds file (one would be enough). (2) Also i am not sure - maybe i just need to make the code - to get the raw data from all the nodes when i start the cell in Jupyter?

Originally posted by @klausz in https://github.com/christiansandberg/canopen/discussions/330#discussioncomment-6245242

klausz avatar Jun 23 '23 14:06 klausz