DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-107
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 BCD value formed by discrete locations X0–
X3 is loaded into the accumulator using the LDF instruction. The BCD value formed by
discrete location C0–C3 is subtracted from the BCD value in the accumulator using the SUBF
instruction. The value in the lower four bits of the accumulator is copied to Y10–Y13 using
the OUTF instruction.
bbbK
SUBF A aaa
DirectSOFT32 Display
LDFX0
K4
X6
SUBF C0
K4
OUTF Y10
K4
Copy thelow er 4bitsofthe
accumulatortodiscrete
locations Y10--Y13
010000 0
y
000
0
0 0009
(C0--C3)
(Accumulator)
8
X0X1X2X3
ONOFFOFFON
OFFOFFON
Y10Y11Y12Y13
ONOFFOFFOFF
The unused accumulator
bits ar eset to zero
ACC.
Handheld Programmer Keystrokes
STR
$
SHFT
ISG
U
1
B
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
RST
S
NEXT NEXT NEXTNEXT
SHFT
Load the BCD value represented
by discrete locations X0-X3 into
the accumulator
Subtract the BCD value
represented by C0-C3 from
the value in the accumulator
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 SP 0-137 320-717 ––
Global I/O GX 0-3777 ––
Constant K –– 1–32
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP64 On when the 16-bit subtraction instruction results in a borrow.
SP65 On when the 32 bit subtraction instruction results in a borrow
SP70 On any time the value in the accumulator is negative.
SP73 On when a signed addition or subtraction results in an incorrect sign bit.
SP75 On when a BCD instruction is executed and a NON-BCD number was encountered.
DS Used
HPP Used
DirectSOFT
Subtract Formatted (SUBF)
Subtract Formatted is a 32-bit instruction that subtracts the
BCD value (Aaaa), which is a range of discrete bits, from the
BCD value in the accumulator. The specified range (Kbbb) can
be 1 to 32 consecutive bits. The result resides in the accumulator.