316
7 BASIC INSTRUCTIONS
7.5 Data Conversion Instructions
Precautions
• Make sure that only ASCII codes "0" to "9" and "A" to "F" are stored in the device specified by (s).
• If ASCII data is not stored in the device specified for (s) by the HEXA(P) instructions, an operation error occurs and
conversion into hexadecimal code is disabled. Especially, note that when SM8161 is OFF (16-bit conversion mode), ASCII
code should be stored in high-order 8 bits of the device specified by (s).
• The number of points occupied by the device specified by (d) varies depending on the ON/OFF status of SM8161. When
SM8161 is on (8-bit conversion mode), as many points as the number of characters are occupied, and when SM8161 is
OFF (16-bit conversion mode) as many points as the (number of characters
2) are occupied.
• The SM8161 flag is also used for the RS2, ASCI(P), CCD(P) and CRC(P) instructions. When using these instructions and
the HEXA(P) instructions in the same program, make sure to set SM8161 to ON or OFF just before each instruction so that
SM3161 does not affect another instruction.
Conversion source data
(s)
ASCII data
Hexadecimal code
D200
30H
0
D201
41H
A
D202
42H
B
D203
43H
C
D204
31H
1
D205
32H
2
D206
33H
3
D207
34H
4
D208
35H
5
Number of specified characters and conversion result "." indicates "0".
When (n)=K2
(1): The data remain the same.
HEXA
D200
SM8161
SM400
X10
D100
K4
8-bit conversion mode
16 bits
Source data
Ignored
Lower 8 bits
(n)
(d)
D102
D101
D100
1
2
3
4
5
6
7
8
9
D200
0
0
0
0
0
0
0
A
0
0
0
0
0
0
0
0
D201
D100
1
1
0
0
1
1
0
0
0
0
0
0
1
0
1
0
0
0
0AH
(1)
0H
0ABH
0ABCH
ABC1H
BC12H
C123H
1234H
2345H
0AH
0H
0ABH
0ABCH
ABC1H
30H to "0"
41H to "A"
0H
Summary of Contents for MELSEC iQ-F FX5
Page 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 17: ...15 CONTENTS ...
Page 24: ...22 MEMO ...
Page 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Page 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Page 1107: ...I 1105 MEMO ...
Page 1111: ......