Logical Operators - Mitsubishi QD51 Programming Manual

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

2 THE BASICS OF AD51H-BASIC

2.10.3 Logical operators

1) NOT; Negation
X
1
0
3) OR; Disjunction
X
1
1
0
0
5) IMP; Implication
X
1
1
0
0
2 - 21
Logical operators perform bitwise operations or Boolean operations.
Logical operators provide the value "True" (other than 0) or "False" (0).
In an expression, logical operations will be performed after arithmetic calculations and
relational calculations.
The results of logical calculations are as follows. Each operator is listed in the order of
highest priority to lowest priority, 1) to 6).
NOT X
0
1
Y
X OR Y
1
1
0
1
1
1
0
0
Y
X IMP Y
1
1
0
0
1
1
0
1
Like relational operators, two or more relations can be tied together by logical
operators to determine the flow of the program, providing a conclusion of True or
False.
Example
D<200 AND F<4
1>10 OR K<0
NOT P
2) AND; Conjunction
4) XOR; Inequivalence (exclusive OR)
6) EQV; Equivalence
• • • • •
True when D is less than 200 and F is less than 4.
• • • • •
True when I is greater than 10 or K is less than 0.
• • • • •
True when P is equal to 0.
X
Y
1
1
1
0
0
1
0
0
X
Y
1
1
1
0
0
1
0
0
X
Y
1
1
1
0
0
1
0
0
MELSEC-Q
X AND Y
1
0
0
0
X XOR Y
0
1
1
0
X EQV Y
1
0
0
1
2 - 21

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents