Character Strings; Character String Constant ("Abc"); Character String Data - 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
5.3

Character Strings

Character strings are classified into character string constants which directly specify character strings in
operands in applied instructions and character string data.
5.3.1

Character string constant ("ABC")

A device "character string" directly specifies a character string in a sequence program.
Put half-width characters inside quotation marks (example: "ABCD1234") in specification.
JIS8 code is available.
Up to 32 characters can be specified as a character string.
5.3.2

Character string data

With regard to character string data, a specified device to the NUL code (00H) is handled as one character
string in 1-byte units.
When expressing (recognizing) character string data by bit devices with digit specification, however, 16 bits
are required for data including the NUL code (00H) specifying the end of the character string data because
the instruction length is 16 bits. (Refer to Example 2 in the step 2 below.)
In the following cases, an operation error occurs in the applied instruction (error code: K6706):
• When "00H" is not specified in the corresponding device range after the source device number specified in
an applied instruction
• When there are insufficient devices for storing character string data (including "00H" or "0000H" indicating
the end of the character string data) in the destination devices specified in an applied instruction
1) Character string data stored in word devices
• Example of data which can be
recognized as character string data
b15
D100
2nd character
D101
D102
D110
2) Character string data stored in bit devices with digit specification
• Example of data which can be
recognized as character string data
M115 to M100
2nd character
M131 to M116
4th character
M147 to M132
6th character
M211 to M196
b8 b7
1st character
4th character
3rd character
6th character
5th character
00H
21st character
"00H" indicating the end of
the character string can be
detected.
16 bits
1st character
3rd character
5th character
00H
13th character
"00H" indicating the
end of the character
string can be
detected.
5 How to Specify Devices and Constants to Instructions
• Example of data which cannot be
recognized as character string data
b0
b15
D100
2nd character
D101
4th character
D102
6th character
D7999
"n"th character
"00H" indicating the end of character string
cannot be detected from the specified
device to the end device number.
• Examples of data which cannot be
recognized as character string data
<Example 1>
M115 to M100
2nd character
M131 to M116
4th character
M147 to M132
6th character
M7679 to
"n"th character
M7664
"00H" indicating the end of character string
cannot be detected from the specified
device to the end device number.
<Example 2>
M7623 to M7608
2nd character
M7639 to M7624
4th character
M7655 to M7640
6th character
M7671 to M7656
8th character
M7679 to M7672
Because the data "00H" indicating the end
of the character string does not reach 16
bits, the end of the character string cannot
be recognized.
5.3 Character Strings
b8 b7
b0
1st character
3rd character
5th character
"(n-1)"th character
16 bits
1st character
3rd character
5th character
"(n-1)"th character
16 bits
1st character
3rd character
5th character
7th character
00H
1
2
3
4
5
6
7
8
9
10
163

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents