beautypg.com

Plc programming – Lenze ETC Motion Control User Manual

Page 395

background image

PLC programming

Library

Memory access functions

8

8.8

8.8.4

l

395

EDSTCXN EN 2.0

8.8.4.2

GET_BYTE, GET_WORD, GET_DWORD, GET_INT, GET_DINT, GET_REAL, GET_LREAL

FUNCTION GET_

TYPE : BYTE

VAR_INPUT

pAddress

: DINT;

(* memory address *)

END_VAR

The functions GET_TYPE read the corresponding data type TYPE from the
address stated and carry out the required byte swapping (see also
DEFDATATYPES).

8.8.4.3

MEMCOMP

FUNCTION MEMCOMP: INT

VAR_INPUT

pMem1

: DINT;

(* memory address *)

pMem2

: DINT;

(* memory address *)

diSize

: DINT;

(* number of bytes *)

END_VAR

The memory areas Mem1 and Mem2 are compared in bytes.

Return value

0: if the content is identical

1: if the content of Mem1 > Mem2

−1: if the content of Mem1 < Mem2

8.8.4.4

MEMCOPY

FUNCTION MEMCOPY: BOOL

VAR_INPUT

ziel_p

: DINT;

(* memory address *)

daten.dat

: DINT;

(* memory address *)

anzahl_di

: DINT;

(* number of bytes *)

END_VAR

The anzahl_di bytes after memory address quelle_p are read and entered
after memory address ziel_p.

The return value of the function is of no consequence.

ret_bit

: BOOL;

feld1_ab

: ARRAY[0..10] OF BYTE;

feld2_ab

: ARRAY[0..5] OF BYTE;

MEMCOPY(ADR(feld1_ab[4]), ADR(feld2_ab[2]), 4);

MEMCOPY(ADR(feld2_ab[0]), ADR(feld1_ab[2]), SIZEOF(feld2_ab));

Declaration

Description

Declaration

Description

Declaration

Description

Example