Fnc201 - Val / Character String 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
26.2
FNC201 – VAL / Character String to BIN Conversion
Outline
This instruction converts a character string (ASCII codes) into binary data.
On the other hand, EVAL (FNC117) instruction converts a character string (ASCII codes) into floating point
data.
1. Instruction format
FNC 201
D
VAL
2. Set data
Operand Type
S
D
1
D
2
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
1
D
2
Explanation of function and operation
1. 16-bit operation (VAL and VALP)
1) A character string stored in
of the binary data acquired for conversion is stored in
stored in
In converting a character string into binary data, the data from
handled as a character string in byte units.
Command
input
b15
ASCII code of 1st character
+0
S
ASCII code of 3rd character
+1
ASCII code of 5th character
+2
ASCII code of 7th character
+3
+4
648
Mnemonic
16-bit Instruction
P
7 steps VAL
VALP
Head device number storing a character string to be converted into binary data
Head device number storing the number of all digits of the binary data acquired
by conversion
Head device number storing the binary data acquired by conversion
Digit Specification
and later is converted into 16-bit binary data. The number of all digits
S
+1, and the converted binary data is stored in
D
1
FNC201
S
D
1
VAL
b8 b7
ASCII code indicating sign
ASCII code of 2nd character
ASCII code of 4th character
ASCII code of 6th character
It indicates the end of character string.
26 Character String Control – FNC200 to FNC209
26.2 FNC201 – VAL / Character String to BIN Conversion
→ For character strings, refer to Section 5.3.
→ For EVAL (FNC117) instruction, refer to Section 18.5.
Operation Condition
32-bit Instruction
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
, the number of digits of the decimal part is
D
1
D
D
2
b0
-
00H
Mnemonic
Operation Condition
DVAL
13 steps
DVALP
Character string
16- or 32-bit binary
Others
Con-
Real
Index
stant
Number
V Z Modify K H
E
.
2
to a device number storing "00H" is
S
Number of all
+0
D
1
+1
Number of digits
of decimal part
Integer value in
D
2
which decimal
point is ignored
16-bit binary data
Continuous
Operation
Pulse (Single)
Operation
Data Type
16-bit binary
Charac-
Pointer
ter String
" "
P
digits

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents