AND   ANDN   &PLCopen motion icon

Operator - Performs a logical AND of all inputs.

Inputs

IN1 : BOOL First Boolean input
IN2 : BOOL Second Boolean input

Outputs

Q : BOOL   Boolean AND of all inputs

Truth table

IN1

IN2

Q

0

0

0

0

1

0

1

0

0

1

1

1

Remarks

In FBDClosed"Function block diagram" A function block diagram describes a function between input variables and output variables. A function is described as a set of elementary blocks and FFLD languages, the block is called "&" and can have up to 16 inputs. To select the number, right-click on the block and choose the Set number of inputs command in the contextual menu.

In ILClosed"Instruction list" This is a low-level language and resembles assembly language, the AND instruction performs a logical AND between the current result and the operand. The current result must be Boolean. The ANDN instruction performs an AND between the current result and the Boolean negation of the operand. In STClosed"Structured text" A high-level language that is block structured and syntactically resembles Pascal and IL languages, "&" can be used instead of "AND".

ST Language

Q := IN1 AND IN2;
Q := IN1 & IN2 & IN3;

FBD Language

(* the block can have up to 16 inputs *)
And FBD

FFLD Language

And FFLD

IL Language:

Op1: FFLD  IN1
     &   IN2  (* "&" or "AND" can be used *)
     ST  Q    (* Q is equal to: IN1 AND IN2 *)
Op2: FFLD  IN1
     AND IN2
     &N  IN3  (* "&N" or "ANDN" can be used *)
     ST  Q    (* Q is equal to: IN1 AND IN2 AND (NOT IN3) *)

See also

OR   XOR   NOT