Real / lreal, String, Time data types – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 1023: L-force | plc designer

Advertising
background image

L-force | PLC Designer

Programming Reference

DMS 4.1 EN 03/2011 TD29

1021

REAL / LREAL
REAL and LREAL are so-called floating-point types. They are required to represent
rational numbers. 32 bits of memory space is reserved for REAL and 64 bits for LREAL.
Value range for REAL: 1.175494351e-38 to 3.402823466e+38
Value range for LREAL: 2.2250738585072014e-308 to 1.7976931348623158e+308

Note: The support of data type LREAL depends on the target device. Please see in the
corresponding documentation whether the 64 bit type LREAL gets converted to REAL
during compilation (possibly with a loss of information) or persists.

See also: REAL-/LREAL constants (Operands)

STRING
A STRING type variable can contain any string of characters. The size entry in the
declaration determines how much memory space should be reserved for the variable.
It refers to the number of characters in the string and can be placed in parentheses or
square brackets. If no size specification is given, the default size of 80 characters will
be used.
The string length basically is not limited in »PLC Designer«, but string functions only
can process strings of 1 - 255 characters! If a variable is initialized with a string too
long for the variables datatype, the string will be correspondingly cut from right to left.

Example of a String Declaration with 35 characters:

str:STRING(35):='This is a String';

See also:
• WSTRING
• STRING constants (Operands)

Time Data Types
The data types TIME, TIME_OF_DAY (abb. TOD), DATE and DATE_AND_TIME (abb. DT)
are handled internally like DWORD.
Time is given in milliseconds in TIME and TOD, time in TOD begins at 12:00 A.M.
Time is given in seconds in DATE and DT beginning with January 1, 1970 at 12:00 A.M.
Notice in this context also:
• LTIME, which in extension to the IEC 61131-3 standard is available as a 32-Bit time

data type.

• TIME constants
• DATE constants
• DATE_AND_TIME constants
• TIME_OF_DAY constants

Advertising