EasyManua.ls Logo

Automationdirect.com DL06 - Page 270

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-109
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X6 is on, the value formed by discrete locations X0–X3
is loaded into the accumulator using the Load Formatted instruction. The value in the
accumulator is divided by the value formed by discrete location C0–C3 using the Divide
Formatted instruction. The value in the lower four bits of the accumulator is copied to Y10–
Y13 using the Out Formatted instruction.
bbbK
DIVF A aaa
DirectSOFT32 Display
LDFX0
K4
X6
Load thevalue represented
by discretelocations X0 --X3
into theaccumulator
DIVF C0
K4
Dividethe valueinthe
accumulator withthe value
repr esented by discrete
location C0--C3
OUTF Y10
K4
Copy thelower 4bitsofthe
accumulatortodiscrete
locations Y10--Y13
040000 0
000
0
0000 8
(C0--C3)
(Accumulator)
2
X0X1X2X3
OFFOFFOFFON
C0C1C2C3
OFFONOFFOFF
Y10Y11Y12Y13
OFFOFFONOFF
The unused accumulator
bits ar eset to zero
00 000000
Fi rststack location contains
therem aind er
Acc.
Handheld Programmer Keystrokes
STR
$
SHFT
8
I
AND
V
OUT
GX
SHFT
5
F
0
A
4
E
ENT
6
G
ENT
1
B
4
E
0
A
ENT
SHFT
ANDST
L
3
D
0
A
4
E
ENT
5
F
5
F
3
D
NEXT NEXT NEXTNEXT
_
.
.
Operand Data Type DL06 Range
A
aaa bbb
Inputs X 0–777 ––
Outputs Y 0–777 ––
Control Relays C 0–1777 ––
Stage Bits S 0–1777 ––
Timer Bits T 0–377 ––
Counter Bits CT 0–177 ––
Special Relays P 0-137 320-717 ––
Global I/O X 0-3777 ––
Constant K –– 1–16
Discrete Bit Flags Description
SP53 On when the value of the operand is larger than the accumulator can work with.
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On any time the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NON-BCD number was encountered.
DS Used
HPP Used
DirectSOFT
Divide Formatted (DIVF)
Divide Formatted is a 16-bit instruction that divides the BCD
value in the accumulator by the BCD value (Aaaa), a range
of discrete bits. The specified range (Kbbb) can be 1 to 16
consecutive bits. The first part of the quotient resides in the
accumulator and the remainder resides in the first stack location..