8 library, 1 general functions, Library – Lenze ETC Motion Control User Manual

Page 361: General functions, Plc programming

Advertising
background image

PLC programming

Library

General functions

8

8.8

8.8.1

l

361

EDSTCXN EN 2.0

8.8

Library

The functions and functional blocks of the two axis representations ETCxC
and ETCxM are the same barring a few exceptions. Nonetheless there is an
ETC system library for each variant:

ETCxC: SysEtc.LIB

ETCxM: SysETCxM.LIB

All functions are described in detail below. They are found in both libraries.
Special functions of the variant are highlighted.

8.8.1

General functions

8.8.1.1

CenterString

FUNCTION CenterString: INT

VAR_INPUT

string_s

: STRING(255)

(* String, which is to be reformatted *)

linelen_di

: DINT

(* line length for centering *)

END_VAR

The function adds spaces to the string for centering. The return value
corresponds to the resulting total length of the string.

Ensure that the string variable declared is large enough to accommodate the
resulting string!

test_s

: STRING (20):= ’Hello’;

CenterString(test_s, 20);

Invoking CenterString will insert 7 spaces before "Hello".

8.8.1.2

FMOD

FUNCTION FMOD: LREAL

VAR_INPUT

x: LREAL;

y: LREAL;

END_VAR

The function returns the floating point Rest of Division x/y (with the prefix
of x).

Result_lr

: LREAL;

Result_lr

:= FMOD(10.5, 3.2); Result_lr = 0.9

Declaration

Description

Example

Declaration

Description

Example

Advertising