8.22 RBUFW (Write to Ring Buffer, Calculation of Total Value and
Moving Average Value)
■
Ladder diagram
■
Available operation units (●: Available)
Operatio
n unit
bit US SS UL SL SF DF
i ● ●
■
List of operands
Operand Description
S The device address storing written data, or the constant
D Starting device address of a ring buffer
■
Available devices (●: Available)
Operan
d
16-Bit device:
32-Bit
device:
Integer
Real
numbe
r
St
rin
g
Index
modifie
r
W
X
W
Y
W
R
W
L
W
S
S
D
D
T
L
D
U
M
WI
W
O
TS
C
S
TE
C
E
IX
K
(N
ote
1)
U
(N
ote
2)
H SF
D
F
" "
S ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
D ● ● ●
(Note 1) Can be specified only when the operation unit is signed integer (SS).
(Note 2) Can be specified only when the operation unit is unsigned integer (US).
■
Outline of operation
● This instruction writes data to the buffer data area of the ring buffer that is defined by the
DEFRBUF instruction, and calculates the total value and the moving average value.
● This instruction writes the data specified by [S] to the buffer data area of the ring buffer that
starts from [D].
● This instruction stores the total value of the data in [D+2, D+3] and the moving average value
in [D+4, D+5].
● [D+1] (stored data amount) and [D+6] (write pointer) are incremented (+1).
● After incrementing, if "[D+6] (write pointer) is equal to [D] (buffer size)", [D+6] (write pointer)
is set to 0. When this instruction is executed the next time, the data is overwritten from the
8.22 RBUFW (Write to Ring Buffer, Calculation of Total Value and Moving
Average Value)
WUME-FP7CPUPGR-12 8-47