AND  ANDN  &

PLCopen motion icon

Operator - Performs a logical AND of all inputs.

Inputs

Input

Data Type

Range

Unit

Default

Description

IN1 BOOL       First Boolean input.
IN2 BOOL       Second Boolean input.

Outputs

Output

Data Type

Range

Unit

Description

Q

BOOL

 

 

Boolean AND of all inputs.

Remarks

  • In the FBD and FFLD languages, the block is called &.
    • To select the number, right-click on the block and choose the Set number of inputs command in the contextual menu.
  • In ST and IL languages, & can be used instead of AND.

Truth Table

IN1

IN2

Q

0

0

0

0

1

0

1

0

0

1

1

1

FBD Language Example

  • In the FBD Language, the block can have a maximum of 32 inputs.

FFLD Language Example

  • In the FFLD Language, the block can have a maximum of 32 inputs.

IL Language Example

  • In the IL Language, the AND instruction performs a logical AND between the current result and the operand.
    • The current result must be Boolean.
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) *)

ST Language Example

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

See Also