Download Print this page

Detecting A Character String Length - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

Detecting a character string length

LEN(P)
These instructions detect the length of the character string specified by (s), and store the length in the device specified by (d)
and later.
These instructions handle data stored in the device specified by (s) to the device storing 00H as a character string.
Ladder diagram
(s)
*1
FBD/LD
EN
ENO
s
d
*1 The LEN instruction is not supported by the ST language and the FBD/LD language. Use LEN of the standard function.
Page 1024 LEN(_E)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
Character string or head device number storing a character string
(d)
Device number storing the detected character string length
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s)
(d)
*1 T, ST, C cannot be used.
Processing details
• These instructions detect the length of the character string specified by (s), and store the length in the device specified by
(d) and later.
• These instructions handle data stored in the device specified by (s) to the device storing 00H as a character string.
b15
(s)
2nd character
(s)+1
4th character
(s)+2
6th character
00H
(s)+n
Indicates the end of the character string.
8 APPLICATION INSTRUCTION
458
8.8 Character String Operation Instruction
(d)
Word
T, ST, C, D, W,
SD, SW, R
*1
b8
b7
b0
1st character
3rd character
5th character
"n"th character
Structured text
ENO:=LENP(EN,s,d);
Range
Double word Indirect
U\G
Z
LC
b15
Character string length
(d)
*1
Data type
Character string
16-bit signed binary
Bit
Bit
Constant
specification
LZ
K, H
b0
Data type (label)
ANYSTRING_SINGLE
ANY16
BOOL
BOOL
Others
E
$

Hide quick links:

Advertisement

loading