Automationdirect.com DirectLOGIC DL205 Series User Manual page 369

Table of Contents

Advertisement

Chapter 5: Standard RLL Instructions - Table
DirectSOFT
1
X1
2
3
4
5
6
7
8
9
Find Greater Than (FDGT)
The Find Greater Than instruction is used to search for the first
230
10
occurrence of a value in a V-memory table that is greater than
240
the specified value (Aaaa), which can be either a V-memory
location or a 4-digit constant. The function parameters are
250-1
11
loaded into the first level of the accumulator stack and the
260
accumulator by two additional instructions. Listed below are
12
the steps necessary to program the Find Greater Than function.
NOTE: This instruction does not have an offset, such as the one required for the FIND instruction.
13
Step 1: Load the length of the table (up to 255 locations) into the first level of the accumulator stack.
DS
Used
14
HPP Used
Step 2: Load the starting V-memory location for the table into the accumulator. This parameter must
A
Step 3: Insert the FDGT instruction which specifies the greater than search value.
Results: The offset from the starting address to the first Vmemory location which contains the greater
B
Helpful hint: — For parameters that require HEX values when referencing memory locations,
C
the LDA instruction can be used to convert an octal address to the HEX equivalent and load
the value into the accumulator.
D
5–152
DL205 User Manual, 4th Edition, Rev. B
LD
K6
Load the constant value 6
Begin here
(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
LD
K2
Handheld Programmer Keystrokes
Load the constant value 2
$
into the lower 16 bits of
STR
the accumulator
SHFT
FIND
K8989
SHFT
Find the location in the table
SHFT
where the value 8989 resides
SHFT
This parameter must be a HEX value, 0 to FFFF.
be a HEX value.
than search value is returned to the accumulator as a HEX value. SP53 will be set on if the
value is not found and 0 will be returned in the accumulator.
0
1
2
3
V1400
Offset
0
5
0
0
V1401
9
9
9
9
V1402
3
0
7
4
V1403
8
9
8
9
V1404
1
0
1
0
V1405
X
X X
X
V1406
X
X X
X
V1407
B
ENT
1
L
D
PREV
ANDST
3
L
D
A
ANDST
3
0
L
D
C
PREV
ANDST
3
2
F
I
N
D
5
8
TMR
3
Table length
0
1
2
Accumulator
3
0
0
0
0
4
V1404 contains the location
5
where the match was found.
The value 8989 was the 4th
location after the start of the
specified table.
G
ENT
6
B
E
A
A
ENT
1
4
0
0
ENT
I
J
I
NEXT
8
9
8
FDGT
A aaa
0
0
0
4
J
ENT
9

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?

Table of Contents

Save PDF