show the entry list
STEP 7 -- Creating S7 programs -- Optimizing program sequences
Difference in the cycle time during DB accesses
Edge trigger flag misses out edges when using flag bit 0
Information on the topic of "Optimizing program sequences"
How can you increase the performance of HMI devices?
How can the program runtime be optimized if the main memory of the CPU is too small for the runtime-relevant STEP 7 program?"
How can I optimize PID Temperature Control using STEP 7 V5.3 SP2?
Difference in the cycle time during DB accesses
Part number:

QUESTION:
What is the effect of different data-block programming (opening and accesses) on the cycle time?

ANSWER:  
The execution times depend on the respective CPU.

Example of a shorter cycle time (no symbolic representation):

AUF DB5
U DBX 0.0
U DBX 0.1
= DBX 0.2

 
CPU412 CPU414 CPU416 CPU417
AUF DB5 Open 1x DB 0.6µs 0.3µs 0.24µs 0.3µs
U DBX0.0
1x DB access 0.3µs

0.1µs

0.08µs 0.1µs
U DBX0.1 1x DB access 0.3µs 0.1µs 0.08µs 0.1µs
= DBX0.2 1x DB access 0.4µs 0.2µs 0.16µs 0.2µs
Total 1.6µs 0.7µs 0.56µs 0.7µs
Table 1: Comparative cycle times (no symbolic representation)

Example of a longer cycle time (with symbolic representation):
U "Data block".Value_1  //DB5.DBX0.0
U "Data block".Value_2  //DB5.DBX0.1
= "Data block".Value_4  //DB5.DBX0.2
Even when the same data block is accessed here again and again, the block is always opened anew each time. For example, with a CPU414 it is about 0.3µs per command line.

 
CPU412 CPU414 CPU416 CPU417
U DBy.DBX0.0 Open 1x DB

1x DB access

0.6µs

0.3µs

0.3µs

0.1µs

0.24µs

0.08µs

0.3µs

0.1µs

U DB5.DBX0.1 Open 1x DB

1x DB access

0.6µs

0.3µs

0.3µs

0.1µs

0.24µs

0.08µs

0.3µs

0.1µs

= DBy.DBX0.2 Open 1x DB

1x DB access

0.6µs

0.4µs

0.3µs

0.2µs

0.24µs

0.16µs

0.3µs

0.2µs

Total   2.8µs 1.3µs 1.04µs 1.3µs
Table 2: Comparative cycle times (without symbolic representation)

Note:
When comparing absolute and symbolic programming, however, the following must be borne in mind:

  • In the case of small CPUs, the greater memory requirement during symbolic programming has an effect.

  • For reasons of clarity, symbolic programming is preferable.

  • Data structures can only be addressed symbolically.

  • Symbolic programming is preferable because it is easier to change (e.g. 100 digits change from U E 4.5 -> U E 4.6 compared to a centralized system of changes in the Symbol Editor). Whichever is the best choice depends on the circumstances!

For further information on execution times for instructions in STEP 7 for S7-300 and S7-400 CPUs, please refer to the relevant operations lists on the Internet:

Keywords:
Cycle time, Access time, Execution time

 Entry ID:10810851   Date:2011-07-11 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour