Fnc201 - Val / Character String To Bin Conversion - Mitsubishi Electric FX3G SERIES Programming Manual

Programmable controllers
Hide thumbs Also See for FX3G SERIES:
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
P
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
S
D
1
D
2
Explanation of function and operation
1. 16-bit operation (VAL and VALP)
1)
A character string stored in
binary data acquired for conversion is stored in
D
+1, and the converted binary data is stored in
1
In converting a character string into binary data, the data from
as a character string in byte units.
Command
input
FNC201
VAL
b15
ASCII code of 1st character
S
+0
ASCII code of 3rd character
+1
ASCII code of 5th character
+2
ASCII code of 7th character
+3
+4
Mnemonic
16-bit Instruction
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
S
and later is converted into 16-bit binary data. The number of all digits of the
S
D
D
1
b8 b7
ASCII code indicating sign
ASCII code of 2nd character
ASCII code of 4th character
ASCII code of 6th character
00H
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
13 steps
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
T
C D R U \G
V
Z Modify K
D
, the number of digits of the decimal part is stored in
1
D
.
2
to a device number storing "00H" is handled
S
2
b0
-
Mnemonic
Operation Condition
Continuous
DVAL
Operation
Pulse (Single)
DVALP
Operation
Data Type
Character string
16-bit binary
16- or 32-bit binary
Others
Con-
Real
Charac-
Index
stant
Number
ter String
H
E
" "
Number of all
+0
digits
D
1
Number of digits
+1
of decimal part
Integer value in
D
2
which decimal
point is ignored
16-bit binary data
21
22
23
24
25
Pointer
P
26
27
28
29
30
619

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx3u seriesFx3uc series

Table of Contents