M800V/M80V Series PLC Programming Manual (1/2)
8 Function Instructions
8.10 Character String Processing Instructions
LEN, LENP: Character string length detection
Setting
Bit devices
data
X
Y
M
L
F
S
D
○
○
○
○
○
[Instruction symbol] [Execution condition]
LEN
LENP
Setting data
Setting data
Character string or the first number of the device where the character string is
S
stored.
D
Number of the device that will store the length of detected character string.
Functions
LEN
Detects the length of the character string designated by (S) and stores in the area starting from the device number desig-
nated by (D). Processes the data from the device number designated by (S) to the device number storing "00H" as a char-
acter string.
b15
2nd character
S
S+1
4th character
6th character
S+2
S+n
00H
Indicates the end of character string.
For example, if the ASCII code "ABCDEFGHI" is designated in the area starting from (S), "9" will be stored at (D).
b15
S
42H (B)
S+1
44H (D)
S+2
46H (F)
S+3
48H (H)
S+4
00H
IB-1501667-B
Usable devices
B SB
T SM V
T
C
○
○
○
○
○
○
○
Command
Command
Meaning
b8b7
b0
1st character
3rd character
5th character
nth character
b8b7
b0
41H (A)
43H (C)
45H (E)
47H (G)
49H (I)
Con-
Word devices
stant
D
R/ZR W SW SD
Z
○
○
○
○
○
○
○
○
○
○
○
b15
Length of character
D
string
b15
b0
D
9
330
Digit
Pointer
designa-
Index
tion
$
P
○
○
○
indicates the sign "LEN".
S
D
P
S
D
Data type
Character string
BIN 16 bits
b0