3 ) programming example – Yaskawa MP900 Series Ladder Programming Manual User Manual
Page 286

5.9 Table Manipulation Instructions
5.9.7 Read Queue Table (QTBLR and QTBLRI)
5-217
Instructions
5
[ a ] Parameter Table Configuration
[ b ] Error Codes
[ c ] Setting the Relative Row Numbers of Table Elements
( 3 ) Programming Example
In the following programming example, the specified column elements in array table data TBL1 are read and stored in
MW00010 to MW00012 when switch 2 (DB000002) turns ON.
Before switch 2 is turned ON, the table data is set as shown below by turning ON switch 1 three times while changing
the contents of MW00000 to MW00002. (Refer to information on the Write Queue Table instruction.)
The contents of table data TBL1 are given below.
The column data types are given in parentheses.
Address
Data
Type
Symbol
Name
Specification
I/O
0
L
ROW
Relative row number of
table elements
Relative row number of table elements at source to
move (1 to 65,535)
IN
2
L
COLUMN
First column number of
table elements
First column number of table elements at source to
move (1 to 32,767)
IN
4
W
CLEN
Number of column ele-
ments
Number of column elements to move (1 to 32,767)
IN
5
W
Reserved.
6
L
RPTR
Read pointer
Read pointer of the queue after execution
OUT
8
L
WPTR
Write pointer
Write pointer of the queue after execution
OUT
Error Code
Error Name
Meaning
0001 hex
Table undefined
The target table is undefined.
0002 hex
Outside range of row numbers
The row number of the table element is outside the target table.
0003 hex
Outside range of column num-
bers
The column number of the table element is outside the target table.
0004 hex
Incorrect number of elements
The number of target elements is invalid.
0005 hex
Insufficient storage area
The storage area is insufficient.
0006 hex
Insufficient element type
The data type specified for the element is wrong.
0007 hex
Queue buffer error
An attempt was made to read from an empty queue buffer, or to write to a
full queue buffer by advancing the pointer.
0008 hex
Queue table error
The specified table is not a queue table.
0009 hex
System error
An unexpected error was detected in the system during instruction execu-
tion.
Relative Row
Number
Row That Is Read
Remarks
0
Read pointer row
The pointer is advanced only for the QTBLRI instruction.
1
Read pointer row
Pointer is not advanced.
2
Read pointer row – 1
Pointer is not advanced.
3
Read pointer row – 2
Pointer is not advanced.
:
:
n
Read pointer row – (n – 1)
Pointer is not advanced.
Column
Row
1
(W)
2
(W)
3
(W)
1
11
12
13
2
21
22
23
3
31
32
33