8/21/2009 1:16 AM | |
Joined: 10/7/2005 Last visit: 5/18/2024 Posts: 3005 Rating: (1048) |
Hello Oscar_83PL Let's start with the first optimisation possibility: [code]L "parametry ogolne".Grubosc_1 L "parametry ogolne".Grubosc_1 > I [/code] The above will never be TRUE (you compare the same variable for being bigger than itself), which makes this comparison superfluous. Let's assume that this first comparison is just a typing mistake, you can optimise the logic like this: Use the "TAK" command (which is much faster than a "LOAD" to retrieve ""parametry ogolne".Grubosc_1" back intoaccu1. Example: [code]L Grubosc_1 L Variable_2 > I A( TAK // accu2 <-> accu1 (retrieve Grubosc_1) L Variable_3 > I ) A( TAK // accu2 <-> accu1 (retrieve Grubosc_1) L Variable_4 > I ) A( TAK // accu2 <-> accu1 (retrieve Grubosc_1) L Variable_5 > I ) etc. [/code] Having said all of the above, your scan time of 10 to 40 ms will not be caused by this code segment nor be substantially reduced by optimising it. I wonder if you office test your CPU at the moment and have "missing" I/O hardware andas such I/O access errors (which will cause frequent OB122 callsand have a detrimental effect on CPU scan time). Anyway, I hope this helps and let us know more about your test setup to be able to advise you further. |
Cheers |
|
This contribution was helpful to3 thankful Users |
8/24/2009 8:47 AM | |
Joined: 10/7/2005 Last visit: 5/18/2024 Posts: 3005 Rating: (1048) |
you're very welcome Oscar_83PL there is a seperate manual for the execution times whichis called the "Instruction list" andthe link to the current version for your 313C is below: S7-300 Instruction List CPU 31xC, CPU 31x, IM 151-7 CPU, IM 151-8 CPU, IM 154-8 CPU, BM 147-1 CPU, BM 147-2 CPU |
Cheers |
|
8/24/2009 10:08 AM | |
Joined: 10/22/2008 Last visit: 5/6/2024 Posts: 365 Rating: (5) |
Thanks for the link. This is helpfull. I have no idea why i never came across with that datasheet. Best regards |
Follow us on