31.12.2.4 Explanation of the OR and ORP Instructions

The OR and ORP instructions are logic OR instructions. When an OR instruction is executed, S1 and S2 are logically ORed and the result is stored in D1.

The OR and ORP instructions always pass power. When using the OR and ORP instructions, if the variables specified in operands S1, S2, and D1 are not the same type, an error will occurs. Designate the same variable type in all operands S1, S2, and D1.

Refer to the following for specifying a constant.

S1

Operator

S2

D1

OFF

OR

OFF

OFF

ON

OFF

ON

OFF

ON

ON

ON

ON

ON

When an OR instruction is executed, the D1 bit will be turned ON only when S1 and S2 are ON. Otherwise, the D1 bit is OFF.

When operand D1 is an integer variable

When operand D1 is an integer variable and you want to input hexadecimal values in operands S1 and S2.

When 0x (zero and lower case "x") is input, the following values become hexadecimal values.

When Calculating Data in a Specified Array (Integer Variable Array)

Specifying the entire array

Individually Specifying Array Variables