OR

OR Connection

The content of the accumulator is connected with the operand defined in the operand field by a logical OR operation. The result is transferred to the accumulator.

Parameters

Input

Unnamed input (BOOL, WORD, DWORD)

1st input: element 1 of logical OR operation

Unnamed input (BOOL, WORD, DWORD)

2nd input: element compared to input 1

Output

Unnamed output (BOOL, WORD, DWORD)

Output as input: result

Remarks

  • All operands must be of the same data type.
  • This function can be expanded to a maximum of 28 input contacts, see also modifying elements.

Truth table:

Input 1

Input 2

Output

Signal

0

0

0

1

0

1

0

1

1

1

1

1

Example

POU header

All input and output variables used for programming this function have been declared in the POU header.The same POU header is used for all programming languages.

	VAR
		bvar_1: BOOL:=FALSE;
			(*Input_1*)
		bvar_2: BOOL:=FALSE;
			(*Input_2*)
		bvar_3: BOOL:=FALSE;
			(*Input_3*)
		bvar_4: BOOL:=FALSE;
			(*Output*)
	END_VAR

ST body

bvar_3:= var_1 OR bvar_2;

IL body

LD

bvar_1

(* Load bvar_1 in accu *)

OR

bvar_2

(* Perform an OR of accu with bvar_2; store result in accu *)

ST

bvar_3

(* Store accu in bvar_3 *)

Modified on: 2019-01-24Feedback on this pagePanasonic hotline