Programming instructions
87
INLINE COMPARISONS
Unlike all the function blocks discussed so far, the inline compare instructions
can be placed anywhere within the rung. They function in the same way as an
input contact. These instructions are only available on the FX1S, FX1N,
FX2N(C) and FX3U PLCs. These commands were not available on legacy FX
PLCs.
If the data register (D0) is less than the decimal constant (K10), the circuit
conducts.
Comparison Function 16-Bit Data 32-Bit Data
Greater Than > D>
Equal To = D=
Less Than < D<
Greater Than Equal >= D>=
Not Equal <> D<>
Less Than Equal <= D<=
Imagine the operator is between Source 1 and Source 2. The above instruction
actually reads: Check if D0 < K10 (the value in D0 is less than 10)
The inline comparison instructions support a prefix of D so any of the
comparisons can be done on 32-bit numbers.
It is possible to look at the accumulated value of a timer or counter and do a
comparison. This allows you to turn on different outputs at different times or
count values, but only using one timer or counter. The rung below shows how to
turn on output Y1 when T10 has reached 6 seconds.
Further note on all compares
The compare, zone compare and inline compare instructions shown above are
16 bit instructions. As described at the beginning of the chapter, if a 32 bit
comparison is required, it is necessary to add a āDā to the instruction, this we
have DCMP, DZCP, and for inline compares, D=, D>, etc.
This is crucial to remember in the case of up/down and high speed counters.
These counters are 32 bit instructions and will not function properly with a
standard comparison instruction.