Using Character String Data - Mitsubishi Electric MELSEC-Q/L Programming Manual

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

Advertisement

Using character string data

Character string data is character data used by basic instructions and application instructions.
The target ranges from the designated character to the NULL code (00H) that indicates the end of the character string.
When designated character is the NULL code
One word is used to store the NULL code.
M0
$MOV " "
When character string is even
Uses (number of characters/2 + 1) words, and stores character string and NULL code.
For example, if "ABCD" is transferred to D0, the character string ABCD is stored at D0 and D1, and the NULL code is stored
at D2. (The NULL code is stored as the last one word.)
M0
$MOV "ABCD"
When number of characters is odd
Uses (number of characters/2) words (rounds up decimal fractions) and stores the character string and NULL code.
For example, if "ABCDE" is transferred to devices starting from D0, the character string (ABCDE) and the NULL code are
stored from D0 to D2. (The NULL code is stored into the upper 8 bits of the last one word.)
M0
$MOV "ABCDE" D0
D0
D0 NULL
Designation of NULL code (00
Character string data transfer instruction
D0
42
41
D0
H
H
D1
44
43
H
H
D2
NULL
Designation of a character string
composed of even numbers
Character string data transfer instruction
D0
42
41
H
H
D1
44
43
H
H
D2
NULL
45
H
Designation of a character string
composed of odd numbers
Character string data transfer instruction
)
H
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
3
91

Advertisement

Table of Contents
loading

Table of Contents