can someone help? why do i get this?
/usr/lib/python3/dist-packages/revpimodio2/modio.py RuntimeWarning: can not execute all event functions in one cycle - optimize your event functions or rise .cycletime RuntimeWarning
runtime errors
Moderator: RevPiModIO
- RevPiModIO
- KUNBUS
- Posts: 335
- Joined: 20 Jan 2017, 08:44
- Contact:
Hi johnruk4670!
That will happen, if your event function takes more time than the internal cycle time. If you register an event function it must be executed within a cycle, otherwise the functions will overlap.
Example: You push a button, the function will start work, take 1 second. In that second you pushed the button 3 times more, so the same function will be queued 3 times and will be executed one after one. So it will take 4 seconds to execute the same function 4 times, without any other Input-Action.
You can call the functions asynchronous by adding as_thread=True in the .reg_event call.
https://revpimodio.org/en/doc2/io/#reg_event
That will happen, if your event function takes more time than the internal cycle time. If you register an event function it must be executed within a cycle, otherwise the functions will overlap.
Example: You push a button, the function will start work, take 1 second. In that second you pushed the button 3 times more, so the same function will be queued 3 times and will be executed one after one. So it will take 4 seconds to execute the same function 4 times, without any other Input-Action.
You can call the functions asynchronous by adding as_thread=True in the .reg_event call.
https://revpimodio.org/en/doc2/io/#reg_event
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!