2 Instruction Descriptions
2-286
NJ-series Instructions Reference Manual (W502)
AND (&), OR, and XOR
These instructions perform processing on Boolean variables or individual bits in bit stings.
* If you omit the input parameter that connects to InN, the default value is not applied, and a building error will occur. For
example, if N is 3 and the input parameters that connect to In1 and In2 are omitted, the default values are applied, but if the
input parameter that connects to In3 is omitted, a building error will occur.
AND (&): Logical AND
OR: Logical OR
XOR: Logical Exclusive OR
Instruction Name FB/FUN Graphic expression ST expression
AND (&) Logical AND FUN Out:=In1 AND ··AND InN;
Out:=In1 & ··& InN;
OR Logical OR FUN Out:=In1 OR ··OR InN;
XOR Logical Exclusive
OR
FUN Out:=In1 XOR ··XOR InN;
Variables
Name Meaning I/O Description Valid range Unit Default
In1 to InN Data to
process
Input Data to process, where N is
2 to 5
Depends on data type.
--- 0*
Out Processing
result
Output Processing result Depends on data type.
--- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In1 to InN OKOKOKOKOK
Out Must be same data type as In1 to InN
(@)AND
EN ENO
In1 Out
:
InN
:
(@)&
EN ENO
In1 Out
:
InN
:
(@)OR
EN ENO
In1 Out
:
InN
:
(@)XOR
EN ENO
In1 Out
:
InN
: