![Mitsubishi Electric A173UHCPU Programming Manual Download Page 372](http://html.mh-extra.com/html/mitsubishi-electric/a173uhcpu/a173uhcpu_programming-manual_238567372.webp)
APPENDICES
APP
−
55
4.3
Magnitude Comparison and Four Fundamental Operations of 32-Bit Monitor Data
When a machine value, real current value or deviation counter value is used to
perform magnitude comparison or four fundamental operations, the value must be
transferred to another device memory once and the device memory of the transfer
destination be used to perform processing as described below.
(1) Magnitude comparison example
(a) To set the device when the machine value has become more than the set
value
Magnitude comparison execution command
D1
S
DMOV
D3
SET
D2
D1
D>
1) S, D1, D2 and D3 indicate the following.
S
: Machine value
D1 : Device memory for temporary storage
D2 : Set value for magnitude comparison
D3 : Device for setting magnitude comparison result
(b) When one piece of monitor data is referred to many times to perform
comparison processing, intended operation may not be performed if the
monitor data is transferred every processing as shown in program example 1.
In program example 1, neither Y1 nor Y2 may turn ON. (This also applies to
the case of 16-bit monitor data.)
This is because the S value varies asynchronously with the sequencer scan.
To perform such processing, transfer the monitor data to another device
memory once, and after that, use that value to perform comparison
processing as shown in program example 2.
[Program example 1]
D1
S
DMOV
Y1
D2
D1
D>
D2
D1
D<=
D1
S
DMOV
S may vary
in this section.
Y2
Magnitude comparison execution command
[Program example 2]
D1
S
DMOV
Y1
D2
D1
D>
D2
D1
D<=
Y2
Magnitude comparison execution command
1) S, D1, D2, Y1 and Y2 indicate the following.
S : Machine value
D1 : Device memory for temporary storage
D2 : Set value for magnitude comparison
Y1 : Magnitude comparison result output device (Result: more than)
Y2 : Magnitude comparison result output device (Result: Equal to or less than)