Fnc203 - Len / Character String Length Detection - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
26.4
FNC203 – LEN / Character String Length Detection
Outline
This instruction detects the number of characters (bytes) of a specified character string.
1. Instruction format
FNC 203
P
LEN
2. Set data
Operand Type
S
D
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
S
D
Explanation of function and operation
1. 16-bit operation (LEN and LENP)
The length of a character string stored in
until the first device storing "00H" is handled as a character string in units of byte.
S
Command
input
FNC203
LEN
b15----------b8
S
2nd character 1st character
4th character 3rd character
S
+1
S
+2
6th character 5th character
S
+n
00H
It indicates the end of character string.
For example, when "ABCDEFGHI" is stored in
b15----------b8
S
42H(B)
S
+1
44H(D)
S
+2
46H(F)
S
+3
48H(H)
S
+4
00H
Mnemonic
16-bit Instruction
LEN
5 steps
LENP
Head device number storing a character string whose length is to be detected
Device number storing the detected character string length (number of bytes)
Digit Specification
S
S
D
b7-------------b0
"n"th character
b7-------------b0
41H(A)
43H(C)
"ABCDEFGHI"
45H(E)
47H(G)
49H(I)
26 Character String Control – FNC200 to FNC209
26.4 FNC203 – LEN / Character String Length Detection
→ For handling of character strings, refer to Section 5.3.
Operation Condition
32-bit Instruction
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Index
Unit
V Z Modify K H
and later is detected, and stored to
b15---------------b0
Character string
D
length
and later as shown below, K9 is stored to
S
b15---------------b0
D
9
Mnemonic
Operation Condition
Data Type
Character string
16-bit binary
Others
Con-
Real
Charac-
Pointer
stant
Number
ter String
E
" "
P
. Data starting from
D
.
D
655
21
22
23
24
25
26
27
28
29
30

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents