EasyManua.ls Logo

AutomationDirect DL205 - Page 376

Default Icon
598 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DL205 User Manual, 4th Edition, Rev. D
5-152
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Find Greater Than (FDGT)
The Find Greater Than instruction is used to search for the first
occurrence of a value in a V-memory table that is greater than the
specified value (Aaaa), which can be either a V-memory location
or a 4-digit constant. 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 Find Greater Than function.
NOTE: This instruction does not have an offset, such as the one required for the FIND instruction.
Step 1: Load the length of the table (up to 255 locations) into the first level of the accumulator stack.
This parameter must be a HEX value, 0 to FFFF.
Step 2: Load the starting V-memory location for the table into the accumulator. This parameter
must be a HEX value.
Step 3: Insert the FDGT instruction which specifies the greater than search value.
Results: The offset from the starting address to the first V-memory location which contains the
greater 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.
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.
FDGT
A aaa
230
240
250-1
260
Load the constant value 6
(HEX) into the lower 16 bits
of the accumulator
LD
K6
X1
LDA
O 1400
LD
K2
V1400 0
V1401 1
V1402 2
V1403 3
V1404 4
V1405 5
V1406
V1407
0123
0500
9999
3074
8989
1010
XXXX
XXXX
Handheld Programmer Keystrokes
SHFT
ANDST
L
3
D
STR
$
SHFT
ANDST
L
3
D
PREV
5
F
SHFT
8
I
3
D
TMR
N
8
I
1
B
ENT
PREV
6
G
ENT
J
ENT
SHFT
ANDST
L
3
D
1
B
4
E
0
A
8
I
2
C
ENT
0
A
FIND
K8989
Convert octal 1400 to HEX
300 and load the value into
the accumulator
Load the constant value 2
into the lower 16 bits of
the accumulator
Find the location in the table
where the value 8989 resides
Offset
Begin here
Table length
Accumulator
00000004
V1404 contains the location
where the match was found.
The value 8989 was the 4th
location after the start of the
specified table.
NEXT
J
9 9
0
A
ENT
DirectSOFT
DS Used
HPP Used

Table of Contents

Other manuals for AutomationDirect DL205

Related product manuals