3 functions, Functions, The software model – Lenze DDS v2.0 User Manual

Page 8

Advertising
background image

Introduction to IEC 61131-3 programming

The software model

6

l

DDS-IEC61131 EN 2.0

2.2.3

Functions

Unlike FBs, functions cannot buffer their internal values. Thus, they cannot use global variables,
access function blocks and declare directly addressable variables. All functions have in common
that they return the same output parameters if the input parameters are the same.

Overview: IEC 61131-3 standard functions

Type conversion functions
..._TO_...

Conversion between integers

BOOL_TO

BOOL

Þ Type X

TO_BOOL

Type X

Þ BOOL

TIME_TO / TIME_OF_DAY

TIME / TIME_OF_DAY

Þ Type X

DATE_TO / DT_TO

DATE / DATE_AND_TIME

Þ Type X

STRING_TO

STRING

Þ Type X

TRUNC

REAL

Þ INT

Numeric functions
ABS

Absolute value

SQRT

Square root

LN

Natural logarithm

LOG

Logarithm to the base 10

EXP

Exponential function

SIN

Sine calculation in rad

COS

Cosine calculation in rad

TAN

Tangent calculation in rad

ASIN

Arcus sine calculation in rad

ACOS

Arcus cosine calculation in rad

ATAN

Arcus tangent calculation in rad

EXPT

Exponentiation of one variable with another

STRING functions
LEN

Indicates the string length

LEFT

Shows a left initial string

RIGHT

Shows a right initial string

MID

Shows a part of a string

CONCAT

Concatenation (connection) of two strings

INSERT

Inserts a string at a certain position into another string

DELETE

Deletes a part of a string

REPLACE

Replaces a part of a string by another part

FIND

Finds a part of a string

Show/Hide Bookmarks

Advertising