Name Data type Description
[D+6] Write pointer
Unsigned 16-bit
integer
The relative number from [D+7] is stored. The value is reset
to 0 when the DEFRBUF instruction is executed. The value is
incremented when data is written by the RBUFW instruction.
The value returns to 0 when the RBUFW instruction is
executed at the end of the data area.
[D+7]
Buffer data
area
Unsigned 16-bit
integer
Signed 16-bit
integer
Data is written by the RBUFW instruction.
----
[D
+7+n-1]
■
Processing
1. [n] (buffer size) is specified in [D] (buffer start).
2. The range from [D+1] (stored data amount) to [D+6] (write pointer) is cleared to zero.
Example) n=U4, D=DT0
K 1
K 0
K 2
K 3
K 4
K 5
K 6
K 7
K 8
K 9
K 10
DT1
DT2
DT3
DT0
DT4
DT5
DT6
DT7
DT8
DT9
DT10
U 4
K 0
SF 0.0
U 0
K 5
K 6
K 7
K 8
Buffer size
Stored data amount
Total
Average
Write pointer
U 0
DT1
DT2
DT3
DT0
DT4
DT5
DT6
DT7
DT8
DT9
DT10
■
Precautions for programming
● When this instruction is executed, data in the ring buffer area is not cleared. Use a data
transfer instruction or other instructions to reset the area, if necessary.
● Do not use other instructions than the RBUFW instruction to write data into the ring buffer.
The calculation of total value and moving average value are not guaranteed.
■
Flag operations
Name Description
SR7
SR8
(ER)
To be set in the case of out-of-range in indirect access (index modification).
To be set when [n] (buffer size) is out of the available range.
To be set when the range of [D (the beginning of a buffer) + n (buffer size)] is out of the
accessible range.
8.21 DEFRBUF (Ring Buffer Definition)
8-46 WUME-FP7CPUPGR-12