PLUS+1 User Forum
PLUS+1 Hardware => Controllers => Topic started by: macbahi on June 07, 2022, 05:48:58 PM
-
Hello,
I try to use POU structured text.
Please I want to use static variable as in C programming.
as example static double var1 =0 (initialized to zero but it can be changed after in the program)
Thanks in advance
With bests regards
-
Hi
I have using this PLCcode but not working with plus1
VAR_STAT
var1 : INT :=0;
END_VAR
Thanks
-
Hello macbahi,
I'm not a ST or C coder so I asked around and this is what I got.
"If the customer makes his POU a FUNCTION_BLOCK then the value of ordinary VAR variables will be kept between the calls, just like a static in C-code
ie:
FUNCTION_BLOCK MyBlock
VAR
var1 : INT := 0;
END_VAR
"
I hope it helps.
-
Hi Tor,
Ok .
Thanks
With best regards
mac bahi