bnjmnp / pysoem

Cython wrapper for the Simple Open EtherCAT Master Library
MIT License
95 stars 36 forks source link

sdo_read_timeout #117

Open 6022 opened 10 months ago

6022 commented 10 months ago

How to use sdo_read_timeout

bnjmnp commented 10 months ago

After config_init() was called sdo_read_timeout can be used to change the SDO read timeout for SDO read request to all device. It is given in microseconds (µs).

Adding a timeout into the basic_example.py one would have something like this:

    def run(self):
        self._master.open(self._ifname)

        # Increase SDO read timeout to 5 seconds
        self._master.sdo_read_timeout = 5_000_000

        if not self._master.config_init() > 0:
            self._master.close()
            raise BasicExampleError("no slave found")