4 memory access functions, Memory access functions, Plc programming – Lenze ETC Motion Control User Manual
Page 393
PLC programming
Library
Memory access functions
8.8
8.8.4
l
393
EDSTCXN EN 2.0
8.8.4
Memory access functions
8.8.4.1
DEFDATATYPES
FUNCTION DEFDATATYPES: BYTE
VAR_INPUT
iRange
: INT;
sDescriptor
: STRING(255);
END_VAR
The function defines the data types in DB2 and thereby the required byte
swapping during the data transfer between NCR and MMI.
Currently, two ranges are being differentiated:
Range 1 of word 0 ... 127 contains data from the PLC to MMI, range 2 of word
128 ... 191 contains data from MMI to the PLC. A descriptor string is used to
define the data types. 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 a value of 1 if the function has been completed
successfully, otherwise a value of 0.
Declaration
Description