I dont want to save data by fc. I just want to know waht happed with temp vars if i have multiple instance of one function. Let look that example. I have two function. The first ‘fc4’ called the second ‘fc3’ twice. In ‘fc3’ I have set coil ‘temp1’. The output of ‘fc3’ depends on two inputs var ‘in1’ and ‘in2’ and local var ‘temp1’. On second instance of function ‘fc3’ I have only to set ‘in1’ and the output ‘pass’ is on. The ‘temp1’ var is set in the second instance on function ‘fc3’. Is what mean that local data is saved? I just copied these function in STL just past them in stap7 and turn the view to LAD and test it will PLCSim. So my question is if I set tamp var in function how to know what happen with this var in second instance of this function is it will be clear, set or undefined
fc 3
in: in1 – bool; in2 – bool;
out: out1 – bool
temp: temp1 – bool
A #in1
S #temp1
A #in2
A #temp1
= #out1
fc4
in: n1 - bool; n2 - bool
out: pass – bool
temp: t1 – bool; t2 – bool
A M 10.1
= L 1.0
BLD 103
A M 10.2
= L 1.1
BLD 103
A #n1
JNB _001
CALL FC 3
in1 :=L1.0
in2 :=L1.1
out1:=#t1
_001: NOP 0
A M 10.3
= L 1.0
BLD 103
A M 10.4
= L 1.1
BLD 103
A #n2
JNB _002
CALL FC 3
in1 :=L1.0
in2 :=L1.1
out1:=#t2
_002: NOP 0
A #t1
AN #t2
= #pass
ob1
A M 20.0
= L 21.0
BLD 103
A M 20.1
= L 21.1
BLD 103
A M 1.0
JNB _001
CALL FC 4
n1 :=L21.0
n2 :=L21.1
pass:=M30.0
_001: NOP 0