Anzahl Anweisungen (NOS)
Titel Kurzform | NOS |
Kategorien | Informativ |
Definition | Anzahl der ausführbaren Anweisungen in der Implementierung eines Funktionsbausteines, einer Funktion oder einer Methode |
Weitere Informationen | NOS = Number Of executable Statements Anweisungen in der Deklaration, leere Anweisungen oder Pragmas werden nicht gezählt. |
Beispiel:
FUNCTION_BLOCK FB_Sample
VAR_OUTPUT
nTest : INT;
i : INT;
END_VAR
VAR
bVar : BOOL;
c : INT := 100; // statements in the declaration are not counted
END_VAR
IF bVar THEN //if statement: +1
nTest := 0; // +1
END_IF
WHILE nTest = 1 DO //while statement: +1
; // empty statements do not add to the statement count
END_WHILE
FOR c := 0 TO 10 BY 2 DO //for statement: +1
i := i+i; // +1
END_FOR
{text 'simple text pragma'} //pragmas are not counted
nTest := 2; //+1Das Beispiel hat sechs Anweisungen.