EasyManuals Logo

Automationdirect.com DirectLOGIC DL205 Series User Manual

Automationdirect.com DirectLOGIC DL205 Series
587 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
Page #327 background imageLoading...
Page #327 background image
DL205 User Manual, 4th Edition, Rev. B
5–110
Chapter 5: Standard RLL Instructions - Math
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
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.
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 formed by
discrete location C0–C3 is subtracted from the value in the accumulator using the Subtract
Formatted instruction. The value in the lower four bits of the accumulator is copied to
Y10–Y13 using the Out Formatted instruction.
ý
ý
ý
þ
230
240
250-1
260
SUBF A aaa
K bbb
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 anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NON-BCD number was encountered.
LDF X0
K4
X6
SUBF C0
K4
OUTF Y10
K4
Copy the lower 4 bi ts of the
accum ul ator to di screte
locations Y10--Y13
010 000 0
_
000
0
0 0009
(C0--C3)
(Accum ulator)
8
X0X1X2X3
ONOFFOFFON
C0C1C2C3
OFFOFFOFFON
Y10Y11Y12Y13
ONOFFOFFOFF
The unused accum ul ator
bits are set 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
DirectSOFT
Operand Data Type DL260 Range
A aaa bbb
Inputs X 0-1777 -
Outputs Y 0-1777 -
Control Relays C 0-3777 -
Stage Bits S 0-1777 -
Timer Bits T 0-377 -
Counter Bits CT 0-377 -
Special Relays SP 0-777 -
Global I/O GX/GY 0-3777 -
Constant K - 1-32
DS Used
HPP Used

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Automationdirect.com DirectLOGIC DL205 Series and is the answer not in the manual?

Automationdirect.com DirectLOGIC DL205 Series Specifications

General IconGeneral
BrandAutomationdirect.com
ModelDirectLOGIC DL205 Series
CategoryController
LanguageEnglish

Related product manuals