CALC command calls up the POU irrespective of the condition

Which products are affected?
ESP-DDS2-x (Drive PLC Developer Studio V1.x, 2.x)

What happens?
In the instruction list (IL) programming language the instance of a function block should normally be called up by means of the CALC command if the result of the preceding expression is TRUE. However, the instance is called up irrespective of the result of the preceding expression.

When does the problem occur?
If an instance of a function block is called up by means of the CALC command, the requested value may be assigned in parentheses to the parameters of the function block (their inputs). The instance is called up dependent on the value which is assigned to the last input. This means only if the assignment result is 0 the POU is not called up, otherwise it will be called up.

Example:
LD bEnable
CALC CTU1 (CU:=bCountUp, RESET:=bReset, PV:=nCounterLimit)
LD CTU1.CV
ST nResult

Independent of the bEnable Boolean variable the instance of the CTU POU counts up by one with every edge at the CU input if the nCounterLimit variable (and thus the PV POU input) is unequal 0).

Possible diagnostics?
None.

Short-term measures/recommendations?
Replace the CALC command by the CAL command and implement the conditional processing of the POU via a jump command.

Example:
LD bEnable
JMPCN NoCount
CAL CTU1 (CU:=bCountUp, RESET:=bReset, PV:=nCounterLimit)
LD CTU1.CV
ST nResult
NoCount:

Evaluation:
If the CALC command is used a wrong condition for calling up a POU is evaluated. This function restriction can be detected during commissioning at the latest.

URL for linking this AKB article: https://www.lenze.com/en-de/go/akb/200600620/1/
Contact form