Skip to main content

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

alt text

Parameter description

Interface variableDeclarationData typeDescription
IN1Var_InputANY_BITOperand
IN2Var_InputANY_BITOperand
OUTVar_OutputANY_BITOutput 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

OperandValue
IN10000 1111
IN20010 0100
OUT0010 1111

alt text