Fnc170 - Gry / Decimal To Gray Code Conversion - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
22.1
FNC170 – GRY / Decimal to Gray Code Conversion
Outline
This instruction converts a binary value into a gray code, and transfers it.
1. Instruction format
FNC 170
D
GRY
P
2. Set data
Operand Type
S
D
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
S
D
:This function is supported only in FX
Explanation of function and operation
1. 16-bit operation (GRY and GRYP)
Command
input
FNC170
GRY
S
When
is K1234 and
b15
BIN 1234
0
0
GRY 1234
-
can store a value from 0 to 32767.
S
2. 32-bit operation (DGRY and DGRYP)
- A binary value can be converted into a gray code of up to 32 bits.
-
can store a value from 0 to 2,147,483,647.
S
Caution
The data conversion speed depends on the scan time of the PLC.
Mnemonic
16-bit Instruction
GRY
5 steps
GRYP
Conversion source data or word device storing conversion source data
Word device storing data after conversion
Digit Specification
/FX
3U
This instruction converts and transfers data from
S
D
the source (binary) to the destination (gray code).
D
is K3Y10
0
0
0
1
0
0
1
1
0
1
Y23
Y20 Y17
0
1
1
0
1
0
1
1
22 External Device – FNC170 to FNC179
22.1 FNC170 – GRY / Decimal to Gray Code Conversion
Operation Condition
32-bit Instruction
Continuous
9 steps
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
V Z Modify K H
PLCs.
3UC
b0
0
0
1
0
Y10
1
0
1
1
Mnemonic
Operation Condition
DGRY
Continuous
Operation
DGRYP
Pulse (Single)
Operation
Data Type
16- or 32-bit binary
16- or 32-bit binary
Others
Con-
Real
Charac-
Index
stant
Number
ter String
E
" "
21
22
23
24
Pointer
25
P
26
27
28
29
30
607

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents