L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 982

Advertising
background image

L-force | PLC Designer

Programming Reference

980

DMS 4.1 EN 03/2011 TD29

See the Operands description for a listing of possible constants. See there also
regarding the possibility of using typed constants :

Typed Literals
Basically, in using IEC constants, the smallest possible data type will be used. If another
data type must be used, this can be achieved with the help of typed literals without
the necessity of explicitly declaring the constants. For this, the constant will be
provided with a prefix which determines the type.
This is written as follows:

Syntax:
<Type>#<Literal>
<Type> specifies the desired data type; possible entries are all simple data types. The
type must be written in uppercase letters.
<Literal> specifies the constant. The data entered must fit within the data type
specified under <Type>.

Example:

iVar1:=DINT#34;


If the constant cannot be converted to the target type without data loss, an error
message is issued:
Typed literals can be used wherever normal constants can be used.

Constants in online mode
As long as the default setting Replace Constants (Compile Options) is active, constants
are indicated by an symbol preceding the value in the Value column of the
Declaration or Watch window in online mode. In this case they cannot be accessed by
e.g. forcing or writing.

Advertising