sveinse / canopen-asyncio

CANopen for Python
http://canopen.readthedocs.io/
MIT License
7 stars 2 forks source link

Node_0x07.tpdo.read() Subindex of SDO-Read goes bejond limit #7

Open GIT1RWM2AR opened 1 year ago

GIT1RWM2AR commented 1 year ago

Hello to everybody, hello Svein, I appreciate your work with canopen-asyncio and I like to use it and get it work!

First to make clear that I do not have a version mismatch:

  1. I imported your work with: pip3 install git+https://github.com/sveinse/canopen-asyncio.git
  2. My Python-Version is: Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
  3. I wanted to test your example: examples/canopen_async.py
  4. I realized a timeout-error with the Task: asyncio.create_task(do_loop(network, 7)), read of tpdo.read() ---> SDO Parameter 0x1800.1 ---> to this maybe in a later issue-session
  5. Than I scaled down to 1 bus-node to find the error; without further succes.
  6. Than I tried to simplify your example and try to do tpdo.read() just before the async and task calls.
  7. This will give us an error which is easy to show; and maybe easy to solve (for your).

Error: Why do the tpdo.read() try to read: 0x1800.6 ? slcan0 707 [1] 7F slcan0 607 [8] 40 00 18 01 00 00 00 00 slcan0 587 [8] 43 00 18 01 87 01 00 00 slcan0 707 [1] 7F slcan0 607 [8] 40 00 18 02 00 00 00 00 slcan0 587 [8] 4F 00 18 02 FF 00 00 00 slcan0 607 [8] 40 00 18 03 00 00 00 00 slcan0 587 [8] 4B 00 18 03 00 00 00 00 slcan0 607 [8] 40 00 18 05 00 00 00 00 slcan0 587 [8] 4B 00 18 05 00 00 00 00 slcan0 607 [8] 40 00 18 06 00 00 00 00 slcan0 587 [8] 80 00 18 06 11 00 09 06 slcan0 707 [1] 7F

I think there are only 1...5 Sub - Parameter, and so the Error-Response from the node is obvious. This is the part from your file: e35.eds [1800sub0] ParameterName=largest subindex supported ObjectType=0x7 DataType=0x0005 AccessType=const DefaultValue=0x5 PDOMapping=0x0

Line 59: File: canopen/pdo/base.py def read(self, from_od=False): """Read PDO configuration from node using SDO.""" for pdo_map in self.map.values(): pdo_map.read(from_od=from_od)

Thank you for your help. Best regards Armin