Constants, typed literals, External variables, Keywords – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 260: L-force | plc designer

Advertising
background image

L-force | PLC Designer

Editors in PLC Designer

258

DMS 3.2 EN 02/2011 TD29



7.2.9

Constants, Typed Literals

Constants are identified by the key word CONSTANT. They can be declared locally or
globally.

Syntax:

VAR CONSTANT
<Identifier>:<Type> := <initialization>;
END_VAR

Example:

VAR CONSTANT

c_iCon1:INT:=12; (* 1. Constant*)

END_VAR

See "Operands in »PLC Designer«" for a listing of possible constants. See there also
regarding the possibility of using typed constants (Typed Literals).

7.2.10

External variables

Global variables which are to be imported into the POU are designated with the
keyword EXTERNAL. They also appear in the Watch window of the declaration part in
Online mode.

If the VAR_EXTERNAL declaration does not match the global declaration in every
respect, the following error message appears: "Declaration of '<var>' does not match
global declaration!"

If the global variable does not exist, the following error message appears: "Unkown
global variable: '<var>'!"

Example:

VAR EXTERNAL

iVarExt1:INT:=12; (* 1st external variable *)

END_VAR

7.2.11

Keywords

Keywords are to be written in uppercase letters in all editors. Keywords may not be
used as variables. Examples for keywords: VAR, VAR_CONSTANT, IF, NOT, INT. See the

list of keywords valid in »PLC Designer«.

Advertising