6.1.3.5.2 OR
Function
Perform an "OR" operation on the value of IN1 and the value of IN2 according to binary bits, and output the result at OUT
LD Graphics
Parameter description
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| IN1 | Var_Input | ANY_BIT | Operand |
| IN2 | Var_Input | ANY_BIT | Operand |
| OUT | Var_Output | ANY_BIT | Output result |
warning
- OR is an extensible function, and inputs can be added by clicking the "+" in the graph
- IN1...INn data types need to be consistent and the same as OUT
- ANY_BIT data types include BYTE, WORD, DWORD, and LWORD
Example
Perform an "OR" operation on bit 0 of the value input to IN1 and bit 0 of the value input to IN2. The result is stored in bit 0 of the output OUT. Performs the same logical operation on all bits of the specified variable. As shown in the figure below, the result of 15 "or" 36 is 47
| Operand | Value |
|---|---|
| IN1 | 0000 1111 |
| IN2 | 0010 0100 |
| OUT | 0010 1111 |
