Mitsubishi Electronics FX3G User Manual

Page of 964
674
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
29 Data Table Operation – FNC250 to FNC269
29.5 FNC260 – DABIN / Decimal ASCII to BIN Conversion
29.5
FNC260 – DABIN / Decimal ASCII to BIN Conversion
Outline
This instruction converts numeric data expressed in decimal ASCII codes (30H to 39H) into binary data.
1. Instruction format
2. Set data
3. Applicable devices
Explanation of function and operation
1. 16-bit operation (DABIN and DABINP)
1) Data stored in 
 to 
+2 expressed in decimal ASCII codes (30H to 39H) is converted into 16-bit binary
data, and stored in 
.
For example, when 
 to 
+2 store ASCII codes expressing "-25108", 16-bit binary data is stored in
 as follows:
2) The numeric range of data stored in 
 to 
+2 is from -32768 to +32767.
3) As "sign data" (low-order byte of 
), "20H (space)" is set when the data to be converted is positive, and "2DH
(-)" is set when the data to be converted is negative.
4) An ASCII code for each digit is ranging from "30H" to "39H".
5) When an ASCII code for each digit is "20H (space)" or "00H (NULL)", it is handled as "30H".
Operand Type
Description
Data Type
Head device number storing data (ASCII codes) to be converted into binary data
Character string
Device number storing conversion result
16- or 32-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
P
FNC 260
DABIN
D
Mnemonic
Operation Condition
16-bit Instruction
 5 steps
DABIN
DABINP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
32-bit Instruction
 9 steps
DDABIN
DDABINP
Continuous
Operation
Pulse (Single)
Operation
  S
  D
  S
  D
   
S
   
S
   
D
Command
input
FNC260
DABINP
+0
b15
+2
b8 b7
b0
+1
b0
b15
16-bit binary data
ASCII code for 1's digit
ASCII code for 10's digit
ASCII code for 10000's digit
ASCII code for 100's digit
Sign data
ASCII code for 1000's digit
   
S
   
S
   
D
+0
b15
+2
b8 b7
b0
+1
-25108
b0
b15
38H(8)
30H(0)
32H(2)
31H(1)
2DH(-)
35H(5)
   
S
   
S
   
S