beginning of the ring buffer area. However, the area [D+1] for the stored data amount is not
changed.
■
Precautions for programming
● According to the operation unit [i], set the value of [S] that is written to the buffer data area.
■
Processing
Example 1) When data is written once by the RBUFW instruction with the buffer size
of 5
[D]...DT0
U 5
K 0
SF 0.0
[S]...DT20
K 1
K 3
K 2
K 5
DT0
DT1
DT2
DT3
DT4
DT5
DT6
DT7
DT8
DT9
DT10
DT11
[D]
[D+1]
[D+2]
[D+3]
[D+4]
[D+5]
[D+6]
[D+7]
[D+8]
[D+9]
[D+10]
[D+11]
U 0
U 0
K 1
U 5
K 33
SF 3.30E+01
K 1
K 3
K 5
K 2
U 1
U 1
K 33
K 33DT20[S]
Buffer size
Amount of stored data
Total value
Moving average value
Write pointer
0th
First
Second
Third
Fourth
DT0
DT1
DT2
DT3
DT4
DT5
DT6
DT7
DT8
DT9
DT10
DT11
[D]
[D+1]
[D+2]
[D+3]
[D+4]
[D+5]
[D+6]
[D+7]
[D+8]
[D+9]
[D+10]
[D+11]
Example 2) When data is written five times by the RBUFW instruction with the buffer
size of 5
[D]...DT0
U 5
K 206
SF 5.15E+01
[S]...DT20
K 67
K 54
K 52
K 33
U 4
U 4
K 5
U 5
K 261
SF 5.22E+01
K 67
K 54
K 33
K 52
U 5
U 0
K 55
K 55DT20[S]
DT0
DT1
DT2
DT3
DT4
DT5
DT6
DT7
DT8
DT9
DT10
DT11
[D]
[D+1]
[D+2]
[D+3]
[D+4]
[D+5]
[D+6]
[D+7]
[D+8]
[D+9]
[D+10]
[D+11]
Buffer size
Amount of stored data
Total value
Moving average value
Write pointer
0th
First
Second
Third
Fourth
DT0
DT1
DT2
DT3
DT4
DT5
DT6
DT7
DT8
DT9
DT10
DT11
[D]
[D+1]
[D+2]
[D+3]
[D+4]
[D+5]
[D+6]
[D+7]
[D+8]
[D+9]
[D+10]
[D+11]
8.22 RBUFW (Write to Ring Buffer, Calculation of Total Value and Moving
Average Value)
8-48 WUME-FP7CPUPGR-12