11 - 116 11 - 116
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
REMARK
• See Sections 7.2.1 and 7.3.3.
• Since there are a large number of Kanji characters, all the characters cannot be
assigned a character number in the 256 different character codes of one byte (8
bits). Therefore, for Kanji, 2 bytes (16 bits) of code is used for each character. This
allows 65536 types of codes ranging from 0000h through FFFFh. However, if 1-
byte and 2-byte codes are simply used, it cannot be determined when 2 bytes of
code are used to express a Kanji character. To remedy this, two types of Kanji
codes have been developed.
• JIS Kanji Code
A Kanji shift-in (KI) code is always placed in front of a code that expresses Kanji
character and a Kanji shift-out (KO) code is always placed in back of a code that
expresses a Kanji character. Since Kanji shift-in and shift-out codes are
predetermined, data can be identified whether or not it expresses Kanji characters
or not.
It's Kanji because it uses
KI and KO codes.
"@" = KI
30
H
26
H
KO
• Shift JIS Kanji Code
In Shift JIS Kanji code, there is a rule that states that one byte of character code
from 80h through 9Fh or E0h through FFh express the first byte of a Kanji code.
When this method is used, special codes (Kanji shift-in/shift-out) are not necessary
to express Kanji characters, but character codes 80h through 9Fh and E0h
through FFh cannot be used.
88
H
AF
H
It's Kanji because it
uses 80
H
to 9F
H
.
"@" =
• The Shift JIS Kanji code (Kanji code used by the communication module) and JIS
code correspond as follows.
nn
mm
00 3F 40
7E
9E
FC FF
80
9F
00
80
9F
E0
EF
FF
2121
2321
5D21
5F21
7D21
2160
2360
5D60
5F60
7D60
215F
235F
5D5F
5F5F
7D5F
217E
237E
5D7E
5F7E
7D7E
2221
5E21
6021
7E21
227E
5E7E
607E
7E7E
(JIS)
(JIS)
(JIS)
(JIS)
7F
(Shift JIS)
mm indicates the upper
bytes of the Shift JIS code.
nn indicates the lower
bytes of the Shift JIS code.
are unused areas.
(S
h
ift
JI
S)