Download Print this page

Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual page 318

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

SM400
X10
HEXA
Conversion source data
(s)
D200
D201
D202
D203
D204
D205
D206
D207
D208
Number of specified characters and conversion result
When (n)=K2
(n)
D102
1
(1)
2
3
4
5
6
7
8
0H
9
(1): The data remain the same.
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.
7 BASIC INSTRUCTIONS
316
7.5 Data Conversion Instructions
SM8161
D200
D100
K4
ASCII data
30H
41H
42H
43H
31H
32H
33H
34H
35H
(d)
D200
D101
D100
0H
0AH
D201
0ABH
0ABCH
0
D100
0H
ABC1H
0AH
BC12H
0ABH
C123H
0ABCH
1234H
ABC1H
2345H
8-bit conversion mode
"." indicates "0".
0
0
0
0
0
0
0
16 bits
Ignored
Lower 8 bits
Source data
Hexadecimal code
0
A
B
C
1
2
3
4
5
0
0
1
1
0
0
0
0
30H to "0"
0
1
0
0
0
0
0
1
41H to "A"
0
0
0
0
1
0
1
0
0
A

Hide quick links:

Advertisement

loading