463
LEN, LENP
1
2
3
4
4
6
7
8
7.11
Char
acter
string processing inst
ructions
7.11.8
LEN, LENP
Program
E
xamp
l
e
(1) The following program stores the comments set at D100 into the area starting from W0 as ASCII when X1C is turned ON.
[Ladder Mode]
[List Mode]
[Operation]
Caut
i
on
(1) The processing completes after several scans.
(2) The COMRD(P)/PRC instruction is not executed if the start signal (execution command) of the COMRD(P)/PRC
instruction is turned ON before completion of the instruction (while SM721 is ON). Execute the COMRD(P)/PRC
instruction when SM721 is OFF.
(3) Two or more file comments cannot be accessed simultaneously.
(4) The following instructions cannot be executed simultaneously because they use SM721 in common.
(5) For the LCPU, when a comment file stored on an SD memory card is used, this instruction cannot be executed while
SM606 (SD memory card forced disable instruction) is ON.
Even if the instruction is attempted to beit executed, the command will be ignored.
: Character string or head number of the devices where the character string is stored (character string)
: Number of the device where the length of detected character string will be stored (BIN 16 bits)
Instruction Name
ON During Execution
ON for One Scan After Completion
ON after Abnormal Completion
SP. FREAD
SP. FWRITE
SM721
Designated by instruction.
(Device designated by instruction) + 1
PRC
COMRD
SM720
None
LEN, LENP
Character string length detection
7.11.8
LEN, LENP
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
$
Other
Bit
Word
Bit
Word
––
––
––
––
––
Step
I
nstruct
i
on
De
vi
ce
W1
b15
b0
W2
Comment
at
D100
W3
W
4
W5
W6
W7
W15
W16
W0
LINE
A
T
ARG
ET
4
9
H
(
I
)
4E
H
(
N
)
20
H
(space)
20
H
(space)
4
5
H
(
E
)
4
1
H
(A)
4
1
H
(A)
5
4
H
(
T
)
5
4
H
(
T
)
4
7
H
(G)
52
H
(R)
4
5
H
(
E
)
20
H
(space)
20
H
(space)
20
H
(space)
20
H
(space)
20
H
(space)
b8 b7
4
C
H
(
L
)
00
H
Process
High
performance
Redundant Universal
LCPU
Bas
i
c
Command
Command
LEN
LEN
P
S
D
S
D
LEN
LENP
S
D
S
D