Arithmetic instructions
499
Part III FP Instructions
F99_CMPW
Data table shift-in and compress
Data specified by s is shifted in to the area specified by d1 (starting address).
Non-zero data is shifted (compressed) in sequential order, in the direction of the higher address in
the specified range.
d1
K0
K0
K1
d2
d1
K0
K4
K3
K2
K1
d2
s
K2
K3
K4
Starting area d1 and ending area d2 should be the same type of operand.
Be sure to specify d1 and d2 with "d1 d2".
If the content of s is "0", only a compressed shift is carried out.
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
PLC types
Availability of F99_CMPW (see page 1326)
For an example on how to construct a FIFO buffer using F/P99 and F/P98, see
Example 2 from F/P98.
Variable Data type Function
s data to be shifted in
d1 starting address of area that is compressed into which
data from s is shifted
d2
ANY16
end address of area where data is compressed
For Relay T/C Register Constant
s WX WY WR WL SV EV DT LD FL dec. or hex.
d1, d2 - WY WR WL SV EV DT LD FL -
Description
Shifts in data to the smallest address of the specified data table and compresses the data in the
table toward the higher address. The data in the table specified by d1 and d2 is rearranged as
follows:
Data types
Operands