26 Applied Instructions (Character String Control)
26.4 LEN / Character String Length Detection
633
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Applied Instructions
(Real Time
Clock Control)
22
Applied Instructions
(External Device)
23
Applied Instructions
(Extension
Function)
24
Applied Instructions
(Others)
25
Applied Instructions
(Block Data
Operation)
26
Applied Instructions
(Character
String Control)
27
Applied Instructions
(Data Operation 3)
28
Applied Instructions
(Data Comparison)
29
Applied Instructions
(Data Table
Operation)
30
Applied Instructions
(External Device
Communication)
Program examples
In the program example shown below, the length of a character string stored in D0 and later is output in 4-digit
BCD to Y040 to Y057 when X000 turns ON.
[ST]
LEN(X000,D0,D10);
BCD(X000,K4Y40);
[Structured ladder/FBD]
X000
The length of the character string
is output to the display unit.
LEN
EN ENO
d
s
D0 D10
BCD
EN
s
ENO
d
D10 K4Y40
D0
D1
49H(I) 4DH(M)
53H(S) 54H(T)
53H(S)
D10
10
D3
42H(B) 55H(U)
49H(I)
"MITSUBISHI"
(Characters "ABC ..."
after "00H" are ignored.)
49H(I)
41H(A)
43H(C) 42H(B)
48H(H)
D2
D4
D6
D5
00H
BCD
conversion
BCD
0 0 01
BCD value
Y057 to Y040
b15---b8 b7---- b0