FUNCTION_BLOCK Siemens_SCL_src
// taken from the Siemens S7 Help/SCL information page

VAR_INPUT 

ENDWERT : INT; 

END_VAR 

VAR_IN_OUT 

IQ1 : REAL; 

END_VAR 

VAR 

INDEX : INT; 

END_VAR 
BEGIN 

CONTROL := FALSE; 

FOR INDEX := 1 TO ENDWERT DO 

IQ1 := IQ1 * 2; 

IF IQ1 > 10000 THEN 

CONTROL = TRUE 

END_IF; 

END_FOR; 
END_FUNCTION_BLOCK