beautypg.com

Number constants, Real/lreal constants, String constants – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 1097: L-force | plc designer

background image

L-force | PLC Designer

Programming Reference

DMS 4.1 EN 03/2011 TD29

1095

Number Constants
Number values can appear as binary numbers, octal numbers, decimal numbers and
hexadecimal numbers.
If an integer value is not a decimal number, the base must be followed by the number
sign (#) in front of the integer constant.
The values for the numbers 10-15 in hexadecimal numbers will be represented by the
letters A-F.
You may include the underscore character within the number.
Examples:

14

(decimal number)

2#1001_0011

(dual number)

8#67

(octal number)

16#A

(hexadecimal number)

These number values can be of type BYTE, WORD, DWORD, SINT, USINT, INT, UINT,
DINT, UDINT, REAL or LREAL.
Implicit conversions from "larger" to "smaller" variable types are not permitted. This
means that a DINT variable cannot simply be used as an INT variable. You must use the
type conversion.

REAL/LREAL Constants
REAL and LREAL constants can be given as decimal fractions and represented
exponentially. Use the standard American format with the decimal point to do this.
Example:

7.4

instead of 7,4

1.64e+009

instead of 1,64e+009

STRING Constants
A string is a sequence of characters.
STRING constants are preceded and followed by single quotation marks. You may also
enter blank spaces and special characters (umlauts for instance). They will be treated
just like all other characters.