Справочник Пользователя для Mitsubishi Electronics FX2N

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-143
5.15.1
GRY (FNC 170)
Operation:
The binary integer value in S is converted to the
GRAY CODE equivalent and stored at D.
Points to Note:
The nature of gray code numbers allows numeric values to be quickly output without the need
for a strobing signal. For example, if the source data is continually incremented, the new output
data can be set each program scan.
5.15.2
GBIN (FNC 171)
Operation:
The GRAY CODE value in S is converted to the
normal binary equivalent and stored at D.
Points to Note:
This instruction can be used to read the value from a gray code encoder. 
If the source is set to inputs X0 to X17 it is possible to speed up the reading time by adjusting
the refresh filter with FNC 51 REFF.
Mnemonic
Function 
Operands
Program steps
S
D
GRY
FNC 170
(Gray
Code)
Calculates the
gray code value
of an integer
K, H,
KnX, KnY, KnM, KnS,
T, C, D, V, Z
KnY, KnM, KnS,
T, C, D, V, Z 
GRY,GRYP:
5 steps
DGRY,DGRYP
9 steps
Mnemonic
Function 
Operands
Program steps
S
D
GBIN
FNC 171
(Gray
Code)
Calculates the
integer value of a
gray code
K, H,
KnX, KnY, KnM, KnS,
T, C, D, V, Z
KnY, KnM, KnS,
T, C, D, V, Z 
GBIN,GBINP:
5 steps
DGBIN,
DGBINP:
9 steps
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
M45
K1234 K3Y10
GRY
[ S ]
[ D ]
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
T24
K3X20 D10
GBIN
[ S ]
[ D ]