Typed literals, L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 510

Advertising
background image

L-force | PLC Designer

Operands in PLC Designer

508

DMS 3.2 EN 02/2011 TD29



10.1.9

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: <Type>#<Literal>

<Type> specifies the desired data type; possible entries are: BOOL, SINT, USINT, BYTE,
INT, UINT, WORD, DINT, UDINT, DWORD, REAL, LREAL. 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:

var1:=DINT#34;

If the constant can not 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.

Advertising