AND   ANDN   &

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 FBD language, the block may have up to 16 inputs. The block is called "&" in FBD language. In LD language, an AND operation is represented by serialized contacts. In IL 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 ST and IL languages, "&" can be used instead of "AND".

ST Language

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

FBD Language

(* the block may have up to 16 inputs *)
AndFbd.gif (1624 octets)

LD Language

(* serialized contacts *)
AndLd.gif (1167 octets)

IL Language:

Op1: LD  IN1
     &   IN2  (* "&" or "AND" can be used *)
     ST  Q    (* Q is equal to: IN1 AND IN2 *)
Op2: LD  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