327
L E N P
S
D
1
2
M
3
○
FNC
203
X Y M S
D.b R.b
KnX KnY
KnM KnS
T C
D,R
V,Z
UnG
K,H
E
" $"
S
D
S : the head ID of the character string to be measured
D : the device to store the length of the string
LEN D0 D100
X0
D
To count the length of the string that is from the head component to the last character (before the end of string
“00H” appears) and store the result number into .
S
S
D
D0
D1
D2
D3
00H
20H( )
45H( E)
49H
I
( )
49H
I
( )
4CH( L)
4BH K( )
20H( )
4FH
O
( )
49H
I
( )47H(G)
52H R( )
56H(V)
D4
D5
D6
" I LIKE VIGOR"
X0=ON
D100
12
D
S
If the length of the string is more than 32,767 characters, the PLC will regard that as an operational error.
S
Operand
Devices
Character String Length Detection
Upper
8 bits
Lower
8 bits
When X0 = “ON”, the instruction will be executed as follows: