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 #358 background imageLoading...
Page #358 background image
DL205 User Manual, 4th Edition, Rev. B
5–141
Chapter 5: Standard RLL Instructions - Number Conversion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Gray Code (GRAY)
The Gray code instruction converts a 16-bit gray code value to
a BCD value. The BCD conversion requires 10 bits of the
accumulator. The upper 22 bits are set to “0”. This instruction
is designed for use with devices (typically encoders) that use
the grey code numbering scheme. The Gray Code instruction
will directly convert a gray code number to a BCD number for
devices having a resolution of 512 or 1024 counts per
revolution. If a device having a resolution of 360 counts per
revolution is to be used you must subtract a BCD value of 76
from the converted value to obtain the proper result. For a
device having a resolution of 720 counts per revolution you
must subtract a BCD value of 152.
In the following example, when X1 is ON the binary value represented by X10–X27 is loaded
into the accumulator using the Load Formatted instruction. The gray code value in the
accumulator is converted to BCD using the Gray Code instruction. The value in the lower 16
bits of the accumulator is copied to V2010.
GRAY
230
240
250-1
260
ý
þ
þ
þ
Handheld Programmer Keystrokes
DirectSOFT
LDF K16
X10
X1
Load the value represented
by X10–X27 into the lower
16 bits of the accumulator
GRAY
Convert the 16 bit grey code
value in the accumulator to a
BCD value
OUT
V2010
Copy the value in the lower
16 bits of the accumulator to
V2010
0000000000
Gray Code BCD
0000000001
0000000011
0000000010
0000000110
0000000111
0000000101
0000000100
1000000001
1000000000
0000
0001
0002
0003
0004
0005
0006
0007
1022
1023
X10X11X12
ONOFFON
00000000000001010000000000000000
15 14 13 12 11 10 98765432 10
31 3029 28 27 26 25 24 23 22 21 20 19 18 17 1631 3029 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
00000000000001100000000000000000
15 14 13 12 11 10 98765432 10
31 3029 28 27 26 25 24 23 22 21 20 19 18 17 1631 3029 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
X25X26X27
OFFOFFOFF
V2010
0006
STR
$
SHFT
ANDST
L
3
D
5
F
SHFT
6
G
ORN
R
0
A
MLS
Y
ENT
OUT
GX
SHFT
AND
V
2
C
0
A
1
B
0
A
ENT
ENT
1
B
1
B
0
A
ENT
1
B
6
G
••
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