52
1 OVERVIEW
1.2 Data Specification Method
Number of words required for storing data
Character string data can be stored in word devices.
The following table lists the numbers of words required for storing character string data.
Character string data storage location
An image of the character string data storage location is shown below.
■Character strings
In each character string storage image, "NULL" indicates a NULL code (00H).
■Unicode character strings
In each Unicode character string storage image, "NULL" indicates a NULL code (0000H).
Number of
character string
bytes
Number of words required for storing character
strings
Number of words required for storing Unicode
character strings
0 byte 1 [word] 1 [word]
Odd number of bytes (Number of character string bytes+1) 2 [words] (because one character is an even number of bytes)
Even number of bytes (Number of character string bytes2) +1 [words] Number of characters+1 [words]
Character string
to be stored
Image of storing character string data from D0 Image of storing character string data from word type
label array arrayA[0]
Null character string
(("") or (''))
ABC
ABCD
Character string
to be stored
Image of storing character string data from D0 Image of storing character string data from word type
label array arrayA[0]
Null character string
("")
ABCD
arrayA[0]
NULL NULL
arrayA[0]
arrayA[1]
B
NULL
A
C
arrayA[0]
arrayA[1]
arrayA[2]
B
D
A
C
NULL NULL
arrayA[0]
NULL
arrayA[0]
arrayA[1]
arrayA[2]
arrayA[3]
arrayA[4]
A
B
C
D
NULL