Mitsubishi Electric MELSEC FX3U Programming Manual page 652

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
2. 32-bit operation (DVAL and DVALP)
1) A character string stored in
of the binary data acquired for conversion is stored in
stored in
In conversion from a character string into binary data, the data from
"00H" is handled as a character string in byte units.
Command
input
FNC201
DVAL
b15
+0
ASCII code of 1st character
S
ASCII code of 3rd character
+1
+2
ASCII code of 5th character
+3
ASCII code of 7th character
ASCII code of 9th character
+4
+5
ASCII code of 11th character
+6
For example, when a character string "-12345.678" is specified in
is stored in
b15
31H(1)
+0
S
33H(3)
+1
35H(5)
+2
36H(6)
+3
38H(8)
+4
+5
2) Character string to be converted
a) Number of characters of character string and the numeric range when the decimal point is ignored
Number of all characters (digits)
Number of characters (digits) of decimal part
Numeric range when decimal point is ignored
b) Character types used in characters to be converted
Sign
Decimal point
Number
3)
stores the number of all digits. The number of all digits indicates the number of all characters
D
1
(including the number, sign and decimal point).
4)
+1 stores the number of digits of the decimal part. The number of digits of the decimal part
D
1
indicates the number of all characters after the decimal point "." (2EH).
650
and later is converted into 32-bit binary data. The number of all digits
S
+1, and the binary data is stored in [
D
1
S
D
1
b8 b7
ASCII code indicating sign
ASCII code of 2nd character
ASCII code of 4th character
ASCII code of 6th character
ASCII code of 8th character
ASCII code of 10th character
00H
ASCII code of 12th character
It indicates the end of character string.
and
as shown below.
D
D
1
2
b8 b7
2DH(-)
32H(2)
34H(4)
2EH(.)
37H(7)
00H
Positive numeric value
Negative numeric value "–" (2D
26 Character String Control – FNC200 to FNC209
26.2 FNC201 – VAL / Character String to BIN Conversion
, the number of digits of the decimal part is
D
1
+1,
D
2
D
2
b0
-
b0
-
1
2 3
4
5
2 to 13
0 to 10 and smaller than "number of all digits −3"
−2,147,483,648 to +2,147,483,647
Example: 12345.678 → "12345678"
Character type
"Space" (20
)
H
)
H
"." (2E
)
H
"0" (30
) to "9" (39
)
H
H
].
D
2
to a device number storing
S
+0
D
1
+1
D
2
Integer value in
which decimal
point is ignored
32-bit binary
and later, the conversion result
S
+0
D
1
+1
6
7
8
D
Description
Number of all
digits
Number of digits
of decimal part
+1
D
2
data
10
3
-12345678
+1
D
2
2

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents