7 APPLICATION INSTRUCTIONS
7.11 Character String Processing Instructions
549
7
Character string length detection
LEN(P)
• Detects length of character string designated by (S) and stores in the area starting from the device number designated by
(D). Processes the data from the device number designated by (S) to the device number storing "00H" as a character
string.
For example, when the value "ABCDEFGHI" is stored in the area starting from (S), the value 9 is stored at (D).
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
(S): Character string or head number of the devices where the character string is stored (character string)
(D): Number of the device where the length of detected character string will be stored (BIN 16 bits)
Setting
data
Internal device R, ZR J\ U\G Zn Constant
$
Others
Bit Word Bit Word
(S)
(D)
Error
code
Error details Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4101 There is no NULL code "00H" within the range of the corresponding devices
starting from the device number specified by (S).
Process
High
performance
Redundant
Universal
LCPU
Basic
Command
Command
LEN
LENP
S D
S D
LEN
LENP
1st character2nd character
3rd character4th character
b15 b8b7
b0
5th character6th character
nth character
00
H
Indicates the end of character string
b15
b0
Length of character string
S
D
S
S
S
+1
41
H
(A)42
H
(B)
43
H
(C)44
H
(D)
b15 b8b7 b0
45
H
(E)46
H
(F)
+2
+3
+4
47
H
(G)48
H
(H)
49
H
(I)00
H
"ABCDEFGHI"
b15 b0
9
S
D
S
S
S
S