3 - 26 3 - 26
MELSEC-Q
3 LET'S CREATE AND EXECUTE A PROGRAM
3.7 Letting BASIC Make Decisions
In BASIC, a program can be branched into different instructions based on whether or
not a specified condition is met.
3.7.1 Condition specification
The following symbols are used to specify conditions.
Symbol
Meaning
Example
=
Equal to
A=B
• • • • • • The condition is met when A and B are equal.
<
Less than
A<B
• • • • • • The condition is met when A is less than B.
>
Greater than
A>B
• • • • • • The condition is met when A is greater than B.
<=
Equal to or less than
(Including and up to)
A<=B
• • • • • • The condition is met when A is less than or equal
to B.
=>
Equal to or greater than
(Including and more than)
A>=B
• • • • • • The condition is met when A is greater than or
equal to B.
<>
Not equal to
A<>B
• • • • • • The condition is met when A is not equal to B.
More conditions can be created by combining these symbols with the logical operators
'AND' and 'OR.' When a condition is combined with another condition, they are referred
to as "logical expressions."
• When using 'AND'
• • • Conditions are connected using the logical
operator 'AND.' There is no restriction on the
number of conditions that can be connected using
the logical operator.
Example A=B AND C=D
• • • The condition is met when A and B are equal and
C and D are equal.
This is the same as the
@ symbol used for sets
in mathematics.
C=D
A=B
Area where the condition
is met when AND is used
• When using 'OR'
• • • Conditions are connected using the logical
operator 'OR.' There is no restriction on the
number of conditions that can be connected using
the logical operator.
Example A=B OR C=D
• • • The condition is met when A and B are equal or C
and D are equal.
This is the same as the @ symbol
used for sets in mathematics.
A=B
C=D
Area where the condition is met when OR is used
Содержание 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...