611
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
26 Character String Control – FNC200 to FNC209
26.4 FNC203 – LEN / Character String Length Detection
21
FN
C
160-FN
C
169
R
eal
Ti
m
e
C
loc
k
C
ont
ro
l
22
FN
C
170
-F
N
C
17
9
E
xt
e
rnal
D
evi
ce
23
FN
C
180
Su
b
st.
I
n
str
. I
n
fo
24
FN
C
181-FN
C
189
O
ther
s
25
FN
C
190-FN
C
19
9
B
loc
k D
a
ta
O
per
at
io
n
26
FN
C
200-FN
C
209
C
har
act
e
r St
ring
C
ont
ro
l
27
F
N
C2
10
-F
NC
21
9
Da
ta
O
per
at
ion 3
28
FN
C
220-FN
C
24
9
Da
ta
Co
m
p
a
ris
o
n
29
FN
C
250-FN
C
269
Da
ta
T
a
b
le
O
per
at
io
n
30
FN
C
27
0-F
N
C
274
Ex
-D
ev
ic
e
In
ve
rte
r C
o
mm
s
26.4
FNC203 – LEN / Character String Length Detection
Outline
This instruction detects the number of characters (bytes) of a specified character string.
→
For handling of character strings, refer to Section 5.3.
1. Instruction format
2. Set data
3. Applicable devices
Explanation of function and operation
1. 16-bit operation (LEN and LENP)
The length of a character string stored in
and later is detected, and stored to
. Data starting from
until the first device storing "00H" is handled as a character string in units of byte.
For example, when “ABCDEFGHI” is stored in
and later as shown below, K9 is stored to
.
Operand Type
Description
Data Type
Head device number storing a character string whose length is to be detected
Character string
Device number storing the detected character string length (number of bytes)
16-bit binary
Oper-
and
Type
Bit Devices
Word Devices
Others
System User
Digit Specification
System User
Special
Unit
Index
Con-
stant
Real
Number
Charac-
ter String
Pointer
X Y M T C S D
.b KnX KnY KnM KnS
T
C
D
R U
\G
V
Z Modify K
H
E
"
"
P
3
3
3
3
3 3 3 3
3
3
3
3
3
3 3 3 3
3
3
P
FNC 203
LEN
Mnemonic
Operation Condition
16-bit Instruction
5 steps
LEN
LENP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
32-bit Instruction
⎯
⎯
S
D
S
D
S
D
S
FNC203
LEN
b15----------b8
+1
+2
2nd character 1st character
4th character
3rd character
00H
b15---------------b0
Character string
length
D
S
S
S
+n
S
6th character
5th character
“n”th character
It indicates the end of character string.
Command
input
D
S
b7-------------b0
S
D
b15----------b8
+1
+2
42H(B)
41H(A)
44H(D)
43H(C)
48H(H)
b15---------------b0
9
D
S
S
S
+4
S
46H(F)
45H(E)
47H(G)
“ABCDEFGHI”
00H
49H(I)
+3
S
b7-------------b0