Mitsubishi Electronics FX3G Video Gaming Accessories User Manual


 
624
FX3G/FX3U/FX3UC Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
26 Character String Control – FNC200 to FNC209
26.4 FNC203 – LEN / Character String Length Detection
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
XYMTCSD
.b KnX KnY KnM KnS T C D R
U\G
V Z Modify K H E "
"P
33333333 3 3
3333333 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
+nS
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
+4S
46H(F) 45H(E)
47H(G)
“ABCDEFGHI”
00H 49H(I)
+3S
b7-------------b0