Move, Sizeof, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 1049

Advertising
background image

L-force | PLC Designer

Programming Reference

DMS 4.1 EN 03/2011 TD29

1047

MOVE
IEC Operator: Assignment of a variable to another variable of an appropriate type.
As MOVE is available as a box in the graphic editors FBD, LD, CFC, there the (unlocking)
EN/EN0 functionality can also be applied on a variable assignment.

Example in CFC in conjunction with the EN/EN0 function:
Only if en_i is TRUE, var1 will be assigned to var2.

Beispiel in AWL: (Result: var2 gets value of var1)

( ! you get the same result with:

)

Beispiel in ST:

ivar2 := MOVE(ivar1);

( ! you get the same result with: ivar2 := ivar1; )

SIZEOF
This arithmetic operator is not prescribed by the standard IEC 61131-3.
It can be used to determine the number of bytes required by the given variable x.
The SIZEOF operator returns an unsigned value. The type of the return value will be
adapted to the found size of variable x.

return value of SIZEOF(x)

data type of the constant implicitly used for the found size

0 <= size of x < 256

USINT

256 <= size of x < 65536

UINT

65536 <= size of x < 4294967296

UDINT

4294967296 <= size of x

ULINT


Example in ST:

var1 := SIZEOF(arr1); (* d.h.: var1:=USINT#10; *)

Advertising