Compare Instructions - Mitsubishi MELSEC System Q Manual

Hide thumbs Also See for MELSEC System Q:
Table of Contents

Advertisement

Compare Instructions

6.3
Compare Instructions
Checking the status of bit devices like inputs and relays can be achieved with basic logic
instructions because these devices can only have two states, "0" and "1". However, you will
also often want to check the contents of word devices before doing something – for example
switching on a cooling fan when a specified setpoint temperature is exceeded.
To achieve this an output instruction or an logical operation can be made conditional on the
result of a compare instruction. In addition to the compare instructions described here the PLC
CPUs of the MELSEC System Q can compare also floating decimal point values, binary block
data and character strings.
For comparisons MELSEC and IEC instructions are available.
Comparison at the beginning of a logic operation
Ladder Diagram
³ Compare condition
· First value to be compared
» Second value to be compared
If the condition evaluates true the signal state after the comparison is set to "1". A signal state of
"0" shows that the comparison evaluated as false. In the above example the relay M10 is set
when the contents of data register D40 is greater than or equal to the contents of data register
D50.
The following comparisons are possible:
Compare for "equals":
IEC instruction:
The output of the instruction is only set to "1" if the values of both devices are identical.
Compare for "greater than":
IEC
The output of the instruction is only set to "1" if the first value is greater than the second value.
Compare for "less than":
IEC instruction:
The output of the instruction is only set to "1" if the first value is smaller than the second value.
Compare for "not equal":
IEC instruction:
The output of the instruction is only set to "1" if the two values are not equal.
Compare for "less than or equal to":
IEC instruction:
6 – 22
This instruction is equivalent to the "wiring" of
the EN input in the Ladder Diagram. "TRUE"
means that the input condition is always
fulfiled.
instruction:
=
(value 1 = value 2)
EQ
( Equal )
>
(value 1 > value 2)
GT
( Greater Than )
<
(value 1 < value 2)
LE
( Less Than )
<>
(value 1 <> value 2)
( Not Equal )
NE
<=
(value 1
( Less Equal )
LE
More Advanced Programming
MELSEC Instruction List
LD>=
D40
D50
OUT
M10
IEC Instruction List
LD
TRUE
LD_GE_M
D40, D50
ST
M10
value 2)
MITSUBISHI ELECTRIC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents