Instructions: When the S7 program is compiled, a function block (FB) is created for every SFC type. This FB is automatically allocated a number when an SFC type is created. This number can be set in the "Properties SFC type" dialog box. This FB calls two FCs internally, one for processing actions and the other for processing transitions. In the case of extensive step sequences, a block which is involved in the step sequence may exceed the work memory's 64 Kbyte limit. Should this occur, the S7 program cannot be successfully compiled. This entry describes options for optimizing the size of the work memory requirement for an SFC type without exceeding the 64 Kbyte limit of the work memory. Entry ID 24411054 describes how to determine the work memory requirement for an SFC type.
| No. |
Description |
| 1 |
Exporting instructions from the transition conditions to the CFC This technique is aimed at reducing the FC work memory requirement for processing transitions.
Logic operation conditions, which occur repeatedly in transition conditions, can be configured in the CFC. Only the result of the logic operation is passed on to the SFC type as a process value and used in the relevant transitions.
Notes:
- The potential for savings is greater, the more logic you export to the CFC and the more frequently the result of the logic operation is used within the SFC type.
- The disadvantage in this method is that only the RLO appears within the SFC visualization in runtime because the actual logic is implemented in the CFC. However, if the CFC logic is created using HMI blocks (such as an INTERLOK block), the logic can be displayed and diagnosed in runtime via an appropriate faceplate.
|
| 2 |
Exporting instructions for processing actions to the CFC This technique is aimed at reducing the FC work memory requirement for processing actions.
If many actuators (e.g. valves or pumps) have to be activated in the individual steps of an SFC type, the actuators can be combined in suitable groups and activated via shared modify values.
Notes:
- The potential for savings is greater, the more individual signals there are combined as shared signals and the more frequently they are used.
- The disadvantage of this technique is that additional logic is required in the CFC for actual actuator control.
Example:
It would be conceivable in extreme cases to output only the current step numbers or corresponding binary control signals as so-called "step flags" in the steps of an SFC type. Additional logic is required in the CFC for evaluating the SFC output signals and for actuator control. However, in that case the SFC visualization will not provide any direct indication in runtime of which actuators are controlled in which steps. |
| 3 |
Data access on the basis of bits, bytes, words or double words
Under certain circumstances the number of instructions in the sequence of steps can be reduced if many bit-based data access actions are replaced by a few word-based data access actions. |
| 4 |
Using loops If the task involves executing certain steps one after another repeatedly, it may make sense to use the "loop" SFC element. This enables a section of a sequence of steps to be performed repeatedly. This saves a great amount of program code. However, a disadvantage of this could be that the program may become less clear as soon as minor program changes have to be configured for individual executed loops.
  Fig. 01
|
| 5 |
Combining alternative branches
If several alternative branches possess identical or similar structures, the steps of the various alternative branches can be run as a shared part of the program. The alternative branches will continue to be executed at the start of the sequence of steps. However, in order to allow for the differences between the original alternative steps, you will only receive one or a few steps, where only initialization measures will be performed. Depending on which initialization branch (alternative branch) has been performed at the start of the sequence of steps, different actions are performed in the shared part of the program.
  Fig. 02
|
| 6 |
Splitting the plant functionality between several SFCs The plant functionality of an extensive sequence of steps can be split between several sequences of steps. A main sequence of steps could call or control one or more secondary sequences of steps. |
|