EasyManua.ls Logo

Automationdirect.com DL06 - Page 309

Automationdirect.com DL06
533 pages
Print Icon
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...
DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-148
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
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–FF.
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 (in HEX) which is returned to
the accumulator. 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.
NOTE: This instruction does not have an offset, such as the one required for the FIND instruction.
DirectSOFT32 Display
LD
K6
X1
Load theconstantvalue 6
(HEX)intothe lower16bits
of theaccumulato
r
LDA
O 140
0
LD
K2
Load theconstantvalue
2intothe lower16bits
of theaccumulato
r
FIND
K8989
Find thelocationinthe ta ble
wherethe value 8989 resides
V1400
0123
V1401
0500
V1402
9999
V1403
3074
V1404
8989
V1405
1010
V1406
XXXX
V1407
XXXX
S
S
S
S
Offs e
t
Ta blelength
V1404 contains theloc ation
wherethe matc hwas found.
Thevalue 8989 wasthe 4th
location afterthe startofthe
specifiedtable
.
0004
Accumulator
0000
Convertoctal 1400 to HEX
300 andloadthe valueinto
theaccumulator.
Beginhere
1
2
3
4
0
5
FDGT
A aaa
Handheld Programmer Keystrokes
STR
$
SHFT
ANDST
L
3
D
SHFT
5
F
8
I
TMR
N
PREV
3
D
1
B
ENT
6
G
0
A
0
A
ENT
SHFT
ANDST
L
3
D
1
B
4
E
2
C
ENT
8
I
9
J
ENT
SHFT
ANDST
L
3
D
PREV
NEXT
8
I
9
J
DirectSOFT
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.