Moderator: RevPiModIO

 
johnruk4670
Topic Author
Posts: 3
Joined: 12 Nov 2020, 14:00

runtime errors

09 Mar 2022, 15:22

can someone help? why do i get this?

/usr/lib/python3/dist-packages/revpimodio2/modio.py:1083: RuntimeWarning: can not execute all event functions in one cycle - optimize your event functions or rise .cycletime RuntimeWarning
 
User avatar
RevPiModIO
Posts: 267
Joined: 20 Jan 2017, 08:44
Contact:

Re: runtime errors

11 Mar 2022, 15:14

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
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!

Who is online

Users browsing this forum: No registered users and 1 guest