Download 3230 kB
Transcript
The Editors
Declaration Editor
• 159
Attention:
With this variable, the value of the transferred variable is changed
("transferred as a pointer", Call-by-Reference). That means that the input
value for such variables cannot be a constant. For this reason, even the
VAR_IN_OUT variables of a function block can not be read or written
directly from outside via <functionblockinstance><in/outputvariable>.
Example:
VAR_IN_OUT
inout1:INT;
(* 1. Inputoutputvariable *)
END_VAR
5.2.5 Local Variables
Between the keywords VAR and END_VAR, all of the local variables of a
POU are declared. These have no external connection; in other words, they
can not be written from the outside.
Example:
VAR
loc1:INT;
(* 1. Local Variable*)
END_VAR
5.2.6 Remanent variables
Remanent variables can retain their value throughout the usual program run
period. These include Retain variables and Persistent variables.
Retain variables are identified by the keyword RETAIN. These variables
maintain their value even after an uncontrolled shutdown of the controller, or a
reset. When the program is run again, the stored values will be processed
further. A practical example would be an operations timer that recommences
timing after a power failure.
All other variables are newly initialized, either with their initialized values or
with the standard initializations.
Persistent variables are identified by the keyword PERSISTENT. Unlike
Retain variables, these variables retain their value even after a cold start, that
is when the controller is shut down and restarted in an orderly fashion, or after
a download. Persistent variables are not automatically Retain variables !
Example:
VAR RETAIN
WAGO-I/O-SYSTEM 759
WAGO-I/O-PRO 32