Hi,
In a ST, how can I run some part of code only once?
In below example I need to run some part of the code ( commented with ( only once)) only once.
IF a=1 Then
IF b=1 THEN ( only once) c=1 ( only once) ELSEIF b=2 THEN ( only once) c=2 ( only once) END_IF
CASE c OF 1: ........ ........ 2: ......... .........
END_IF
if (once=false) then once:=true; if b=1 then and rest of instructions. else end_if end_if
Log in to post a comment.
Hi,
In a ST, how can I run some part of code only once?
In below example I need to run some part of the code ( commented with ( only once)) only once.
IF a=1 Then
IF b=1 THEN ( only once)
c=1 ( only once)
ELSEIF b=2 THEN ( only once)
c=2 ( only once)
END_IF
END_IF
if (once=false) then
once:=true;
if b=1 then
and rest of instructions.
else
end_if
end_if