Mitsubishi Electronics FX3G User Manual

Page of 964
320
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
12 Data Operation – FNC 40 to FNC 49
12.2 FNC 41 – DECO / Decode
12.2
FNC 41 – DECO / Decode
Outline
This instruction converts numeric data into ON bit.
A bit number which is set to ON by this instruction indicates a numeric value.
1. Instruction format
2. Set data
3. Applicable devices
S1: This function is supported only in FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 PLCs.
S2: This function is supported only in FX
3U
/FX
3UC
 PLCs.
Explanation of function and operation
1. 16-bit operation (DECO and DECOP)
One bit among 
 to 
+2
n
 
− 1 is set to ON according to the 
 value.
1) When 
 is a bit device (1 
≤ n ≤ 8)
The numeric value (expressed in 2
n
, 1 
≤ n ≤ 8) of a device specified by 
 is decoded to 
.
-When all bits of 
 are "0", the bit device 
 turns ON.
-When "n" is "8", 2
8
 points (= 256 bits which is the maximum value) are occupied.
Operand type
Description
Data type
Data to be decoded or word device number storing data
16-bit binary
Bit or word device number storing the decoding result
16-bit binary
n
Number of bits of device storing the decoding result (n = 1 to 8)
(No processing is executed in the case of "n = 0".)
16-bit binary
Oper-
and 
Type
Bit Devices
Word Devices
Others
System User
Digit Specification
System User
Special 
Unit
Index
Con-
stant
Real 
Number
Charac-
ter String
Pointer
X Y M T C S D .b KnX KnY KnM KnS T C D
R U \G
V Z Modify K H
E
" "
P
S1
S2
S1
S2
n
P
FNC 41
DECO

Mnemonic
Operation Condition
16-bit Instruction
 7 steps DECO
DECOP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
32-bit Instruction
S
1
 ‚
  S
  D
S
1
 ‚
  S
S
2
 ‚
  D
  
D
1
   
D
  
D
1
   
D
  
D
1
   
S
  
D
1
   
D
  
D
1
   
S
  
D
1
   
D
  
D
1
   
S
  
D
1
   
D
When           is M0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
← n
Up to 256 bits (The number of occupied bits varies depending on the specified "n" value.)
Up to
M31
Up to
M63
Up to
M127
Up to
M255
K1
K2
K3
K4
K5
K6
K7
K8
Turns ON when all
bits of           are OFF.
0 0 0 0 1 1 1 0
1
2
4
8
16
32
64
128
← 2
n
8 bits
b0
b1
b2
b3
b4
b5
b6
b7
M255
M0
M1
M2
M3
M4
M5
M6
M7
M8
M9
M10
M11
M12
M13
M14
M15
b8
b9
b10
b11
b12
b13
b14
b15
When           is D0
When it is Y, M or S
(1 
≤ n ≤ 8)
Command
input
FNC 41
DECO
n
Ignored
When "n" is "8"