runtime errors

Moderator: RevPiModIO

Post Reply
Posts: 3
Joined: 12 Nov 2020, 14:00

runtime errors

Post by johnruk4670 »

can someone help? why do i get this?

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

Re: runtime errors

Post by RevPiModIO »

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.
python3-RevPiModIO - || Der RevPi ist das Beste, was passieren konnte!
Post Reply