5 - 10 5 - 10
5 MELSEC FUNCTIONS
5.4 Comparison Operation
5.4.1 Block data comparison (=) BKCMP_EQ_M
n points of BIN 16-bit data (word unit), starting at the specified devices, are compared in terms of "=".
Function definition
BOOL BKCMP_EQ_M (BOOL EN, ANY16 S1, ANY16 S2, ANY16 n, BOOL D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1 IN
Compared data (BIN 16-bit data)
S2 IN
Comparison data (BIN 16-bit data)
n IN
Number of data to be compared (BIN 16-bit data)
When comparison
condition is satisfied
ON
D OUT
Comparison
result (bit)
Comparison
result
When comparison
condition is not satisfied OFF
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the data of the number of points stored *)
(* in D0, starting at D100, is compared with the data of the number of points stored *)
(* in D0, starting at D200, in terms of "=", and the result stored into M0 and later.
*)
BKCMP_EQ_M (X0, D100, D200, D0, M0);
Corresponding MELSEC command
BKCMP= (BIN block data comparison (=))
5.4.2 Block data comparison (<>) BKCMP_NE_M
n points of BIN 16-bit data (word unit), starting at the specified devices, are compared in terms of "<>".
Function definition
BOOL BKCMP_NE_M (BOOL EN, ANY16 S1, ANY16 S2, ANY16 n, BOOL D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1 IN
Compared data (BIN 16-bit data)
S2 IN
Comparison data (BIN 16-bit data)
n IN
Number of data to be compared (BIN 16-bit data)
When comparison
condition is satisfied
ON
D OUT
Comparison
result (bit)
Comparison
result
When comparison
condition is not satisfied OFF
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the data of the number of points stored in *)
(* D0, starting at D100, is compared with the data of the number of points stored *)
(* D0, starting at D200, in terms of "<>", and the result is stored into M0 and later. *)
BKCMP_NE_M (X0, D100, D200, D0 M0);
Corresponding MELSEC command
BKCMP<> (BIN block data comparison (<>))
For the usable data type, refer to "3.2.2
About ANY type".
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......