7 sizeof, 2 bit-string operators, 1 and – Lenze DDS v2.3 User Manual
Page 274: Sizeof, Drive plc developer studio

Drive PLC Developer Studio
IEC 61131-3 Operators
12-4
l
DDS EN 2.3
12.1.7
SIZEOF
The result of this function is the number of bytes required by the specified data type.
Examples
IL
Declaration
ST
Declaration
FBD
arr1:ARRAY[0..4] OF INT;
Var1:=INT;
Implementation
LD arr1
SIZEOF
ST Var1 (* Var1 = 10 *)
arr:ARRAY[0...4]OF INT;
Var1:INT;
Implementation
Var1=SIZE OF (arr1);
12.2
Bit-string operators
Types:
The operands of the following bit-string operators should be of type BOOL, BYTE, WORD or DWORD.
12.2.1
AND
Bit-by-bit AND of bit operands
Examples
IL
Var1 : BYTE;
LD
2#1001_0011
AND 2#1000_1010
ST
Var1
(* Var1 = 2#1000_0010 *)
FBD
ST
var1 := 2#1001_0011 AND 2#1000_1010
Note!
Make sure to observe the following when using 68xxx or C-code generators in the FBD for the
illustrated program sequence.
As soon as the input variable a assumes the value FALSE, the assignment of the value of the second
input variable at the AND operator organization unit to the variable z will no longer be performed as
a consequence of the optimized processing procedure within the FBD.
Show/Hide Bookmarks