Download Print this page

Extracting Character String Data From The Left - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

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

Advertisement

Extracting character string data from the left

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

Hide quick links:

Advertisement

loading