Chapter 4. Ladder Diagram (LD) Programming
188
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C
4.9.10
Table Write
The Table Write (TBL_WRT) function sequentially updates values in a
table that never becomes full. When the pointer (PTR) reaches the end
of the table, it automatically returns to the beginning of the table.
Mnemonics:
TBL_WRT_DINT
TBL_WRT_DWORD
TBL_WRT_INT
TBL_WRT_UINT
TBL_WRT_WORD
1.
TBL_WRT increments the pointer by one.
2.
TBL_WRT copies data from input parameter IN to the position in the table indicated by the
pointer. (It writes over any value currently at that location.) Additional program logic must then
be used to place the data in the input reference.
3.
Steps 1 and 2 are repeated each time the instruction is executed, until the table is full (PTR=LEN).
When the table is full, the pointer wraps around to the beginning of the table.
Note:
The TBL_WRT and TBL_RD functions can operate on the same or different tables. By
specifying a different reference for the pointer, these functions can access the same data
table at different locations or at different rates.
When TBL_WRT receives power flow, the pointer (PTR) increments by 1. If this new pointer location
is the last item in the table, the output FL is set to ON. The next time TBL_WRT executes, PTR is
automatically set back to 1. After incrementing PTR, TBL_WRT writes the content of the input
reference to the current pointer location, overwriting data already stored there.
TBL_WRT always passes power to the right when it receives power.
Note:
TBL_WRT is like FIFO_WRT with a wrap-around.
Operands
Note:
For each mnemonic, use the corresponding data type for the TB and IN operands. For
example, TBL_WRT_DINT requires TB and IN to be DINT variables.
Parameter
Description
Allowed Operands
Optional
Length
1
Length
32,767.
Constants
No
TB (must be the
same data type as IN)
The elements in the table
All except S, constants, data flow. SA
–
SC
allowed only for WORD, DWORD
No
PTR
Pointer. Index of the next
element.
All except constants, data flow, %S - %SC No
IN (must be the same
data type as TB)
The element to write to the table All. %S - %SC allowed only for WORD,
DWORD
No
FL
Energized when IN is written to
the last element of the table
Power flow
No
Table Write Example
WIDGETS is a table with 20 integer elements. When the enabling
input %I00012 is ON, the pointer increments and the contents of
%P00077 are written into the table at the pointer location. %L00001
functions as the pointer into the data table.
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...