Character Strings; Character String Constant ("Abc"); Character String Data - Mitsubishi Electric MELSEC-Q Structured Programming Manual

Hide thumbs Also See for MELSEC-Q:
Table of Contents

Advertisement

FXCPU Structured Programming Manual
[Device & Common]
3.3

Character Strings

Character strings are classified into character string constants which directly specify character strings as
operands in instructions and character string data.
FX
/FX
/FX
/FX
0S
0
0N
strings.
3.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 codes are available.
Up to 32 characters can be specified as a character string.
3.3.2

Character string data

With regard to character string data, the range from a specified device to the NUL code (00H) is handled as
one character string in units of byte.
When expressing (recognizing) character string data using bit devices with digit specification, however, 16
bits are required also for data including NUL code (00H) which specifies the end of the character string
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 instruction (Error cord: K6706):
• When "00H" is not set in the corresponding device range after the device number specified as the source
in an instruction
• When there are insufficient devices for storing character string data (including "00H" or "0000H" which
indicates the end of the character string data) in devices specified as the destination in an instruction
1) Character string data stored in word devices
Example of data which can be recognized as
character string data
b15
b8 b7
D100
2nd character
D101
4th character
D102
6th character
D110
00H
2) Character string data stored in bit devices with digit specification
Example of data which can be recognized as
character string data
/FX
/FX
/FX
/FX
1S
1N
1NC
U
2C
b0
1st character
3rd character
5th character
21st character
"00H" which indicates
the end of the character
string can be detected.
3 How to Specify Devices and Constants in Instructions
/FX
/FX
/FX
/FX
/FX
2N
2NC
3S
3G
Example of data which cannot be recognized as
character string data
b15
b8 b7
b0
D100
2nd character
1st character
D101
4th character
3rd character
D102
6th character
5th character
D7999
"n"th character
"(n-1)"th character
"00H" which indicates the end of the character
string cannot be detected in the range from the
specified device to the last device number.
Example of data which cannot be recognized as
character string data
3.3 Character Strings
PLCs do not support character
3GC
1
2
3
4
5
6
7
129

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-lMelsec-fFx3sFx3gFx3gcFx3u ... Show all

Table of Contents