Automationdirect.com DirectLOGIC DL205 Series User Manual page 368

Table of Contents

Advertisement

Find (FIND)
The Find instruction is used to search for a specified value in a
230
V-memory table of up to 255 locations. The function
240
parameters are loaded into the first and second levels of the
250-1
accumulator stack and the accumulator by three additional
260
instructions. Listed below are the steps necessary to program
the Find function.
Step 1: Load the length of the table (number of V-memory locations) into the second level of the
DS
Used
accumulator stack. This parameter must be a HEX value, 0 to FFFF.
HPP Used
Step 2: Load the starting V-memory location for the table into the first level of the accumulator stack.
This parameter must be a HEX value.
Step 3: Load the offset from the starting location to begin the search. This parameter must be a HEX
value.
Step 4: Insert the Find instruction which specifies the first value to be found in the table.
Results: The offset from the starting address to the first V-memory location which contains the search
value is returned to the accumulator as a HEX value. SP53 will be set on if an address outside
the table is specified in the offset or the value is not found. If the value is not found 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.
Discrete Bit Flag
SP53
NOTE: Status flags are only valid until another instruction that uses the same flags is executed. The pointer
for this instruction starts at 0 and resides in the accumulator.
In the example on the following page, 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 second stack location when the following Load Address and Load instruction is
executed. The octal address 1400 (V1400) is the starting location for the table and is loaded
into the accumulator. This value is placed in the first level of the accumulator stack when the
following Load instruction is executed. The offset (K2) is loaded into the lower 16 bits of the
accumulator using the Load instruction. The value to be found in the table is specified in the
Find instruction. If a value is found equal to the search value, the offset (from the starting
location of the table) where the value is located will reside in the accumulator.
Chapter 5: Standard RLL Instructions - Table
Operand Data Type
A
V-memory
V
All (See page 3 - 56)
Constant
K
On if there is no value in the table that is equal to the search value.
DL205 User Manual, 4th Edition, Rev. B
DL260 Range
aaa
0-FFFF
Description
FIND
A aaa
5–151
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

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