OR block

Short summary

Name

OR

→POU type

→function

Category

Standard (safe), Bitstring

Conform to →IEC-standard

(tick) no restrictions

Graphical interface

Available since

version 1.0.0 (for Neuron Power Engineer) - initial variant

version 3.8.0 (for library Standard (safe)): block provided in this library

Functionality

The block returns the result of a bitwise OR operation of all values connected to the inputs of ANY_BIT.

Compare: "IOR block" for OR operation for values of ANY_INT.

Inputs, return value

 

Identifier

→Data type

Description

Inputs:

IN1

 BOOLBYTEWORDDWORD or LWORD
(corresponds to →generic data type ANY_BIT

1st value

IN2

 BOOLBYTEWORDDWORD or LWORD
(corresponds to →generic data type ANY_BIT

2nd value

... (extensible until)

IN16

 BOOLBYTEWORDDWORD or LWORD
(corresponds to →generic data type ANY_BIT

16th value

Return value:

 BOOLBYTEWORDDWORD or LWORD
(corresponds to →generic data type ANY_BIT

 

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Example for usage within ST-editor

PROGRAM Test
    VAR
        resultB1, resultB2, resultB3, resultB4 : BOOL;
        resultW1, resultW2, resultW3, resultW4 : WORD;
    END_VAR
    
    resultB1 := OR(IN1 := FALSE, IN2 := FALSE);       (* The variable 'resultB1' evaluates to 'FALSE'. *)
    resultB2 := OR(IN1 := FALSE, IN2 := TRUE );       (* The variable 'resultB2' evaluates to 'TRUE'.  *)
    resultB3 := OR(IN1 := TRUE,  IN2 := FALSE);       (* The variable 'resultB3' evaluates to 'TRUE'.  *)
    resultB4 := OR(IN1 := TRUE,  IN2 := TRUE );       (* The variable 'resultB4' evaluates to 'TRUE'.  *)
    
    resultW1 := OR(IN1 := 16#0001, IN2 := 16#0001);   (* The variable 'resultW1' evaluates to '16#0001'. *)
    resultW2 := OR(IN1 := 16#0001, IN2 := 16#0002);   (* The variable 'resultW1' evaluates to '16#0003'. *)
    resultW3 := OR(IN1 := 16#0002, IN2 := 16#0001);   (* The variable 'resultW1' evaluates to '16#0003'. *)
    resultW4 := OR(IN1 := 16#0002, IN2 := 16#0002);   (* The variable 'resultW1' evaluates to '16#0002'. *)
END_PROGRAM

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.