Fnc260 - Dabin / Decimal Ascii To Bin 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
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
FNC 260
D
DABIN
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
Explanation of function and operation
1. 16-bit operation (DABIN and DABINP)
1) Data stored in
binary data, and stored in
Command
input
b15
ASCII code for 10000's digit
+0
S
ASCII code for 100's digit
+1
ASCII code for 1's digit
+2
For example, when
in
as follows:
D
b15
+0
S
+1
+2
2) The numeric range of data stored in
3) As "sign data" (low-order byte of
and "2DH (-)" is set when the data to be converted is negative.
4) An ASCII code for each digit is within the range from 30H to 39H.
5) When an ASCII code for each digit is "20H (space)" or "00H (null)", it is handled as "30H".
714
Mnemonic
16-bit Instruction
DABIN
P
5 steps
DABINP
Head device number storing data (ASCII codes) to be converted into binary data
Device number storing conversion result
Digit Specification
to
+2 expressed in decimal ASCII codes (30H to 39H) is converted into 16-bit
S
S
.
D
FNC260
S
D
DABINP
b8 b7
ASCII code for 1000's digit
ASCII code for 10's digit
to
+2 store ASCII codes expressing "-25108", 16-bit binary data is stored
S
S
b8 b7
32H(2)
2DH(-)
31H(1)
35H(5)
38H(8)
30H(0)
S
29 Data Table Operation – FNC250 to FNC269
29.5 FNC260 – DABIN / Decimal ASCII to BIN Conversion
Operation Condition
32-bit Instruction
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
b0
Sign data
b0
b15
-25108
D
to
+2 is from -32768 to +32767.
S
S
), "20H (space)" is set when the data to be converted is positive,
Mnemonic
Operation Condition
DDABIN
9 steps
DDABINP
Character string
16- or 32-bit binary
Others
Con-
Real
Index
stant
Number
V Z Modify K H
E
b15
b0
D
16-bit binary data
b0
Continuous
Operation
Pulse (Single)
Operation
Data Type
Charac-
Pointer
ter String
" "
P

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents