The text of a manual · part 37 of 68
DL405 User Manual: Chapter 5: Standard RLL Instructions, pages 323 to 332
Pages 323 to 332 of 608, from DL405 User Manual
The original document is the PDF (8.2 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 D4-08B-1, AutomationDirect D4-08ND3S, AutomationDirect D4-16TA, PLC Direct D4-16TD2, AutomationDirect D4-32ND3-1, Konnect-It D4-08B-1, Koyo D4-08B-1, Konnect-It D4-08ND3S, and 6 more models
Page 323
5--151
Standard RLL Instructions Table 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) 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 O 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 STR
X(IN)
1
LD
K(CON)
6
LD
SHFT
A
OCT
1
4
0
0
SHFT
R
F
B
SHFT
V
1
5
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.
0
0
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 V1400
Destination 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.
DL405 User Manual, 4th Edition
Standard RLL Instructions
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 application, you have an option of using a one-shot (PD) to remove one value each time the input contact transitions from low to high.
Page 324
5--152
Standard RLL Instructions Table 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 -- 0. Also, notice how SP56 is only on until the end of the scan. Example of Execution Scan N
Before RFB Execution Table
After RFB Execution 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
S S
Scan N+1
Table Pointer (Automatically Decremented)
V1401
0
0
0
5 V1400
Destination 2
0
4
6
V1500
SP56 SP56 = OFF
S S
Before RFB Execution Table
After RFB Execution 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
S S
0
0
0
4 V1400
Destination 1
0
1
0 V1500
SP56 SP56 = OFF
S S S S S
Scan N+4
Before RFB Execution Table
After RFB Execution 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
S S
Scan N+5
0
0
0
1 V1400
Destination 9
9
9
9 V1500
SP56 SP56 = OFF
S S
Before RFB Execution Table
Standard RLL Instructions
Table Pointer (Automatically Decremented)
Table
2 V1400
After RFB Execution 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 6
V1406
2
0
4
6
V1407
X
X
X
X
S S
DL405 User Manual, 4th Edition
0
0
0
Destination 9
9
9
Table Pointer
Table
1 V1400
9 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 6
V1406
2
0
4
6
V1407
X
X
X
X
S S
0
0
0
0 V1400
Destination 0
5
0
0 V1500
SP56 SP56 = ON until end of scan or next instruction that uses SP56
Page 325
Standard RLL Instructions Table Instructions
Source to Table (STT)
430 440 450
DS
HPP
5--153
The Source To Table instruction moves a value from a V--memory location into a V--memory table and increments a table STT pointer by 1. When the table pointer Vaaa reaches the end of the table, it resets to 1. The first V--memory location in the table contains the table pointer which indicates the next location 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: - Load 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: - Load 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 3: - Insert 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
V--memory
DL440 Range
V
DL450 Range aaa aaa
All (See p. 3--41)
All (See p. 3--42)
Discrete Bit Flags
Description
SP56 on when the table pointer equals the table length
DL405 User Manual, 4th Edition
Standard RLL Instructions
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.
Page 326
5--154
Standard RLL Instructions Table 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 lower 16 bits of the accumulator LDA O 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
Standard RLL Instructions
Handheld Programmer Keystrokes STR
X(IN)
1
LD
K(CON)
6
LD
SHFT
A
OCT
1
4
0
0
SHFT
S
T
T
SHFT
V
1
5
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 zero, and again when the pointer is equal to six. Why? Because the pointer is only equal to zero before the very first execution. From then on, it increments from one to six, and then resets to one. 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 one-shot (PD) to move one value each time the input contact transitions from low to high.
DL405 User Manual, 4th Edition
0
0
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
0 V1400
Data Source 0
5
0
0 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 starting table location.
Page 327
Standard RLL Instructions Table Instructions
5--155
The following diagram shows the scan-by-scan results of the execution for our example program. Notice how the pointer automatically cycles from 0 -- 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 Pointer
Table 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
S S
S S
Scan N+1
Table Pointer (Automatically Incremented)
V1401
Before STT Execution Table
After STT Execution 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
S S
0
0
0
2 V1400
Source 9
9
9
9 V1500
SP56 SP56 = OFF
S S S S S
Scan N+5
Before STT Execution Table
After STT Execution 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 5
V1406
2
0
4
6
V1407
X
X
X
X
S S
Scan N+6
0
0
0
Table
0
4
SP56 SP56 = ON until end of scan or next instruction that uses SP56
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
Source 1
2
3
Table Pointer (Resets to 1, not 0)
Table
6 V1400
4 V1500
SP56 SP56 = OFF
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
S S
DL405 User Manual, 4th Edition
Standard RLL Instructions
0
6 V1500
After STT Execution Table Pointer
V1401
6 V1400
Source 2
S S
Before STT Execution
S S
Table Pointer (Automatically Incremented)
Table
5 V1400
Page 328
5--156
Standard RLL Instructions Table Instructions
Remove from Table The Remove From Table instruction pops a value off a table and stores it in a (RFT) V--memory location. When a value is
RFT removed from the table all other values are 430 440 450 Vaaa shifted up 1 location. The first V--memory location in the table contains the table HPP DS length counter. The table counter decrements by 1 each time the instruction is executed. If the length counter is zero or greater than the maximum table length (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 parameters are loaded into the first level of the accumulator stack and the accumulator by two additional instructions. Listed below are the steps necessary to program the Remove From Table function. Step 1: - Load 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: - Load 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: - Insert the RFT instruction which specifies destination V--memory location (Vaaa). The value will be moved to this location. 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 this range or zero, the data will not be moved 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. Operand Data Type
Standard RLL Instructions
V--memory
DL440 Range
V
DL450 Range aaa aaa
All (See p. 3--41)
All (See p. 3--42)
Discrete Bit Flags
Description
SP56 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.
DL405 User Manual, 4th Edition
Page 329
5--157
Standard RLL Instructions Table 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) 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 STR
X(IN)
1
LD
K(CON)
6
LD
SHFT
A
OCT
1
4
0
0
SHFT
R
F
T
SHFT
V
1
5
0
Table
Table Counter
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
Destination 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.
DL405 User Manual, 4th Edition
Standard RLL Instructions
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 six 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 an option of using a one-shot (PD) to remove one value each time the input contact transitions from low to high.
0
Page 330
5--158
Standard RLL Instructions Table 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--0 as the instruction is executed. Notice how the last two table positions, 5 and 6, are not moved up through the table. Also, notice how SP56, which comes on when the table counter is zero, is only on until the end of the scan. Example of Execution Scan N
Before RFT Execution Table
Table Counter indicates that these 4 positions will be used
Scan N+1
After RFT Execution Table Counter
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 X
X
X
X V1500
SP56 SP56 = OFF
V1401
9
9
9
9
1
V1402
4
0
7
9
2
V1403
8
9
8
9
3
Start here V1404
8
9
8
9
4
V1405
1
0
1
0
5
V1406
2
0
4
6
6
V1407
X
X
X
X
S S
S S
Before RFT Execution
After RFT Execution Table Counter
Table V1401
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
5
0
0
5
0 0
0
3 V1400
0 V1500
SP56 SP56 = OFF
V1401
4
0
7
9
1
V1402
8
9
8
9
2
Start here 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
3 V1400
Destination 0
5
0
0
V1500
SP56 SP56 = OFF
Table Counter (Automatically Decremented)
Table
Destination 0
Table Counter (Automatically Decremented)
Table
9
9
0 9
9
0
0
2 V1400
Destination 9
9
9
9 V1500
SP56 SP56 = OFF
S S
Scan N+2
Before RFT Execution Table
Scan N+3
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
0
0
0
2 V1400
Destination 9
9
9
9 V1500
SP56
V1401
8
9
8
9
1
Start here 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
S S
Before RFT Execution
After RFT Execution Table Counter
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
S S
DL405 User Manual, 4th Edition
0
0
0
0
7
0
0 7
9
1 V1400
9 V1500
SP56 SP56 = OFF
Start here V1401
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 6
V1406
2
0
4
6
V1407
X
X
X
X
S S
0
0
1 V1400
Destination 4
0
7
9 V1500
SP56
Table Counter (Automatically Decremented)
Table
Destination 4
4
SP56 = OFF
S S
V1401
Table Counter (Automatically Decremented)
Table
SP56 = OFF
Table
Standard RLL Instructions
After RFT Execution Table Counter
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
Page 331
Standard RLL Instructions Table Instructions
Add to Top (ATT)
430 440 450
DS
HPP
The Add To Top instruction pushes a value on to a V--memory table from a V--memory location. When the value is added to the table all other values are pushed down 1 location.
5--159
ATT Vaaa
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 two additional instructions. Listed below are the steps necessary to program the Add To Top function. Step 1: - Load 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: - Load 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: - Insert the ATT instructions which specifies source V--memory location (Vaaa). The value will be moved from this location. 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 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
V--memory
DL440 Range
V
DL450 Range aaa aaa
All (See p. 3--41)
All (See p. 3--42)
Discrete Bit Flags
Description
SP56 on when the table counter is equal to the table size
DL405 User Manual, 4th Edition
Standard RLL Instructions
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.
Page 332
5--160
Standard RLL Instructions Table 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 counter, is loaded into the accumulator. The source location (V1500) is specified in the Add to Top instruction. The table counter will be increased by “1” after the instruction is executed. DirectSOFT X1
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 ATT V1500 Copy the specified value from V1500 to the table
Handheld Programmer Keystrokes STR
X(IN)
1
LD
K(CON)
6
LD
SHFT
A
OCT
1
4
0
0
SHFT
A
T
T
SHFT
V
1
5
0
Standard RLL Instructions
For the ATT instruction, the table counter Table determines the number of additions that V1401 0 5 0 0 can be made before the instruction will V1402 9 9 9 9 V1403 3 0 7 4 stop executing. So, it is helpful to V1404 8 9 8 9 understand how the system uses this V1405 1 0 1 0 counter to control the execution. V1406 2 0 4 6 For example, if the table counter was set V1407 X X X X to 2, and the table length was 6 words, S S then there could only be 4 additions of data before the execution was stopped. This can easily be calculated by: Table length -- table counter = number of executions Also, our example uses a normal input contact (X1) to control the execution. Since the CPU scan is extremely fast, and the table counter increments automatically, the data would be moved into the table very quickly. If this is a problem for your application, you have an option of using a one-shot (PD) to add one value each time the input contact transitions from low to high.
DL405 User Manual, 4th Edition
0
Table Counter 0
1 2
0
0
2 V1400
Data Source
3
X
4
X
X
X V1500
5 6
(e.g., 6 -- 2 = 4).
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 starting table location.