Skip to content

Conversation

@acolomb
Copy link
Member

@acolomb acolomb commented Aug 6, 2021

Normally one needs to call read() or save() on a single pdo (or the node's whole PDO collection) in order to receive any such objects from the network. That however requires quite a few SDO exchanges to make sure the node's PDO configuration matches the parameters configured in the object.

For applications where the PDO configuration is stored persistently in the node (e.g. device EEPROM), doing this SDO exchange can be skipped entirely if the application programmer takes care to mirror the same configuration in the python-canopen objects. Another use case is reconnecting to a node for which the same python-canopen script previously ran and the PDO configuration is still known to be valid.

Factor out a new method subscribe() from read() and save() to offer doing only that last part via the public API. Adapt the log message and make sure it is logged in read() as well.

acolomb added 2 commits August 6, 2021 14:47
Normally one needs to call read() or save() on a single pdo (or the
node's whole PDO collection) in order to receive any such objects from
the network.  That however requires quite a few SDO exchanges to make
sure the node's PDO configuration matches the parameters configured in
the object.

For applications where the PDO configuration is stored persistently in
the node (e.g. device EEPROM), doing this SDO exchange can be skipped
entirely if the application programmer takes care to mirror the same
configuration in the python-canopen objects.  Another use case is
reconnecting to a node for which the same python-canopen script
previously ran and the PDO configuration is still known to be valid.

Factor out a new method subscribe() from read() and save() to offer
doing only that last part via the public API.  Adapt the log message
and make sure it is logged in read() as well.
Follow the standard docstring conventions and rephrase the description
of RPDO and TPDO classes which is really long for a single summary
line.  No more docstring errors are reported by the flake8 checker on
this file.
@christiansandberg christiansandberg merged commit adc15da into canopen-python:master Aug 7, 2021
@acolomb
Copy link
Member Author

acolomb commented Aug 7, 2021

Thanks :-)

@acolomb acolomb deleted the subscribe-pdo-without-read-or-save branch August 7, 2021 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants