johanbn2000
Dear Sir,

I have tried to use TOF Function block for 1000ms (TOFF1) and 500ms (TOFF2) on Raspberry pi 3 B+ to turn on/off LED and test it out.
The result is the timer is not stable/Accurate. Some times it is correct about 1s (TOFF1) and 0,5s (TOFF2), but many time it was access more the the given time. Worse case the time could access more then 2s for both after running for a while.
It got normal again after I stop and restart the PLC again. After a while it become not stable again.
How to address this problem?

Please advise.

Thanks for your help.
Regards,
JOHAN
Reply 0 0
thiagoralves
It shouldn't behave like that. I have applications running with timers for months that have never skipped a beat. Have you checked your CPU load? There might be something running on the background that is eating up your resources and delaying the timmers. Try running OpenPLC on a fresh Raspbian image and see if you're still getting these problems. Do you have slave devices configured as well or is it running on plain Raspberry Pi?
Reply 0 0
johanbn2000
I use Fresh Raspbian image on Raspi 3B+ without any slave devices. I do not running others software on raspberry pi. The CPU load is less then 5%.
Reply 0 0
johanbn2000
Correction. The CPU Load is less then 35%. Is it normal?
The Ladder is as follows:
Screenshot from 2019-02-10 13-40-48.png 
Reply 0 0
johanbn2000
Hi,
The problem is solved. The problem is my unstable (not enough ampere) power supply. After I change with the good one, every thing is working perfectly.
Thanks.
Reply 0 0
thiagoralves
Ah, that's good. I was about to start a bunch of tests here because I was worried about this. On my previous realtime tests, OpenPLC had a better standard deviation than Siemens PLCs. It was in the order of 0.2ms! When you said that you were experiencing 2 seconds delay, I got worried! =)
Reply 1 0
Reply