Attribute: analysis:report-multiple-instance-calls
The attribute marks a function block for checking for rule rule 105: Only function blocks with this attribute are checked whether the function block instances are called more than one time. When rule 105 is deactivated in the project settings, the attribute does not have any effect.
Insert location: Top line in the declaration part of a function block.
Syntax:
{attribute 'analysis:report-multiple-instance-calls'}Example
// {attribute 'analysis:report-multiple-instance-calls'} deactivated
FUNCTION_BLOCK FB_DoA
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
iA : INT;
END_VAR
iA := iA + 1;
{attribute 'analysis:report-multiple-instance-calls'}
FUNCTION_BLOCK FB_DoB
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
iB : INT;
END_VAR
iB := iB +1;
PROGRAM PLC_PRG
VAR
fbA : FB_DoA;
fbB : FB_DoB;
ND_VAR
fbA();
fbB(); // SA0105
fbA();
fbB(); // SA0105
Output under view Messages:
SA0105: Instance 'fbB' called several times