The text of a manual · part 39 of 60
DL205 PLC User Manual, Volume 1 of 2, pages 381 to 390
Pages 381 to 390 of 598
The original document is the PDF (12 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the AutomationDirect D2-04TD1, AutomationDirect D2-08TD2, AutomationDirect D2-16ND3-2, AutomationDirect D2-32ND3, Konnect-It D2-04TD1, Koyo D2-04TD1, Konnect-It D2-08TD2, Koyo D2-08TD2, and 5 more models
Page 381
Chapter 5: Standard RLL Instructions
Remove from Bottom (RFB)
240 250-1 260 230
1 2 3 4 5 Step 1: L oad the length of the table (number of V-memory locations) into the first level of the accumulator stack. This parameter must be a HEX value, 0 to FF. 6 Step 2: L oad the starting V-memory location for the table into the accumulator. (Remember, the starting location of the table blank is used as the table pointer.) This parameter must be a HEX value. 7 Step 3: nsert the RFB instructions which specifies destination V-memory location (Vaaa). Helpful hint: For parameters that require HEX values when referencing memory locations, the 8 LDA instruction can be used to convert an octal address to the HEX equivalent and load the value into the accumulator. 9 Helpful hint: The instruction will be executed every scan if the input logic is on. If you do not want the instruction to execute for more than one scan, a one shot (PD) should be used in the 10 input logic. Helpful hint: The pointer location should be set to the value where the table operation will begin. The special relay SP0 or a one shot (PD) should be used so the value will only be set in 11 one scan and will not affect the instruction operation. 12 Operand Data Type DL260 Range aaa 13 Discrete Bit Flags Description 14 A NOTE: Status flags (SPs) are only valid until:, another instruction that uses the same flag is executed, or, the end of the scan. B The pointer for this instruction can be set to start anywhere in the table. It is not set automatically. You C have to load a value into the pointer somewhere in your program. D
DS Used HPP Used
The Remove From Bottom instruction moves a value from the bottom of a V-memory table to a V-memory location and decrements a table pointer by 1. The first V-memory location in the table contains the table pointer which indicates the next location in the table to be moved. The instruction will be executed once per scan provided the input remains on. The instruction will stop operation when the pointer equals 0. The function parameters are loaded into the first level of the accumulator stack and the accumulator by 2 additional instructions. Listed below are the steps necessary to program the Remove From Bottom function.
V-memory
SP56
V
RFB
Vaaa
All (See page 3-56)
On when the table pointer equals 0
DL205 User Manual, 4th Edition, Rev. D
5-157
Page 382
Chapter 5: Standard RLL Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5-158
In the following example, when X1 is on, the constant value (K6) is loaded into the accumulator using the Load instruction. This value specifies the length of the table and is placed in the first stack location after the Load Address instruction is executed. The octal address 1400 (V1400) is the starting location for the source table and is loaded into the accumulator. Remember, V1400 is used as the pointer location, and is not actually part of the table data source. The destination location (V1500) is specified in the Remove From Bottom. The table pointer (V1400 in this case) will be decremented by “1” after each execution of the RFB instruction. DirectSOFT X1
LD K6 Load the constant value 6 (HEX) into the lower 16 bits of the accumulator LDA 0 1400 Convert octal 1400 to HEX 300 and load the value into the accumulator. This is the table pointer location RFB V1500 Copy the specified value from the table to the specified destination (V1500)
Handheld Programmer Keystrokes $
B
STR
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
R ORN
F
1
ENT PREV
3 3 5
A B
0 1
G B B
6 1 1
ENT E F
4 5
A A
0 0
It is important to understand how the table locations are numbered. If you examine the example table, you’ll notice that the first data location, V1401, will be used when the pointer is equal to one. The second data location, V1402, will be used when the pointer is equal to two, etc. Also, our example uses a normal input contact (X1) to control the execution. Since the CPU scan is extremely fast, and the pointer decrements automatically, the table would cycle through the locations very quickly. If this is a problem for your applicaton, you have an option of using a one-shot (PD) to remove one value each time the input contact transitions from low to high.
A A
ENT
0
ENT
0
Table
Table Pointer
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
0
0
0
X
X
X
S S DirectSOFT (optional one-shot method) X1 C0
C0 PD LD K6 Load the constant value 6 (HEX) into the lower 16 bits of the accumulator LDA O 1400 Convert octal 1400 to HEX 300 and load the value into the accumulator. This is the table pointer location.
DL205 User Manual, 4th Edition, Rev. D
0 V1400
Des tination X V1500
Page 383
Chapter 5: Standard RLL Instructions The following diagram shows the scan-by-scan results of the execution for our example program. Notice how the pointer automatically decrements from 6 to 0. Also, notice how SP56 is only on until the end of the scan. Example of Execution Scan N
Before RFB Execution
After RFB Execution
Table
Table Pointer
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X X
X
0
0
0
Table
6 V1400
Destination X
X X
X V1500
SP56 SP56 = OFF
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
0
0
0
5 V1400
Destination 2
0
4
6
V1500
SP56 SP56 = OFF
. .
. .
Scan N+1
Table Pointer (Automatically Decremented)
V1401
Before RFB Execution
After RFB Execution
Table
Table Pointer
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X X
X
0
0
0
Table
5 V1400
Destination 2
0
4
6 V1500
SP56 SP56 = OFF
Table Pointer (Automatically Decremented)
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
. .
0
0
0
4 V1400
Destination 1
0
1
0 V1500
SP56 SP56 = OFF
. . . . .
Scan N+4
Before RFB Execution
After RFB Execution
Table
Table Pointer
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X X
X
0
0
0
Destination 3
0
7
4 V1500
SP56 SP56 = OFF
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
. .
Scan N+5
0
0
0
1 V1400
Destination 9
9
9
9 V1500
SP56 SP56 = OFF
. .
Before RFB Execution
After RFB Execution
Table
Table Pointer
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X X
X
. .
Table Pointer (Automatically Decremented)
Table
2 V1400
0
0
0
Table
1 V1400
Destination 9
9
9
9 V1500
SP56 SP56 = OFF
Table Pointer
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
. .
0
0
0
0 V1400
Destination 0
5
0
0 V1500
SP56 SP56 = ON until end of scan or next instruction that uses SP56
DL205 User Manual, 4th Edition, Rev. D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
5-159
Page 384
Chapter 5: Standard RLL Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Source to Table (STT) Source To Table instruction moves a value from a 230 The V-memory location into a V-memory table and increments a 240 table pointer by 1. When the table pointer reaches the end of 250-1 the table, it resets to 1. The first V-memory location in the table 260 contains the table pointer which indicates the next location DS Used HPP Used
ST T V aaa in the table to store a value. The instruction will be executed once per scan provided the input remains on. The function parameters are loaded into the first level of the accumulator stack and the accumulator with two additional instructions. Listed below are the steps necessary to program the Source To Table function.
Step 1: L oad the length of the table (number of V-memory locations) into the first level of the accumulator stack. This parameter must be a HEX value, 0 to FF. Step the starting V-memory location for the table into the accumulator. (Remember, the starting location of the table is used as the table pointer.) This parameter must be a HEX value. Step the STT instruction which specifies the source V-memory location (Vaaa). This is where the value will be moved from.
Helpful hint: For parameters that require HEX values when referencing memory locations, the LDA instruction can be used to convert an octal address to the HEX equivalent and load the value into the accumulator. Helpful hint: The instruction will be executed every scan if the input logic is on. If you do not want the instruction to execute for more than one scan, a one shot (PD) should be used in the input logic. Helpful hint: The table counter value should be set to indicate the starting point for the operation. Also, it must be set to a value that is within the length of the table. For example, if the table is 6 words long, then the allowable range of values that could be in the pointer should be between 0 and 6. If the value is outside of this range, the data will not be moved. Also, a one shot (PD) should be used so the value will only be set in one scan and will not affect the instruction operation. Operand Data Type
DL260 Range
V-memory
All (See page 3-56)
aaa
Discrete Bit Flags SP56
5-160
V
Description On when the table pointer equals the table length.
NOTE: Status flags (SPs) are only valid until:, another instruction that uses the same flag is executed, or, the end of the scan The pointer for this instruction starts at 0 and resets to 1 automatically when the table length is reached.
DL205 User Manual, 4th Edition, Rev. D
Page 385
Chapter 5: Standard RLL Instructions In the following example, when X1 is on, the constant value (K6) is loaded into the accumulator using the Load instruction. This value specifies the length of the table and is placed in the first stack location after the Load Address instruction is executed. The octal address 1400 (V1400), which is the starting location for the destination table and table pointer, is loaded into the accumulator. The data source location (V1500) is specified in the Source to Table instruction. The table pointer will be increased by “1” after each time the instruction is executed. DirectSOFT X1
LD K6 Load the constant value 6 (HEX) into the the lower 16 bits of the accumulator LDA 0 1400 Convert octal 1400 to HEX 300 and load the value into the accumulator STT V1500 Copy the specified value from the source location (V1500) to the table
Handheld Programmer Keystrokes $
B
STR
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
S RST
1
ENT PREV
3 3
SHFT
A
B
0
T MLR
G
T MLR
6 1
ENT E B
4 1
A F
0 5
A A
0 0
ENT A
0
It is important to understand how the table locations are numbered. If you examine the example table, you’ll notice that the first data storage location, V1401, will be used when the pointer is equal to 0, and again when the pointer is equal to 6. Why? Because the pointer is only equal to 0 before the very first execution. From then on, it increments from 1 to 6, and then resets to 1.
ENT
Table X
X
X
X
0 6
V1402
X
X
X
X
1
V1403
X
X
X
X
2
V1404
X
X
X
X
3
V1405
X
X
X
X
4
V1406
X
X
X
X
5
V1407
X
X
X
X
0
0
0
0 V1400
Data S ource 0
5
0
0 V1500
S S
DirectSOFT
Also, our example uses a normal input contact (X1) to control the execution. Since the CPU scan is extremely fast, and the pointer increments automatically, the source data would be moved into all the table locations very quickly. If this is a problem for your application, you have an option of using a oneshot (PD) to move 1 value each time the input contact transitions from low to high.
Table Pointer
V1401
(optional one-shot method)
X1 C0
C0 PD LD K6 Load the constant value 6 (HEX) into the lower 16 bits of the accumulator LDA O 1400 Convert octal 1400 to HEX 300 and load the value into the accumulator. This is the starting table location.
DL205 User Manual, 4th Edition, Rev. D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
5-161
Page 386
Chapter 5: Standard RLL Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
The following diagram shows the scan-by-scan results of the execution for our example program. Notice how the pointer automatically cycles from 0 to 6, and then starts over at 1 instead of 0. Also, notice how SP56 is affected by the execution. Although our example does not show it, we are assuming that there is another part of the program that changes the value in V1500 (data source) prior to the execution of the STT instruction. This is not required, but it makes it easier to see how the data source is copied into the table. Example of Execution Scan N
Before STT Execution
After STT Execution
Table
Table Pointer
V1401
X
X
X
X
0 6
V1402
X
X
X
X
1
V1403
X
X
X
X
2
V1404
X
X
X
X
3
V1405
X
X
X
X
4
V1406
X
X
X
X
5
V1407
X
X
X
X
0
0
0
Table
0 V1400
Source 0
5
0
0 V1500
SP56 SP56 = OFF
0
5
0
0
0 6
V1402
X
X
X
X
1
V1403
X
X
X
X
2
V1404
X
X
X
X
3
V1405
X
X
X
X
4
V1406
X
X
X
X
5
V1407
X
X
X
X
0
0
0
1 V1400
Source 0
5
0
0
V1500
SP56 SP56 = OFF
. .
. .
Scan N+1
Table Pointer (Automatically Incremented)
V1401
After STT Execution
Before STT Execution Table
Table Pointer
V1401
0
5
0
0
0 6
V1402
X
X
X
X
1
V1403
X
X
X
X
2
V1404
X
X
X
X
3
V1405
X
X
X
X
4
V1406
X
X
X
X
5
V1407
X
X
X
X
0
0
0
Table
1 V1400
Source 9
9
9
9 V1500
SP56
SP56 = OFF
Table Pointer (Automatically Incremented)
V1401
0
5
0
0
0 6
V1402
9
9
9
9
1
V1403
X
X
X
X
2
V1404
X
X
X
X
3
V1405
X
X
X
X
4
V1406
X
X
X
X
5
V1407
X
X
X
X
. .
0
0
0
2 V1400
Source 9
9
9
SP56
9 V1500
SP56 = OFF
. . . . .
Scan N+5
Before STT Execution
After STT Execution
Table
Table Pointer
V1401
0
5
0
0
0 6
V1402
9
9
9
9
1
V1403
3
0
7
4
2
V1404
8
9
8
9
3
V1405
1
0
1
0
4
V1406
X
X X
X
5
V1407
X
X X
X
0
0
0
Source 2
0
4
6 V1500
SP56 SP56 = OFF
V1401
0
5
0
0
0 6
V1402
9
9
9
9
1
V1403
3
0
7
4
2
V1404
8
9
8
9
3
V1405
1
0
1
0
4
V1406
2
0
4
6
5
V1407
X
X
X
X
. .
Scan N+6
5-162
Table Pointer (Automatically Incremented)
Table
5 V1400
0
0
0
Source 2
0
4
6 V1500
SP56 SP56 = ON until end of scan or next instruction that uses SP56
. .
Before STT Execution
6 V1400
After STT Execution
Table
Table Pointer
V1401
0
5
0
0
0 6
V1402
9
9
9
9
1
V1403
3
0
7
4
2
V1404
8
9
8
9
3
V1405
1
0
1
0
4
V1406
2
0
4
6
5
V1407
X
X X
X
0
0
0
Table
6 V1400
Source 1
2
3
4 V1500
SP56 SP56 = OFF
. .
DL205 User Manual, 4th Edition, Rev. D
Table Pointer (Resets to 1, not 0)
V1401
1
2
3
4
0 6
V1402
9
9
9
9
1
V1403
3
0
7
4
2
V1404
8
9
8
9
3
V1405
1
0
1
0
4
V1406
2
0
4
6
5
V1407
X
X
X
X
. .
0
0
0
1 V1400
Source 1
2
3
4 V1500
SP56 SP56 = OFF
Page 387
Chapter 5: Standard RLL Instructions
Remove from Table (RFT)
1 V aaa 2 instruction is executed. If the length counter is 0 or greater than the maximum table length 3 (specified in the first level of the accumulator stack), the instruction will not execute and SP56 will be on. The instruction will be executed once per scan provided the input remains on. The function 4 parameters are loaded into the first level of the accumulator stack and the accumulator by 2 additional instructions. Listed below are the steps necessary to program the Remove From 5 Table function. Step 1: the length of the table (number of V-memory locations) into the first level of the 6 accumulator stack. This parameter must be a HEX value, 0 to FF. Step 2: the starting V-memory location for the table into the accumulator. (Remember, the 7 starting location of the table is used as the table length counter.) This parameter must be a HEX value. 8 Step 3: the RFT instructions which specifies destination V-memory location (Vaaa). This is where the value will be moved to. Helpful hint: For parameters that require HEX values when referencing memory locations, the 9 LDA instruction can be used to convert an octal address to the HEX equivalent and load the value into the accumulator. 10 Helpful hint: The instruction will be executed every scan if the input logic is on. If you do not want the instruction to execute for more than one scan, a one shot (PD) should be used in the 11 input logic. Helpful hint: The table counter value should be set to indicate the starting point for the operation. Also, it must be set to a value that is within the length of the table. For example, if 12 the table is 6 words long, then the allowable range of values that could be in the table counter should be between 1 and 6. If the value is outside of this range or 0, the data will not be moved 13 from the table. Also, a one shot (PD) should be used so the value will only be set in one scan and will not affect the instruction operation. 14 Operand Data Type DL260 Range aaa A B Discrete Bit Flags Description C NOTE: Status flags (SPs) are only valid until:, another instruction that uses the same flag is executed, or D, the end of the scan
The Remove From Table instruction pops a value off of a table stores it in a V-memory location. When a value is removed 240 and from the table all other values are shifted up 1 location. The 250-1 first V-memory location in the table contains the table length 260 counter. The table counter decrements by 1 each time the 230
DS Used HPP Used
V-memory
SP56
V
RFT
All (See page 3-56)
On when the table counter equals 0.
The pointer for this instruction can be set to start anywhere in the table. It is not set automatically. You have to load a value into the pointer somewhere in your program.
DL205 User Manual, 4th Edition, Rev. D
5-163
Page 388
Chapter 5: Standard RLL Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5-164
In the following example, when X1 is on, the constant value (K6) is loaded into the accumulator using the Load instruction. This value specifies the length of the table and is placed in the first stack location after the Load Address instruction is executed. The octal address 1400 (V1400) is the starting location for the source table and is loaded into the accumulator. The destination location (V1500) is specified in the Remove from Table instruction. The table counter will be decreased by “1” after the instruction is executed. DirectSOFT X1
K6
Load the constant value 6 (Hex.) into the lower 16 bits of the accumulator
O 1400
Convert octal 1400 to HEX 300 and load the value into the accumulator
V1500
Copy the specified value from the table to the specified location (V1500)
LD
LDA
RFT
Handheld Programmer Keystrokes $
B
STR
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
R ORN
F
1
ENT PREV
3 3 5
A
0
T MLR
G B B
6 1 1
ENT E F
4 5
Since the table counter specifies the range of data that will be removed from the table, it is important to understand how the table locations are numbered. If you examine the example table, you’ll notice that the data locations are numbered from the top of the table. For example, if the table counter started at 6, then all 6 of the locations would be affected during the instruction execution. Also, our example uses a normal input contact (X1) to control the execution. Since the CPU scan is extremely fast, and the pointer decrements automatically, the data would be removed from the table very quickly. If this is a problem for your application, you have the option of using a one-shot (PD) to remove one value each time the input contact transitions from low to high.
DL205 User Manual, 4th Edition, Rev. D
A A
0 0
A A
ENT
0
ENT
0 Table
Table C ounter
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
0
0
0
6 V1400
Des tination X
X
X
X V1500
S S DirectSOFT
(optional one-shot method)
X1 C0
C0 PD LD K6 Load the constant value 6 (HEX) into the lower 16 bits of the accumulator LDA O 1400 Convert octal 1400 to HEX 300 and load the value into the accumulator. This is the table pointer location.
Page 389
Chapter 5: Standard RLL Instructions The following diagram shows the scan-by-scan results of the execution for our example program. In our example we’re showing the table counter set to 4 initially (Remember, you can set the table counter to any value that is within the range of the table). The table counter automatically decrements from 4 to 0 as the instruction is executed. Notice how the last 2 table positions, 5 and 6, are not moved up through the table. Also, notice how SP56, which comes on when the table counter is 0, is only on until the end of the scan.
Scan N Table Counter indicates that these 4 positions will be used
After RFT Execution
Before RFT Execution Table
Table Counter 0
V1401
0
5
0
0
1
V1402
9
9
9
9
2
V1403
3
0
7
4
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X X
X
Scan N+1
0
0
Destination X
X X
X V1500
Start here
SP56 SP56 = OFF
9
9
9
9
1
V1402
4
0
7
9
2
V1403
8
9
8
9
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
0
0
0
V1401
4
0
7
9
1
V1402
8
9
8
9
2
V1403
8
9
8
9
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X X
X
Destination 0
5
0
Start here 0 V1500
SP56 SP56 = OFF
0
0
0
2
V1403
8
9
8
9
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
V1401
8 8
9
8
9
2
V1403
8
9
8
9
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
X
1
0
5
0 0
0
0
0
3 V1400
Destination 0
5
0
0
V1500
SP56 SP56 = OFF
Table Counter (Automatically decremented)
V1401
4
0
7
9
1
V1402
8
9
8
9
2
V1403
8
9
8
9
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
9
9
0 9
Start here
Destination 9
9
9
9 V1500
SP56
0
0
1 V1400
Destinatio 4
0
7
9 V1500
SP56 SP56 = OFF
Start here
0
0
2 V1400
Destination 9
9
9
9 V1500
SP56 SP56 = OFF
8
9
8
9
1
V1402
8
9
8
9
2
V1403
8
9
8
9
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
4
0
0 7
9
0
0
1 V1400
Destination 4
0
7
9 V1500
SP56 SP56 = OFF
After RFT Execution
0
9
Table Counter (Automatically decremented)
V1401
Table Counter
V1402
X
1
9
Table
2 V1400
SP56 = OFF
Table 9 8 9
X
9
7
After RFT Execution
Before RFT Execution
X
9
0
Table Counter
Table
V1407
9
4
Table
3 V1400
Before RFT Execution
Scan N+3
9
V1402
Table Counter
V1401
Scan N+2
V1401
After RFT Execution
Before RFT Execution Table
Table Counter (Automatically d ecremented)
Table
4 V1400
Table Counter (Automatically decremented)
V1401
Table 8 9 8
9
1
V1402
8
9
8
9
2
V1403
8
9
8
9
3
V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
8
9
0 8
9
0
0
0 V1400
Destination 8 9 8 9 V1500
SP56 SP56 = ON until end of scan or next instruction that uses SP56
DL205 User Manual, 4th Edition, Rev. D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
5-165
Page 390
Chapter 5: Standard RLL Instructions
1 2
3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Add to Top (ATT) 230 240 250-1 260
DS Used HPP Used
5-166
The Add To Top instruction pushes a value onto a V-memory ATT table from a V-memory location. When the value is added to V aaa the table, all other values are pushed down 1 location. The instruction will be executed once per scan provided the input remains on. The function parameters are loaded into the first level of the accumulator stack and the accumulator by 2 additional instructions. Listed below are the steps necessary to program the Add To Top function. Step 1: L oad the length of the table (number of V-memory locations) into the first level of the accumulator stack. This parameter must be a HEX value, 0 to FF. Step 2: L oad the starting V-memory location for the table into the accumulator. (Remember, the starting location of the table is used as the table length counter.) This parameter must be a HEX value. Step 3: nsert the ATT instruction that specifies the source V-memory location (Vaaa). This is where the value will be moved from.
Helpful hint: For parameters that require HEX values when referencing memory locations, the LDA instruction can be used to convert an octal address to the HEX equivalent and load the value into the accumulator. Helpful hint: The instruction will be executed every scan if the input logic is on. If you do not want the instruction to execute for more than one scan, a one shot (PD) should be used in the input logic. Helpful hint: The table counter value should be set to indicate the starting point for the operation. Also, it must be set to a value that is within the length of the table. For example, if the table is 6 words long, then the allowable range of values that could be in the table counter should be between 1 and 6. If the value is outside of this range or zero, the data will not be moved into the table. Also, a one shot (PD) should be used so the value will only be set in one scan and will not affect the instruction operation. Operand Data Type
DL260 Range aaa
V-memory
Discrete Bit Flags SP56
V
All (See page 3-56)
Description On when the table counter equals 0.
NOTE: Status flags (SPs) are only valid until:, another instruction that uses the same flag is executed, or, the end of the scan The pointer for this instruction can be set to start anywhere in the table. It is not set automatically. You have to load a value into the pointer somewhere in your program.
DL205 User Manual, 4th Edition, Rev. D