Call of function in ST
function-name();
function-name
(input_1:=x1,input_2:=x2,...,input_n:=xn,
output_1=>y1,output_2=>y2,...,output_n=>yn);
Meaning |
formal call of the →function (= formal function →call) without or with parameter list No check of recursions
Recursions for →functions and →methods are not forbidden or checked by
logi.CAD 3
. Nevertheless, do not call a function/method from within itself and avoid 2 (or more) functions/methods calling each other (= mutual recursion) within your application.
This parameter list of a formal →call may contain the following elements:
The FAQ article "When to use a formal call? When to use a non-formal call?" lists a table when to use formal call vs. non-formal call. |
Simple1();
Simple2(IN1:=
10
, IN2 :=
20
, T1 := T#3ms, OUT => result);
AND(IN1:=TRUE, IN2:=FALSE);
Examples for incomplete parameter list of formal call for a function:
Syntax |
Meaning |
FUNCTION fun1 : INT |
declaration of the function fun1 declaration of the variables i1 and i2 with initial values |
FUNCTION fun2 : INT |
declaration of the function fun2 (with the result value '22') |
fun1(); |
call of the function fun1 without parameter list |
fun1(i2:=3); |
call of the function fun1 with
incomplete
parameter list |
fun1(i2:=fun2()); |
call of the function fun1 with
incomplete
parameter list |
fun1(i2:=fun2(EN:=FALSE)); |
call of the function fun1 with
incomplete
parameter list |
Examples for
incomplete parameter list of formal call
for the extensible
AND block:
Syntax |
Meaning |
AND(); |
call of the function AND without parameter list |
AND(IN2:=TRUE); |
call of the function AND with incomplete parameter list |
AND(IN1:=TRUE,IN10:=TRUE); |
call of the function AND with incomplete parameter list |