Git Product home page Git Product logo

python-durand's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-durand's Issues

PDO transmission type is not written to OD via setter

I take the README example:

node.tpdo[0].mapping = [(0x2001, 1), (0x2001, 2)]
node.tpdo[0].transmission_type = 1  # transmit on every SYNC

node.rpdo[0].mapping = [(0x2000, 0)]
node.tpdo[0].transmission_type = 255  # event driven (processed when received)

When setting .transmission_type to 255 it works, because 255 is the default value (I'm not completely sure how that works). However, when setting to any other value, the PDO sync scheduler is indeed configured, but the object dictionary for PDO communication parameters is not updated:

  • 0x1800 + tpdo_index for TPDO
  • 0x1400 + rpdo_index for RPDO

IMHO, the setter should write it to the OD, as the setter of .inhibit_time does it as well:

    @inhibit_time.setter
    def inhibit_time(self, value: float):
        return self._node.object_dictionary.write(
            0x1800 + self._index, 3, value * 10_000
        )

For transmission type it should be added in tpdo and rpdo, at this time it's missing:

    def _set_transmission_type(self, value: int):
        if self._sync_handler:
            self._sync_handler.cancel()
            self._sync_handler = None

        if value <= 240:
            self._sync_handler = SyncHandler(self, value)

        self._transmission_type = value

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.