Vai al contenuto

Foreword

Variables provide a means of identifying data objects whose contents may change, e.g., data associated with the inputs, outputs, or memory of the programmable controller. A variable must be declared to be one of the elementary types. Variables can be represented symbolically, or alternatively in a manner which directly represents the association of the data element with physical or logical locations in the programmable controller’s input, output, or memory structure.Each program organization unit (POU) (i.e., each program, function, or function block) contains at its beginning at least one declaration part, consisting of one or more structuring elements, which specify the types (and, if necessary, the physical or logical location) of the variables used in the POU. This declaration part begins with one of the keywords VAR, VAR_INPUT, or VAR_OUTPUT, followed optionally by zero or more qualifiers (RETAIN or CONSTANT), followed by one or more declarations separated by semicolons and terminated by the keyword END_VAR. A declaration may also specify an initialization for the declared variable, when a programmable controller supports the declaration by the user of initial values for variables.