Moderator: RevPiModIO

 
saardrimer
Topic Author
Posts: 18
Joined: 15 Jun 2021, 14:16
Answers: 0

RevPiModIO: RuntimeWarning: cycle time of 20 ms exceeded

07 Feb 2022, 13:54

Hello all

On one of our two CONNECT+ systems (with MIO and DO modules connected) we occasionally get the following warning from revpimodio2:

/usr/lib/python3/dist-packages/revpimodio2/helper.py:617: RuntimeWarning: cycle time of 20 ms exceeded - can not hold cycle time!
  RuntimeWarning

I'd like to investigate why this happens -- and why on only one of the systems -- but I'm not sure what the warning actually means. In plain English, does it mean something like:
I'm warning you that it took me longer than 20ms to perform the IO refresh cycle
or
I'm warning you because I'm supposed to refresh the IOs every 20ms, but it took longer than that between my invocations
or something else?

Any suggestions for where to look, what to do to debug, etc. would be welcome.

This is how I instantiate RevPiModIO:

import revpimodio2
revpi_io = revpimodio2.RevPiModIO(autorefresh=True)
 
User avatar
RevPiModIO
KUNBUS
Posts: 300
Joined: 20 Jan 2017, 08:44
Answers: 0
Contact:

Re: RevPiModIO: RuntimeWarning: cycle time of 20 ms exceeded

11 Mar 2022, 15:17

Hi saardrimer!

Your cycle loop function takes to long to execute - Maybe because of a .sleep or .wait or things like that. If you are using the cyclelooop, the cycle function must return in the given cycle time.

Do you have a code example you are using?
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!
 
saardrimer
Topic Author
Posts: 18
Joined: 15 Jun 2021, 14:16
Answers: 0

Re: RevPiModIO: RuntimeWarning: cycle time of 20 ms exceeded

24 Mar 2022, 13:56

Hi saardrimer!

Your cycle loop function takes to long to execute - Maybe because of a .sleep or .wait or things like that. If you are using the cyclelooop, the cycle function must return in the given cycle time.

Do you have a code example you are using?
Thanks for the clarification! I was careful to code in such a way that there are no idle sleeps. And, curiously, it only happens in one of the systems. I have since re-written some of the code and will see if the issue persists.

Who is online

Users browsing this forum: No registered users and 1 guest