2 Instruction Descriptions
2-16
NJ-series Instructions Reference Manual (W502)
AND and ANDN
None
z AND
The AND instruction takes the logical AND of the value of a specified BOOL variable and the execution
condition and outputs it to the next instruction. Use the AND instruction for a NO bit connected in series
with the previous instruction.
z ANDN
The ANDN instruction takes the logical AND of the inverse of the value of a specified BOOL variable
and the execution condition and outputs it to the next instruction. Use the ANDN instruction for a NC bit
connected in series with the previous instruction.
The following figure shows a programming example of the AND instruction. It takes the logical AND of
variable A and variable B and outputs it to variable C.
AND: Takes the logical AND of the value of a BOOL variable and the execution condition.
ANDN: Takes the logical AND of the inverse of the value of a BOOL variable and the execution
condition.
Instruction Name FB/FUN Graphic expression ST expression
AND AND --- result:=vBool1 AND vBOOL2;
result:=vBool1 & vBool2;
ANDN AND NOT --- result:=vBool1 AND NOT
vBool2;
Variables
Function
Upward
differentiation
Downward
differentiation
Variable
Variable Variable
Upward
differentiation
Downward
differentiation
Variable
Variable Variable
B
A
C
LD
instruction
Out
instruction
AND
instruction