Letting Basic Make Decisions; Condition Specification - Mitsubishi QD51 Programming Manual

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

Advertisement

3 LET'S CREATE AND EXECUTE A PROGRAM

3.7 Letting BASIC Make Decisions

3.7.1 Condition specification

Symbol
Meaning
=
Equal to
<
Less than
>
Greater than
<=
Equal to or less than
(Including and up to)
=>
Equal to or greater than
(Including and more than)
<>
Not equal to
3 - 26
In BASIC, a program can be branched into different instructions based on whether or
not a specified condition is met.
The following symbols are used to specify conditions.
Example
A=B
A<B
A>B
A<=B
A>=B
A<>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'
Example A=B AND C=D
This is the same as the
@ symbol used for sets
in mathematics.
• When using 'OR'
Example A=B OR C=D
A=B
C=D
Area where the condition is met when OR is used
• • • • • • The condition is met when A and B are equal.
• • • • • • The condition is met when A is less than B.
• • • • • • The condition is met when A is greater than B.
• • • • • • The condition is met when A is less than or equal
to B.
• • • • • • The condition is met when A is greater than or
equal to B.
• • • • • • The condition is met when A is not equal to B.
• • • 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.
• • • The condition is met when A and B are equal and
C and D are equal.
A=B
C=D
Area where the condition
is met when AND is used
• • • 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.
• • • 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.
MELSEC-Q
3 - 26

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents