5 - 39 5 - 39
5 MELSEC FUNCTIONS
5.10 Logical Operation Commands
5.10.1 Logical product (2 devices) WAND_M
The specified two BIN 16-bit data are ANDed bit by bit.
Function definition
BOOL WAND_M (BOOL EN, ANY16 S1, ANY16 D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
IN
Data to AND (BIN 16-bit data)
D
IN/OUT
Data to be ANDed, operation result (BIN 16-bit data)
Remarks: For bit devices, the bits greater than in the digit specification are processed
as "0 (zero)".
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the 16-bit data in D0 and D10 are *)
(* ANDed bit by bit, and the result is stored into D10.
*)
WAND_M (X0, D0, D10);
Corresponding MELSEC command
WAND (16-bit data logical product)
5.10.2 Logical product (3 devices) WAND_3_M
The specified two BIN 16-bit data are ANDed bit by bit.
Function definition
BOOL WAND_3_M (BOOL EN, ANY16 S1, ANY16 S2, ANY16 D1);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
IN
Data to be ANDed (BIN 16-bit data)
S2
IN
Data to AND (BIN 16-bit data)
D1
OUT
Operation result (BIN 16-bit data)
Remarks: For bit devices, the bits greater than in the digit specification are
processed as "0 (zero)".
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the 16-bit data in D0 and D10 are *)
(* ANDed bit by bit, and the result is stored into D100.
*)
WAND_3_M (X0, D0, D10, D100);
Corresponding MELSEC command
WAND (16-bit data logical product)
For the usable data type, refer to "3.2.2
About ANY type".
Summary of Contents for MELSEC L series
Page 1: ...Programming Manual Structured Text ...
Page 2: ......
Page 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Page 297: ......