800
19 STANDARD BITWISE BOOLEAN FUNCTIONS
19.1 AND Operation, OR Operation, XOR Operation
2. OR(_E)
• These functions perform the logical OR on the BOOL, WORD, or DWORD type data input in (s1) to (s28) bit by bit, and
output the operation result from (d) in the same data type as (s).
When the data type is WORD
3. XOR(_E)
• These functions perform the exclusive logical OR on the BOOL, WORD, or DWORD type data input in (s1) to (s28) bit by
bit, and output the operation result from (d) in the same data type as (s).
When the data type is WORD
• When three or more variables (s) exist, XOR is performed between (s1) and (s2) first, and XOR is successively performed
between the result and (s3). When the expression includes (s4), XOR is performed between the result of XOR with (s3) and
(s4). In this manner, XOR is repeated by the number of variables (s) in the order with (s5), (s6), and so on.
When the data type is BOOL
â– Operation result
1. Function without EN/ENO
The operation processing is executed. The operation output value is output from (d).
2. Function with EN/ENO
The following table lists the execution conditions and operation results.
*1 When FALSE is output from ENO, data output from (d) is undefined. In that case, modify a program so that the data output from (d) is
not used.
There is no operation error.
Execution condition Operation result
EN ENO (d)
TRUE (Executes operation) TRUE Operation output value
FALSE (Stops operation) FALSE
*1
Indefinite value
001000000 0110100
011110011 0111111
011110011 0001111
Logical Word OR
OR
(s1)
(s2)
(d)
111011000 1110000
010001101 1011010
101010101 0101010
Logical Exclusive OR
XOR
(s1)
(s2)
(d)
XOR
TRUE
TRUE
FALSE
Result
XOR
TRUE
FALSE
TRUE
Result
XOR
TRUE
TRUE
FALSE
Result
XOR
TRUE
FALSE
TRUE
Result
For 3 INs For 4 INs For 5 INs
(s1)
(s2) (s3) (s4) (s5)
XOR is repeated by the
number of variables (s).