E L C P r o g r a m m i n g M a n u a l
F or more info rmat io n vi sit: www.e a to n.c om M N 0 5 003 00 3 E
3-418
API Mnemonic
Operands
Function
170
D GRY P
S, D
BIN
→
GRAY CODE
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX
KnY
KnM KnS T
C D E
F
S
*
*
*
*
*
*
*
*
*
*
*
D
*
*
*
*
*
*
*
*
GRY, GRYP: 5 steps
DGRY, DGRYP: 9 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P
32 16 P 32 16 P
Operands:
S
: Source value
D
: Destination address to store the Gray code result
Description:
1.
The BIN value,
S
is converted to the equivalent GRAY CODE value and the result is stored in
the device specified by
D
.
2.
The range of
S
that can be converted to GRAY CODE is shown as follows:
16-bit instruction:
0~32,767
32-bit instruction:
0~2,147,483,647
3.
If the BIN value is outside the range shown above, it is an “Operation Error”. The instruction
will not be executed, M1067=ON, M1068=ON, and the error code 0E1A (HEX) in D1067.
Program Example:
When X0=ON, constant K6513 is converted to GRAY CODE and stored in the K4Y20.
X0
GRY
K6513
K4Y20
0 0 0 1 1
1
0 0
0 1 1 1
1
0 0 0
b15
b0
K6513=H1971
0 0 0
0
0
0 0
0 0 1
1
1
1
1
1
1
K4Y20
Y37
Y20
GRAY 6513
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...