2 - 21 2 - 21
MELSEC-Q
2 THE BASICS OF AD51H-BASIC
2.10.3 Logical operators
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).
1) NOT; Negation
2) AND; Conjunction
X
NOT X
X
Y
X AND Y
1
0
1
1
1
0
1
1
0
0
0
1
0
0
0
0
3) OR; Disjunction
4) XOR; Inequivalence (exclusive OR)
X
Y
X OR Y
X
Y
X XOR Y
1
1
1
1
1
0
1
0
1
1
0
1
0
1
1
0
1
1
0
0
0
0
0
0
5) IMP; Implication
6) EQV; Equivalence
X
Y
X IMP Y
X
Y
X EQV Y
1
1
1
1
1
1
1
0
0
1
0
0
0
1
1
0
1
0
0
0
1
0
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
• • • • •
True when D is less than 200 and F is less than 4.
1>10 OR K<0
• • • • •
True when I is greater than 10 or K is less than 0.
NOT P
• • • • •
True when P is equal to 0.
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...