Mechanism of Absolute Rotary Encoder
Mechanism of Absolute Rotary Encoder
Rotary Encoders
40
Mechanism of absolute rotary encoder
Rotary Encoders
Gray to binary conversion by PLC
Between TRD-NA and D4-450,440/D2-250,240
41
Mechanism of absolute rotary encoder
Rotary Encoders
42
DirectLogic Software Help File Chapter 5: Standard RLL Instructions - Number Conversion
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
0
6 5
0 0
4 3
0 0
2
1
1
0
0
1
10
GRAY
OUT
V2010
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0
12
Copy the value in the lower
16 bits of the accumulator to
V2010
Gray Code
0000000000
BCD
0000 0 0 0 6
13
0000000001 0001 V2010
Handheld Programmer Keystrokes
$
STR
B
1
ENT
0000000011
0000000010
0002
0003
14
L D F B A B G 0000000110 0004
SHFT
SHFT
ANDST
G
6
R
ORN
3
A
5
0
Y
MLS
ENT
1 0 1 6
ENT
0000000111
0000000101
0005
0006
A
0000000100 0007
GX
OUT
SHFT V
AND
C
2
A
0
B
1
A
0
ENT
•
•
•
•
B
•
1000000001
•
1022 C
1000000000 1023
The Gray Code to Integer instruction (GRAY) converts a 16 bit Gray code value
to an integer value. This instruction is designed for use with devices that use
the gray code numbering scheme.
Gray codes are often used in linear encoders and rotary encoders in preference
to straightforward binary encoding. This avoids the possibility that, when several
bits change in the binary representation of an angle, a misread could result from
some of the bits changing before others. Rotary encoders especially benefit
from the cyclic nature of Gray codes, because the first and last values of the
sequence differ by only one bit.
The Gray Code to Integer instruction will directly convert a gray code number to an integer for devices having a resolution of
512 or 1024 counts per revolution.
For a device having a resolution of 360 counts per revolution you must subtract 76 from the converted value to obtain the
correct result (360-Excess-76 Gray Code).
For a device having a resolution of 720 counts per revolution you must subtract 152 from the converted value to obtain the
correct result (720-Excess-152 Gray Code).
Parameters:
Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory
locations that are valid in the current field of the instruction.
mk:@MSITStore:C:\Do-more%20Designer\Help\DmDesigner.CHM::/Instruction_Set/GRAY_Gray_Co... 10/29/2012
GRAY - Gray Code to Integer Page 2 of 2
Input Value - designates the memory location that contains the Gray code value. This can be any constant value or any
readable numeric location.
Output Value - designates a memory location to store the converted value. This can be any writable numeric location.
See Also:
Rung Example:
mk:@MSITStore:C:\Do-more%20Designer\Help\DmDesigner.CHM::/Instruction_Set/GRAY_Gray_Co... 10/29/2012
Topic: P220 and P144
Chapter 7: Instructions Productivity 3000 Software Help File
Data Handling
1 Absolute Encoder (ABSE) Instruction
Mnemonic (Keyboard Shortcut) = ABSE Icon/Button =
2 Purpose Decodes Bit Pattern from Gray Code or Binary Absolute Encoder.
3 Instruction
Parameters Parameter Parameter
Type Requirements Description
Note: The Output Tag Value is not forced to zero when the Enable is turned OFF. The Output Tag will contain
10 the last value Written by the Instruction until it is overwritten by another Instruction or from an external
device.
11 Note: Tag Values are updated immediately as each Ladder Rung is executed, top to bottom. However, Tag
Values representing physical Outputs are only applied to the physical Output after the END statement of the
last Task to be scanned is reached. Outputs in Remote Base Groups have additional limitations regarding
12 Update Intervals.
Instruction
13 Configuration
14
A When Absolute Encoder Instruction is
selected the window shown on the right
B opens with defaults shown.
C
D
5
Application In the following example, the current table position is calculated based on the Encoder
Example Resolution and the bit pattern of the Gray Code bit pattern fed into the ABSE instruction. 6
7
8
9
10
11
12
13
14
Rung
Example A
B
C
D