Plc programming – Lenze ETC Motion Control User Manual

Page 396

Advertising
background image

PLC programming

Library
Memory access functions

8

8.8
8.8.4

l

396

EDSTCXN EN 2.0

8.8.4.5

MEMSET

FUNCTION MEMSET: BOOL

VAR_INPUT

pMem

: DINT;

(* memory address *)

bValue

: DINT;

(* value *)

dwSize

: DINT;

(* number of bytes *)

END_VAR

dwSize bytes after memory address pMem with a value bValue will be
written.

feld_ab

: ARRAY[0..10] OF BYTE;

MEMSET( ADR(feld_ab[0]), 0, SIZEOF(feld_ab) );

8.8.4.6

OVESWAPPED

FUNCTION MOVESWAPPED: DINT

VAR_INPUT

pDestination

: DINT;

(* memory address *)

pSource

: DINT;

(* memory address *)

sDescstring

: STRING(255);

(* Data description string *)

END_VAR

The function copies data from the memory address pDestination to the
memory address pSource. The data are copied swapped in accordance with
the descriptor string defined.

The descriptor string has the following format:

<number><type><number><type>...

Number is a decimal number and defines then data quantity for the
following type.

Type is a lower−case letter describing the size of the data type as follows:

Type

Codesys data type

Size

B

BYTE

8 Bit

W

BOOL, WORD, INT

16 Bit

D

DWORD, DINT, REAL

32 Bit

l

LREAL

64 Bit

The function returns as value the number of bytes copied.

Declaration

Description

Example

Declaration

Description

Advertising