10 identifiers, 11 variable declaration, Identifiers – Lenze DDS v2.3 User Manual

Page 136: Variable declaration, Drive plc developer studio

Advertising
background image

Drive PLC Developer Studio

Editors

7-14

l

DDS EN 2.3

7.2.10

Identifiers

Note!

Only the first 32 characters are of any significance!

Identifiers are a sequence of letters, digits and underscores starting with a letter or an underscore.

Variable identifiers must not:

contain white spaces and umlauts,

be declared twice

be identical to keywords.

Furthermore:

Case sensitivity is not an option for variables.
(Example: VAR1, Var1 and var1 are not different variables)

Underscores in an identifier are significant.
(Example: A_BCD and AB_CD are interpreted as different identifiers.)

Multiple successive underscores at the beginning of or within an identifier are not allowed.

7.2.11

Variable declaration

Syntax:

<Identifier> {AT <Address>}:<Type> {:= <Initialization>};

The parts in curly brackets {} are optional.

All variable declarations and data type elements may contain initializations.

Initializations are effected with assignment operator ” :=” .

Initializations are constants for variables of elementary types.

The default initialization for all declarations is 0 or FALSE.

Example:

var1: INT:=12; (* integer variable with initial value 12*)

If the variable is to be directly linked to a certain address, the variable must be declared with
the keyword AT.

Use the short form mode for quick entry of declarations.

In function blocks, variables may also be specified with incomplete address details. Use of
such variables in local instances requires respective entries in the variable configuration.

Note the automatic declaration option.

Tip!

Observe the information given in chapter IEC 61131-3 Operands for variable identifiers.

(

^ 13-4)

Show/Hide Bookmarks

Advertising