13 iec 61131-3 operands, 1 constants, 1 number constants – Lenze DDS v2.3 User Manual

Page 285: 2 bool constants, 3 time constants, Number constants, Bool constants, Time constants, Drive plc developer studio

Advertising
background image

Drive PLC Developer Studio

IEC 61131-3 Operands

13-1

l

DDS EN 2.3

13

IEC 61131-3 operands

In the DDS, operands can be constants, variables, addresses and function calls.

13.1

Constants

Note!

Not all automation systems support the various different data types.

13.1.1

Number constants

Numerical values can be binary numbers, octal numbers, decimal numbers and hexadecimal
numbers.

If an integer is not a decimal number, its base followed by a hash # must be written in front of
the integer constant.

In the case of hexadecimal numbers, the numerical values for numbers 10 to 15 are specified
with the letters A-F as is common practice.

Underscores are not allowed in numerical values with the exception of binary numbers.

Examples:

14 (* Decimal number *)
2#1001_0011 (* Binary number *)
8#67 (* Octal number *)
16#A (* Hexadecimal number *)

The type of these numerical values can be: BYTE, WORD, DWORD, SINT, USINT, INT, UINT,
DINT

, UDINT, REAL or LREAL.

Implicit conversions from ” higher-” to ” lower-order” types are not allowed.
A DINT variable cannot that easily be used as INT variable.
In such cases, use the type conversion functions of the standard library.

13.1.2

BOOL constants

BOOL

constants are TRUE and FALSE. They take up 1 Byte memory.

13.1.3

TIME constants

The DDS allows the declaration of TIME constants.

These are specifically used for the timers of the standard library. A TIME constant always consists
of a leading t or T (or time or TIME in full text) and a hash #.

This is followed by the actual time declaration that may consist of days (d), hours (h), minutes (m),
seconds (s) and milliseconds (ms).

Note that time specifications must be sorted by size (d before h before m before s before ms), while
not all specifications must occur.

Examples of correct TIME constants in an ST assignment:

TIME1 := T#14ms;
TIME1 := T#100s12ms (*Overflow in the highest-order component

allowed*)

TIME1 := t#12h34m15s;

Show/Hide Bookmarks

Advertising