4 input / output variables, 5 local variables, 6 retentive variables – Lenze DDS v2.3 User Manual

Page 134: Input / output variables, Local variables, Retentive variables, Drive plc developer studio

Advertising
background image

Drive PLC Developer Studio

Editors

7-12

l

DDS EN 2.3

7.2.4

Input / output variables

Between the keywords VAR_IN_OUT and END_VAR, all variables are declared that are used as input
and output variables for an organization unit.

Note!

In the case of these variables, the value of the transferred variables is changed directly (” Transfer
as pointer” , call-by-reference). Therefore, the input value for these variables must not be a constant.
For this reason, VAR_IN_OUT variables of a function block can not be read directly from outside via
Function block instance, Input / output variable.

Example:

VAR_IN_OUT

inout1:INT; (* 1. input / output variable *)

END_VAR

7.2.5

Local variables

Between the keywords VAR and END_VAR, all local variables of an organization unit are declared.

Local variables have no connection to the outside, i. e., they cannot be written from outside.

Example:

VAR

loc1:INT; (* 1. local variable *)

END_VAR

7.2.6

Retentive variables

Retentive variables may retain their value beyond the standard program runtime. Retentive
variables include Retain variables and persistent variables.

Retain variables

All retain variables of an organization unit are declared between the keywords VAR Retain and
END_VAR

.

Retain variables retain their values after a control disconnect or after a reset. When the
program is restarted, the stored values are used for further processing.

In two cases the retain variables are reset to their initialization values.
– With a program download.
– In online mode with the menu commands Online Reset (cold) and Online Reset (bootstrap).

Persistent variables

Persistent variables are stored in the persistent memory and retain their values. The persistent
memory can only be cleared in online mode via the menu command Online Reset (bootstrap).

The persistent memory can be accessed via the system organization unit Var_Persistent.

In the Object Organizer, tab Resources you can open the PLC configuration. Use the menu
command Insert Add subelement Var_Persistent... to add the system organization unit as a
subelement.

Show/Hide Bookmarks

Advertising