Posted 12 Apr 2013 Hi, I want to optimize my PLC scan time, but i want to understand how scan time works really. If I have many rung or instructions with a always OFF, the scan time is affected? if yes, only for check the state of the contact, output? If I have Subroutine, the subroutine is only scanned when a SBS is true? and the scan time is not affected when not called? Thanks Share this post Link to post Share on other sites
Posted 12 Apr 2013 (edited) When you have an open (OFF) contact or condition on a rung (always off or any contact) the scan stop to read that rung and go to the next one. So if you want to optimize scan time with this, if you have many contact in a rung, put the one that is more often "OFF" in the beginning of the rung. You should check in the programming manual of your PLC, there is more info in this, scan time of different instruction, etc. Edited 12 Apr 2013 by pfort Share this post Link to post Share on other sites
Posted 12 Apr 2013 Another thing that you can use to reduce scan time is task switching. If there are blocks of code that do not need to be executed you can use task scheduling with the TKON and TKOF instructions to only execute them when they are needed. The only drawback to this approach is that your scan time can vary widely depending on how many tasks need to execute. I just finished a CP1L-EM30 program that is 7.5k with an average scan time of about 2ms. It is broken up into 9 separate tasks and 14 subroutines. Only two of the tasks execute on every scan. Section 5-2 of the CJ2 manual (W473) has a good writeup on tasks. Share this post Link to post Share on other sites
Posted 16 Apr 2013 Not quite, the output side of the rung is still processed. I think this is a common mis-understanding of using the Always Off contact. Yes, the scanning of the inputs after the always off are no longer scanned, but the output side must be. How else does a standard output coil switch off? Share this post Link to post Share on other sites