<9. Advanced Engineering >
However, in the example shown in the figure above, when EN01 is FALSE, the ADD
logic is not executed. On the other hand, the MUL logic performs calculation in every
scan cycle using values stored in the memory area.
To avoid this problem, if a variable is connected to the EN terminal of an upstream
function block, connect the ENO terminal of the upstream function block to the EN
terminal of the downstream function block.
For reference, we describe the example logic shown below.
In this logic, If EN01 is TRUE, the result of the ADD logic is used by the MUL logic to
perform calculation; if EN01 becomes FALSE, the result just before EN01 becomes
FALSE is used by the MUL logic to perform calculation.
In the figure below, the result of the ADD logic is not passed downstream via a
connection line, but stored into variable ADD01, which is used by the MUL logic in
its calculation.
In this case, when variable EN01 is FALSE, the ADD logic stops execution but its
last value is retained in ADD01.
As the MUL Logic uses this value in its calculation, its calculation result does not
become indefinite.
In the case of a function connected to a function block, the problem described earlier
does not occur.