Boolean AND (BAND)
The BAND instruction logically ANDs up to eight Boolean inputs. To perform a bitwise AND, refer to
Bitwise And (AND)
.Available Languages
Ladder Diagram
This instruction is not available in ladder diagram.
Function Block Diagram
Function Block Diagram supports these elements:
FBD Block

FBD Function

Structured Text
This instruction is not available in structured text.
Operands
Function Block Diagram
FBD Block
Operand | Data Type | Format | Description |
|---|---|---|---|
BAND tag | FBD_BOOLEAN_AND | structure | BAND structure |
FBD_BOOLEAN_AND Structure
Input Members | Data Type | Description |
|---|---|---|
EnableIn | BOOL | Enable input. If cleared, the instruction does not execute and outputs are not updated.
Default is set. |
In1 | BOOL | First Boolean input.
Set to 1 on first download. |
In2 | BOOL | Second Boolean input.
Set to 1 on first download. |
In3 | BOOL | Third Boolean input.
Set to 1 on first download. |
In4 | BOOL | Forth Boolean input.
Set to 1 on first download. |
In5 | BOOL | Fifth Boolean input.
Set to 1 on first download. |
In6 | BOOL | Sixth Boolean input.
Set to 1 on first download. |
In7 | BOOL | Seventh Boolean input.
Set to 1 on first download. |
In8 | BOOL | Eighth Boolean input.
Set to 1 on first download. |
Output Members | Data Type | Description |
|---|---|---|
EnableOut | BOOL | Indicates if instruction is enabled. |
Out | BOOL | The output of the instruction. |
FBD Function
Input Operands (Left Pins) | Data Type | Description |
|---|---|---|
In1 | BOOL | First Boolean input |
In2 | BOOL | Second Boolean input |
Output Operand (Right Pin) | Data Type | Description |
|---|---|---|
Out | BOOL | The output of the instruction. |
See FBD Functions.
Operation
FBD Block
The BAND instruction ANDs up to eight Boolean inputs. If an input is not used, it defaults to set (1).
Out = In1 AND In2 AND In3 AND In4 AND In5 AND In6 AND In7 AND In8
IMPORTANT:
When removing an input wire from the BAND instruction during an edit,
make sure the input is set (1).
FBD Function
The FBD Function ANDs two Boolean inputs.
Out = In1 AND In2
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction.
Execution
Function Block Diagram
FBD Block
Condition/State | Action Taken |
|---|---|
Prescan | EnableIn and EnableOut bits are cleared to false. |
Tag.EnableIn is false | EnableIn and EnableOut bits are cleared to false. |
Tag.EnableIn is true | EnableIn and EnableOut bits are set to true. The instruction executes as described in the Operation section. |
Instruction first run | N/A |
Instruction first scan | N/A |
Postscan | EnableIn and EnableOut bits are cleared to false. |
FBD Function
Condition/State | Action Taken |
|---|---|
Prescan | N/A |
Normal Scan | Out = In1 AND In2 |
Instruction first run | N/A |
Instruction first scan | N/A |
Postscan | N/A |
Example
Function Block Diagram
FBD Block
In this example, bool_in1 is copied into BAND_02.In1, bool_in2 is copied into BAND_02.In2, the result of performing AND of all BAND_02 inputs is placed into BAND_02.Out, and BAND_02.Out is then copied into value_result_and.
If bool_in1 is: | If bool_in2 is: | Then value_result_and is: |
|---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |

FBD Function
This example illustrates performing an AND on bool_in1 and bool_in2 and places the result in value_result_and.

Provide Feedback